fix emscripten builds on windows
[liba.git] / cmake / Emscripten.cmake
blobd948026a58074ea2334591764905e5aa92309594
1 set(CMAKE_SYSTEM_NAME Emscripten)
2 set(CMAKE_SYSTEM_VERSION 1)
4 set(WIN32)
5 set(APPLE)
6 set(UNIX 1)
8 set(CMAKE_C_COMPILER ${EMCC_EXECUTABLE})
9 set(CMAKE_CXX_COMPILER ${EMXX_EXECUTABLE})
10 set(CMAKE_C_COMPILER_AR ${EMAR_EXECUTABLE})
11 set(CMAKE_CXX_COMPILER_AR ${EMAR_EXECUTABLE})
12 set(CMAKE_C_COMPILER_RANLIB ${EMRANLIB_EXECUTABLE})
13 set(CMAKE_CXX_COMPILER_RANLIB ${EMRANLIB_EXECUTABLE})
14 set(CMAKE_CROSSCOMPILING_EMULATOR ${NODE_JS_EXECUTABLE})
16 set(CMAKE_C_STANDARD_LIBRARIES "")
17 set(CMAKE_CXX_STANDARD_LIBRARIES "")
18 set(CMAKE_C_IMPLICIT_LINK_LIBRARIES "")
19 set(CMAKE_CXX_IMPLICIT_LINK_LIBRARIES "")
20 set(CMAKE_C_IMPLICIT_INCLUDE_DIRECTORIES "${EMSCRIPTEN_SYSROOT}/include")
21 set(CMAKE_CXX_IMPLICIT_INCLUDE_DIRECTORIES "${EMSCRIPTEN_SYSROOT}/include")
23 list(FIND CMAKE_C_COMPILER_PREDEFINES_COMMAND -m64 emcc)
24 if(${emcc} GREATER 0)
25   unset(CMAKE_C_COMPILER_ARG${emcc} CACHE)
26   unset(CMAKE_C_COMPILER_ARG${emcc})
27 endif()
28 list(FIND CMAKE_CXX_COMPILER_PREDEFINES_COMMAND -m64 emxx)
29 if(${emxx} GREATER 0)
30   unset(CMAKE_CXX_COMPILER_ARG${emxx} CACHE)
31   unset(CMAKE_CXX_COMPILER_ARG${emxx})
32 endif()