Skip to content

Commit 260960e

Browse files
committed
cmake fixes
1 parent c0655dd commit 260960e

8 files changed

Lines changed: 25 additions & 8 deletions

File tree

CMakeLists.txt

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,6 @@ endif()
1818
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
1919
include(cage_all)
2020

21-
option(cage_faster_debug "enable some optimizations to improve performance in debug builds" ON)
22-
option(cage_faster_release "enable more aggressive inlining in release builds" OFF)
23-
option(cage_assert_in_release_enabled "enable runtime asserts in non-debug builds" OFF)
24-
option(cage_validate_graphics "enable runtime validation in webgpu/dawn" ON)
25-
option(cage_profiling_enabled "enable compiling-in instructions for profiling" ON)
26-
option(cage_use_steam_sockets "include Game Networking Sockets library by Valve/Steam" OFF)
27-
2821
if(CMAKE_CURRENT_BINARY_DIR STREQUAL CMAKE_BINARY_DIR)
2922
cage_default_init() # standalone build
3023
else()

cmake/cage_all.cmake

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11

2+
include(cage_options)
3+
24
include(cage_assets)
35
include(cage_build_configuration)
46
include(cage_build_destination)

cmake/cage_build_configuration.cmake

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ macro(cage_build_configuration)
6262
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /Ob1")
6363
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Ob1 /D_ITERATOR_DEBUG_LEVEL=0")
6464
add_compile_definitions(_ITERATOR_DEBUG_LEVEL=0)
65+
#set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreadedDLL")
6566
endif()
6667

6768
# optionally improve runtime performance in release builds (more aggressive inlining)

cmake/cage_options.cmake

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
option(cage_faster_debug "enable some optimizations to improve performance in debug builds" ON)
3+
option(cage_faster_release "enable more aggressive inlining in release builds" OFF)
4+
option(cage_assert_in_release_enabled "enable runtime asserts in non-debug builds" OFF)
5+
option(cage_validate_graphics "enable runtime validation in webgpu/dawn" ON)
6+
option(cage_profiling_enabled "enable compiling-in instructions for profiling" ON)
7+
option(cage_use_steam_sockets "include Game Networking Sockets library by Valve/Steam" OFF)

externals/assimp/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ cage_heavily_optimized()
66

77
set(BUILD_SHARED_LIBS OFF CACHE INTERNAL "BUILD_SHARED_LIBS")
88
set(ASSIMP_INSTALL OFF CACHE INTERNAL "Disable this if you want to use assimp as a submodule.")
9+
set(ASSIMP_INSTALL_PDB OFF CACHE INTERNAL "Create MSVC debug symbol files and add to Install target.")
910
set(ASSIMP_BUILD_ZLIB OFF CACHE INTERNAL "Build your own zlib")
1011
set(ASSIMP_NO_EXPORT ON CACHE INTERNAL "Disable Assimp's export functionality.")
1112
set(ASSIMP_BUILD_ASSIMP_TOOLS OFF CACHE INTERNAL "If the supplementary tools for Assimp are built in addition to the library.")
1213
set(ASSIMP_BUILD_TESTS OFF CACHE INTERNAL "If the test suite for Assimp is built in addition to the library.")
14+
set(ASSIMP_WARNINGS_AS_ERRORS OFF CACHE INTERNAL "Treat all warnings as errors.")
15+
set(LIBRARY_SUFFIX "" CACHE INTERNAL "")
1316

1417
# disable some formats to speed up build
1518
# one may enable them in the cache or by setting the default before including this cmake

externals/dawn/CMakeLists.txt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@ cage_replace_in_file(
1313
"${CMAKE_CURRENT_LIST_DIR}/dawn/third_party/CMakeLists.txt"
1414
"NOT TARGET glslang AND \\(TINT_BUILD_GLSL_WRITER OR TINT_BUILD_GLSL_VALIDATOR\\) AND TINT_BUILD_CMD_TOOLS" "ON"
1515
)
16+
cage_replace_in_file(
17+
"${CMAKE_CURRENT_LIST_DIR}/dawn/third_party/abseil-cpp/CMakeLists.txt"
18+
"set\\(CMAKE_MSVC_RUNTIME_LIBRARY[^\\\n]*\\)" "# code removed by cage"
19+
)
1620
cage_replace_in_file(
1721
"${CMAKE_CURRENT_LIST_DIR}/dawn/src/dawn/common/Constants.h"
1822
"kMaxSampledTexturesPerShaderStage = 16;" "kMaxSampledTexturesPerShaderStage = 32;"
@@ -80,7 +84,7 @@ unset(linux)
8084

8185
# absl
8286
set(ABSL_PROPAGATE_CXX_STD OFF CACHE INTERNAL "Use CMake C++ standard meta features (e.g. cxx_std_17) that propagate to targets that link to Abseil")
83-
set(ABSL_USE_SYSTEM_INCLUDES ON CACHE INTERNAL "Use CMake C++ standard meta features (e.g. cxx_std_17) that propagate to targets that link to Abseil")
87+
set(ABSL_USE_SYSTEM_INCLUDES ON CACHE INTERNAL "Silence warnings in Abseil headers by marking them as SYSTEM includes")
8488

8589

8690
# protobuf

externals/openxr-sdk/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ message(STATUS "----------------------------------------------------------------
22
message(STATUS "openxr-sdk")
33
message(STATUS "----------------------------------------------------------------")
44

5+
cage_replace_in_file(
6+
"${CMAKE_CURRENT_LIST_DIR}/OpenXR-SDK/src/loader/CMakeLists.txt"
7+
"MSVC_RUNTIME_LIBRARY" "cage_modified_MSVC_RUNTIME_LIBRARY"
8+
)
9+
510
unset(CMAKE_C_STANDARD)
611
unset(CMAKE_CXX_STANDARD)
712

submodules.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ git_ignore_file "externals/dawn/dawn" "CMakeLists.txt"
5555
git_ignore_file "externals/dawn/dawn" "src/dawn/common/Constants.h"
5656
git_ignore_file "externals/dawn/dawn" "third_party/CMakeLists.txt"
5757
git_ignore_file "externals/dawn/dawn" "third_party/glslang/src"
58+
git_ignore_file "externals/dawn/dawn/third_party/abseil-cpp" "CMakeLists.txt"
59+
git_ignore_file "externals/openxr-sdk/OpenXR-SDK" "src/loader/CMakeLists.txt"
5860
git_ignore_file "externals/quickhull/quickhull" "QuickHull.cpp"

0 commit comments

Comments
 (0)