6e79476650
* Fixed the build for web using CMake. I found that the build for me was failing and I added some if defined checks in the core.c file where the glfwSetWindowAttrib was used. (error: implicit declaration of function 'glfwSetWindowAttrib' is invalid in C99 [-Werror,-Wimplicit-function-declaration]) I also changed some values in the toolchain file so that it correctly uses the .bat files when on windows. * Cleaned up the additional variables (they are not important) * Added more improvements to cmakelists Added the option to use the system provided Emscripten toolchain to be more uniform with other libraries. Fixed and issue which prevented example being built from cmake and also building with html extensions properly. * Fixed ENUM to STRING because of a missed warning
24 lines
646 B
CMake
24 lines
646 B
CMake
SET(CMAKE_SYSTEM_NAME Linux)
|
|
SET(CMAKE_SYSTEM_PROCESSOR x86)
|
|
|
|
if (CMAKE_HOST_WIN32)
|
|
SET(EMSCRIPTEN_EXTENSION ".bat")
|
|
else ()
|
|
SET(EMSCRIPTEN_EXTENSION "")
|
|
endif()
|
|
|
|
SET(CMAKE_C_COMPILER emcc${EMSCRIPTEN_EXTENSION})
|
|
SET(CMAKE_CXX_COMPILER em++${EMSCRIPTEN_EXTENSION})
|
|
|
|
if(NOT DEFINED CMAKE_AR)
|
|
find_program(CMAKE_AR NAMES emar${EMSCRIPTEN_EXTENSION})
|
|
endif()
|
|
if(NOT DEFINED CMAKE_RANLIB)
|
|
find_program(CMAKE_RANLIB NAMES emranlib${EMSCRIPTEN_EXTENSION})
|
|
endif()
|
|
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE BOTH)
|
|
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|