-
Notifications
You must be signed in to change notification settings - Fork 3.4k
support cmake LINK_LIBRARY:WHOLE_ARCHIVE #22975
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This LGTM, but can you add a new test to test_cmake in test_other.py that uses this feature?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm % nits
|
This seems to be failing on the Chromium CI: https://logs.chromium.org/logs/emscripten-releases/buildbucket/cr-buildbucket/8729603731668921633/+/u/Emscripten_testsuite__other_/stdout |
|
Yes we need to add |
|
I guess the other option would be to just update the install of CMake we have on those builders. |
Maybe .. although then we loose coverage of older cmake versions |
Related: https://discourse.cmake.org/t/error-when-crosscompiling-with-whole-archive-target-link/9394 whole-archive support needs to be explicitly declared in toolchain file, see cmake official [GNU](https://github.com/Kitware/CMake/blob/6be01c932e077306ebea15cef4b8befb29c5130e/Modules/Platform/Linker/GNU.cmake#L35-L44).
Related: https://discourse.cmake.org/t/error-when-crosscompiling-with-whole-archive-target-link/9394
whole-archive support needs to be explicitly declared in toolchain file, see cmake official GNU.
Test:
CMakeLists.txt
lib.cpp
main.cpp
With latest emsdk,
emcmake cmake -B buildcomplainsAfter overriding emsdk/upstream/emscripten/cmake/Modules/Platform/Emscripten.cmake, it passes, and
cmake --build buildpasses,node build/whole.jsoutputsas expected.