2021-11-29 08:23:08 +00:00
cmake_minimum_required ( VERSION 3.0 )
2022-07-30 17:54:16 +00:00
cmake_policy ( SET CMP0057 NEW )
2021-11-29 08:23:08 +00:00
project ( eco2d )
include ( cmake/utils.cmake )
set ( CMAKE_C_STANDARD 11 )
set ( CMAKE_RUNTIME_OUTPUT_DIRECTORY ${ CMAKE_BINARY_DIR } / )
set ( CMAKE_LIBRARY_OUTPUT_DIRECTORY ${ CMAKE_BINARY_DIR } / )
set ( CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${ CMAKE_BINARY_DIR } )
set ( CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${ CMAKE_BINARY_DIR } )
2022-09-11 23:28:41 +00:00
SET ( CMAKE_USE_RELATIVE_PATHS OFF )
2021-11-29 08:23:08 +00:00
if ( MSVC )
add_definitions ( -D_CRT_SECURE_NO_WARNINGS )
endif ( )
2022-09-11 17:42:06 +00:00
if ( EMSCRIPTEN )
2022-09-13 10:02:36 +00:00
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g" )
2022-09-11 23:28:41 +00:00
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -g -s USE_GLFW=3 --profiling -s ASSERTIONS=1 -s WASM=1 -s INITIAL_MEMORY=268435456 -s FORCE_FILESYSTEM=1 --preload-file ${CMAKE_SOURCE_DIR}/art@art/ --shell-file ${CMAKE_SOURCE_DIR}/web/eco2d.html" )
2022-09-11 17:42:06 +00:00
set ( CMAKE_EXECUTABLE_SUFFIX ".html" ) # This line is used to set your executable to build with the emscripten html template so that you can directly open it.
set ( CMAKE_COMPILE_WARNING_AS_ERROR OFF )
endif ( )
2021-11-29 08:23:08 +00:00
include_directories ( code/common code/vendors code/vendors/flecs )
include ( cmake/FindRaylib.cmake )
add_subdirectory ( code/modules )
add_subdirectory ( code/vendors )
add_subdirectory ( code/game )