build: simplify dependency graph

Allow the objects of static libs to be built in parallel rather than serially
based on their dependency ordering.

For more detail, see:
https://cmake.org/cmake/help/latest/prop_tgt/OPTIMIZE_DEPENDENCIES.html
This commit is contained in:
Cory Fields committed 2025-01-31 15:07:44 +00:00
1 parent c4e498300c
commit 12fa9511b5
3 files changed
+13

No files matched your search

+7
View File
@@ -71,6 +71,13 @@ set(CMAKE_CXX_EXTENSIONS OFF)
list(APPEND CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake/module)
# Flatten static lib dependencies.
# Without this, if libfoo.a depends on libbar.a, libfoo's objects can't begin
# to be compiled until libbar.a has been created.
if (NOT DEFINED CMAKE_OPTIMIZE_DEPENDENCIES)
set(CMAKE_OPTIMIZE_DEPENDENCIES TRUE)
endif()
#=============================
# Configurable options
#=============================