summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
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 /CMakeLists.txt
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 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt16
1 files changed, 10 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d9e44b058..5cad7dd5f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -193,6 +193,8 @@ option(
ON
)
+option(SLANG_ENABLE_RELEASE_LTO "Enable LTO for Release builds" ON)
+
option(
SLANG_ENABLE_SPLIT_DEBUG_INFO
"Generate split debug info for debug builds"
@@ -383,12 +385,14 @@ configure_package_config_file(
# linkable targets. In this case do not export the targets. Otherwise, just
# export the slang targets.
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Emscripten")
- install(
- EXPORT SlangTargets
- FILE ${PROJECT_NAME}Targets.cmake
- NAMESPACE ${PROJECT_NAME}::
- DESTINATION cmake
- )
+ if(NOT ${SLANG_BUILD_TYPE} STREQUAL "STATIC")
+ install(
+ EXPORT SlangTargets
+ FILE ${PROJECT_NAME}Targets.cmake
+ NAMESPACE ${PROJECT_NAME}::
+ DESTINATION cmake
+ )
+ endif()
endif()
install(