-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMakeLists.txt
63 lines (58 loc) · 1.61 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
#
# project: mo5
#
cmake_minimum_required(VERSION 3.21)
set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_C_STANDARD 11)
project(mo5)
# include the fips main cmake file
get_filename_component(FIPS_ROOT_DIR "../fips" ABSOLUTE)
include("${FIPS_ROOT_DIR}/cmake/fips.cmake")
fips_setup()
# just suppress this pesky "missing field initializer warning" for now
if (FIPS_CLANG OR FIPS_GCC)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-missing-field-initializers -Wsign-conversion")
endif()
# platform selection
add_definitions(-DSOKOL_NO_DEPRECATED)
if (FIPS_EMSCRIPTEN)
if (FIPS_EMSCRIPTEN_USE_WEBGPU)
set(sokol_backend SOKOL_WGPU)
set(slang "wgpu")
else()
set(sokol_backend SOKOL_GLES3)
set(slang "glsl300es:glsl100")
endif()
elseif (FIPS_ANDROID)
set(sokol_backend SOKOL_GLES3)
set(slang "glsl300es:glsl100")
elseif (SOKOL_USE_D3D11)
set(sokol_backend SOKOL_D3D11)
set(slang "hlsl4")
elseif (SOKOL_USE_METAL)
set(sokol_backend SOKOL_METAL)
if (FIPS_IOS)
set(slang "metal_ios:metal_sim")
else()
set(slang "metal_macos")
endif()
elseif (SOKOL_USE_EGL_GLES3)
set(sokol_backend SOKOL_GLES3)
set(slang "glsl300es:glsl100")
elseif (SOKOL_USE_EGL_GL)
set(sokol_backend SOKOL_GLCORE33)
set(slang "glsl330")
else()
if (FIPS_IOS)
set(sokol_backend SOKOL_GLES3)
set(slang "glsl300es:glsl100")
else()
set(sokol_backend SOKOL_GLCORE33)
set(slang "glsl330")
endif()
endif()
fips_ide_group("Libs")
add_subdirectory(libs)
fips_ide_group("Src")
add_subdirectory(src)