Skip to content

Commit e5a7d85

Browse files
committed
Fix cmake for windows release master gold
1 parent b8010ba commit e5a7d85

File tree

3 files changed

+12
-6
lines changed

3 files changed

+12
-6
lines changed

CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ option(XRAY_ENABLE_TRACY "Enable tracy profiler" OFF)
2121
include(XRay.Build)
2222
include(XRay.Packaging)
2323

24+
add_compile_definitions(
25+
$<$<CONFIG:ReleaseMasterGold>:MASTER_GOLD>
26+
$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:XRAY_STATIC_BUILD>
27+
)
28+
2429
add_subdirectory(Externals)
2530
add_subdirectory(src)
2631
add_subdirectory(res)

Externals/ode/CMakeLists.txt

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,9 @@ target_compile_definitions(xrODE
8989
PUBLIC
9090
dSINGLE
9191
"$<$<CONFIG:Release,ReleaseMasterGold>:dNODEBUG>"
92+
PRIVATE
93+
$<$<BOOL:${BUILD_SHARED_LIBS}>:ODE_DLL>
94+
$<$<BOOL:${BUILD_SHARED_LIBS}>:ODE_PLATFORM_WINDOWS>
9295
)
9396

9497
set_target_properties(xrODE PROPERTIES
@@ -97,7 +100,10 @@ set_target_properties(xrODE PROPERTIES
97100
)
98101

99102
if (MSVC AND BUILD_SHARED_LIBS)
100-
set_target_properties(xrODE PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS ON)
103+
set_target_properties(xrODE PROPERTIES WINDOWS_EXPORT_ALL_SYMBOLS OFF)
104+
# Provide explicit export list and disable IPO to keep /DEF helper stable.
105+
target_link_options(xrODE PRIVATE "/DEF:${CMAKE_CURRENT_SOURCE_DIR}/config/msvcdefs.def")
106+
set_property(TARGET xrODE PROPERTY INTERPROCEDURAL_OPTIMIZATION OFF)
101107
endif()
102108

103109
if (BUILD_SHARED_LIBS)

src/CMakeLists.txt

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
add_compile_definitions(
2-
$<$<CONFIG:ReleaseMasterGold>:MASTER_GOLD>
3-
$<$<NOT:$<BOOL:${BUILD_SHARED_LIBS}>>:XRAY_STATIC_BUILD>
4-
)
5-
61
add_compile_options(${XRAY_ENABLE_WARNINGS})
72

83
add_subdirectory(utils)

0 commit comments

Comments
 (0)