summaryrefslogtreecommitdiffstats
path: root/cmake
diff options
context:
space:
mode:
authorDario Mylonopoulos <32958057+ramenguy99@users.noreply.github.com>2025-01-24 12:15:02 +0100
committerGitHub <noreply@github.com>2025-01-24 19:15:02 +0800
commitac174d260d90b66ebbc8264001a75b9527611cbc (patch)
treedb68e09e342190daba5d500467901c459fa20070 /cmake
parenta9ce7520e5f1b97b09e5de69455258bef55e10d2 (diff)
Fix static build and install (#6158)
* Add SLANG_ENABLE_RELEASE_LTO cmake option * Fix cmake static build * Disable install SlangTargets to avoid static build failing
Diffstat (limited to 'cmake')
-rw-r--r--cmake/SlangTarget.cmake14
1 files changed, 8 insertions, 6 deletions
diff --git a/cmake/SlangTarget.cmake b/cmake/SlangTarget.cmake
index eae5cf35e..85d09be89 100644
--- a/cmake/SlangTarget.cmake
+++ b/cmake/SlangTarget.cmake
@@ -166,12 +166,14 @@ function(slang_add_target dir type)
# Enable link-time optimization for release builds
# See: https://cmake.org/cmake/help/latest/prop_tgt/INTERPROCEDURAL_OPTIMIZATION.html
- set_target_properties(
- ${target}
- PROPERTIES
- INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE
- INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE
- )
+ if(SLANG_ENABLE_RELEASE_LTO)
+ set_target_properties(
+ ${target}
+ PROPERTIES
+ INTERPROCEDURAL_OPTIMIZATION_RELEASE TRUE
+ INTERPROCEDURAL_OPTIMIZATION_RELWITHDEBINFO TRUE
+ )
+ endif()
#
# Set the output directory