Skip to content

Add linker flags to the resource lib target to prevent 'unused' stati… - #27

Open
Randalphwa wants to merge 1 commit into
mainfrom
pr/5
Open

Add linker flags to the resource lib target to prevent 'unused' stati…#27
Randalphwa wants to merge 1 commit into
mainfrom
pr/5

Conversation

@Randalphwa

Copy link
Copy Markdown
Member

Migrated from vector-of-bool/cmrc PR #5 by @aleh-arol

…c initialization removal.

This change is to to allow usage of static initializer from the generated resource lib. The key point is to use new CMake command and features that support cross platform passing of linker flags. So there are flags for GCC/Clang/MSVC that prevents stripping unused objects from generated lib. This functionality unfortunately only available in 3.12, so it's under AUTOLOAD conditional to allow using the old way without any hassle.

Minor changes - added "no AUTOMOC" property to keep CMake from complains when using Qt. Renamed "this_script" - just in case - to the more explicit name.

For now I tested only on GCC, I will test on MSVC/Clang in the upcoming days.

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.

2 participants