Skip to content

Commit 90676fb

Browse files
committed
Attempt to fix Windows CI by matching Jolt's build setup.
1 parent 565d68e commit 90676fb

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

attachments/advanced_gltf/CMakeLists.txt

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ FetchContent_Declare(
8080
SOURCE_SUBDIR Build)
8181
set(DOUBLE_PRECISION OFF CACHE BOOL "" FORCE)
8282
set(GENERATE_DEBUG_SYMBOLS ON CACHE BOOL "" FORCE)
83+
set(PROFILE_ENABLED ON CACHE BOOL "" FORCE)
8384
if(MSVC)
8485
set(USE_STATIC_MSVC_RUNTIME_LIBRARY OFF CACHE BOOL "" FORCE)
8586
endif()
@@ -249,7 +250,17 @@ if(MSVC)
249250
NOMINMAX WIN32_LEAN_AND_MEAN _CRT_SECURE_NO_WARNINGS)
250251
target_compile_options(SimpleEngineLib PUBLIC
251252
/permissive- /Zc:__cplusplus /EHsc /W3 /MP /bigobj)
253+
# Force use of the advanced renderer header to avoid shadowing issues with simple_engine/renderer.h
254+
target_compile_options(SimpleEngineLib PRIVATE /FI"${CMAKE_CURRENT_SOURCE_DIR}/renderer.h")
252255
target_link_libraries(SimpleEngineLib PUBLIC Dbghelp)
256+
257+
# Enable Link Time Code Generation to match Jolt and resolve potential LTO mismatches
258+
set_target_properties(SimpleEngineLib PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE)
259+
set_target_properties(AdvancedGLTF PROPERTIES INTERPROCEDURAL_OPTIMIZATION TRUE)
260+
261+
# Jolt configuration consistency
262+
target_compile_definitions(SimpleEngineLib PUBLIC JPH_PROFILE_ENABLED JPH_EXTERNAL_PROFILE)
263+
target_compile_definitions(AdvancedGLTF PRIVATE JPH_PROFILE_ENABLED JPH_EXTERNAL_PROFILE)
253264
elseif(WIN32)
254265
target_compile_definitions(SimpleEngineLib PUBLIC
255266
NOMINMAX WIN32_LEAN_AND_MEAN _CRT_SECURE_NO_WARNINGS)

0 commit comments

Comments
 (0)