summaryrefslogtreecommitdiff
path: root/cmake
diff options
context:
space:
mode:
Diffstat (limited to 'cmake')
-rw-r--r--cmake/SlangTarget.cmake7
1 files changed, 7 insertions, 0 deletions
diff --git a/cmake/SlangTarget.cmake b/cmake/SlangTarget.cmake
index 4a3b75704..89143dd2d 100644
--- a/cmake/SlangTarget.cmake
+++ b/cmake/SlangTarget.cmake
@@ -156,6 +156,13 @@ function(slang_add_target dir type)
return()
endif()
+ # 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
+ )
+
#
# Set the output directory
#