forked from mgerdes/Open-Golf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
71 lines (63 loc) · 2.71 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
cmake_minimum_required(VERSION 3.12)
project(golf)
message(${CMAKE_SYSTEM_NAME})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
include_directories(SYSTEM src/3rd_party)
include_directories(src)
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
add_compile_definitions(SOKOL_GLCORE33)
add_compile_definitions(GOLF_PLATFORM_WINDOWS)
elseif(CMAKE_SYSTEM_NAME STREQUAL Linux OR CMAKE_SYSTEM_NAME STREQUAL Darwin)
add_compile_definitions(SOKOL_GLCORE33)
add_compile_definitions(GOLF_PLATFORM_LINUX)
elseif(CMAKE_SYSTEM_NAME STREQUAL Android)
add_compile_definitions(SOKOL_GLES3)
add_compile_definitions(GOLF_PLATFORM_ANDROID)
add_compile_options("SHELL:-O3")
add_compile_options("SHELL:-DNDEBUG")
elseif(CMAKE_SYSTEM_NAME STREQUAL iOS)
set(CMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM RMF5MGUCT2 CACHE INTERNAL "")
add_compile_definitions(SOKOL_GLES3)
add_compile_definitions(GOLF_PLATFORM_IOS)
add_compile_options("SHELL:-O3")
add_compile_options("SHELL:-DNDEBUG")
elseif(CMAKE_SYSTEM_NAME STREQUAL Emscripten)
configure_file("build/emscripten/coi-serviceworker.min.js" ${CMAKE_BINARY_DIR} COPYONLY)
add_compile_definitions(SOKOL_GLES3)
add_compile_definitions(GOLF_PLATFORM_EMSCRIPTEN)
add_compile_options("SHELL:-s USE_PTHREADS=1")
add_compile_options("SHELL:-O3")
add_compile_options("SHELL:-DNDEBUG")
add_link_options("SHELL:-s USE_WEBGL2=1")
add_link_options("SHELL:-s FULL_ES3=1")
add_link_options("SHELL:-s ERROR_ON_UNDEFINED_SYMBOLS=1")
add_link_options("SHELL:-s ALLOW_MEMORY_GROWTH=1")
add_link_options("SHELL:-s USE_PTHREADS=1")
add_link_options("SHELL:-s WASM_MEM_MAX=100Mb")
add_link_options("SHELL:-s PTHREAD_POOL_SIZE=2")
add_link_options("SHELL:-lidbfs.js")
add_link_options("SHELL:--shell-file ../../build/emscripten/shell.html")
add_link_options("SHELL:-s TOTAL_MEMORY=32Mb")
endif()
if(CMAKE_SYSTEM_NAME STREQUAL Windows)
elseif(CMAKE_SYSTEM_NAME STREQUAL Linux)
add_compile_options(-g)
endif()
add_subdirectory(src/3rd_party/cimgui)
add_subdirectory(src/3rd_party/fast_obj)
add_subdirectory(src/3rd_party/glad)
add_subdirectory(src/3rd_party/glfw)
add_subdirectory(src/3rd_party/lightmapper)
add_subdirectory(src/3rd_party/mattiasgustavsson_libs)
add_subdirectory(src/3rd_party/miniz)
add_subdirectory(src/3rd_party/parson)
add_subdirectory(src/3rd_party/sokol)
add_subdirectory(src/3rd_party/stb)
add_subdirectory(src/3rd_party/xatlas)
add_subdirectory(src/common)
add_subdirectory(src/golf)
if(CMAKE_SYSTEM_NAME STREQUAL Windows OR CMAKE_SYSTEM_NAME STREQUAL Linux)
add_subdirectory(src/editor)
endif()