Add SYSTEMC_UNITY_BUILD CMake option and require CMake 3.16+#119
Merged
lmailletcontoz merged 1 commit intoaccellera-official:mainfrom May 20, 2025
Merged
Conversation
This patch introduces a new CMake option -DSYSTEMC_UNITY_BUILD=ON to enable unity builds for the SystemC library, which may improve build performance in some environments. Enabling this option compiles the sources as a single compilation unit. The option is OFF by default and does not affect standard builds. The minimum required CMake version is raised to 3.16 to support this feature. Signed-off-by: Ruben Brandhofer <ruben@mwa.re>
e7d46b0
into
accellera-official:main
49 of 98 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This patch introduces a new CMake option -DSYSTEMC_UNITY_BUILD=ON to enable unity builds for the SystemC library, which may improve build performance in some environments.
Enabling this option compiles the sources as a single compilation unit. The option is OFF by default and does not affect standard builds.
The minimum required CMake version is raised to 3.16 to support this feature.
Rationale
Unity builds can significantly reduce build time in some build environments, especially those with many small translation units or slower filesystems.
CMake 3.16 is the first version that supports the required features (specifically UNITY_BUILD mode via target_sources() and target_sources(FILE_SET) logic).
Tested on
Build times were roughly halved by turning on the build option.