Skip to content

Conversation

aleh-arol
Copy link

…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.

@vector-of-bool
Copy link
Owner

Nice! I'll take a look when I find the time. Busy with CMake Tools for a few days.

@vector-of-bool
Copy link
Owner

Ouch. It's been a while.

I'm in the midst of a refactor that will make the issue NLA. Instead of a global initializer, filesystem objects won't be accessed by a single global instance (rather using embedded_filesystem objects). Calling out to a function to get these objects will ensure that the necessary objects files are included in the final link.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants