Skip to content

Conversation

RubBra
Copy link
Contributor

@RubBra RubBra commented Jun 2, 2025

When building SystemC as a static library with SYSTEMC_UNITY_BUILD=ON, linking fails if the user defines their own main() (e.g., in a test) because the internal sc_main.cpp object is included in the unity build and conflicts with the custom main().

This patch excludes sc_main.cpp from unity builds to restore expected behavior for static linking scenarios with external main() definitions.

When building SystemC as a static library with SYSTEMC_UNITY_BUILD=ON,
linking fails if the user defines their own main() (e.g., in a test)
because the internal sc_main.cpp object is included in the unity build
and conflicts with the custom main().

This patch excludes sc_main.cpp from unity builds to restore expected
behavior for static linking scenarios with external main() definitions.

Signed-off-by: Ruben Brandhofer <[email protected]>
Copy link
Contributor

@maehne maehne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@lmailletcontoz lmailletcontoz merged commit de72c4f into accellera-official:main Jun 3, 2025
50 of 98 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants