Skip to content
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

ENH: Enable propagation of linker flags #1151

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RafaelPalomar
Copy link

This change allows customizing the linker flags at the superbuild level. The motivation behind this modification was to enable the use of the gold linker in 3D Slicer, as referenced in
Slicer/Slicer#7294, to expedite the linking phase during the build process.

@jcfr jcfr force-pushed the feature/enable_propagation_link_flags branch from fc5fa79 to e738c36 Compare October 30, 2023 19:59
@jcfr
Copy link
Member

jcfr commented Oct 30, 2023

For reference, in an existing build tree, we wouldn't be overriding existing value:

Linux
for f in $(fd "CMakeCache.txt$"); do
  echo "$f";
  cat $f | grep -E "^CMAKE_(SHARED|EXE|MODULE)_LINKER_FLAGS\:";
done
CMakeCache.txt
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING=
CMakeFiles/ctkLinkerAsNeededFlagCheck/CMakeCache.txt
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING=
CTK-build/CMakeCache.txt
CMAKE_EXE_LINKER_FLAGS:STRING='   '
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING=
CTK-build/CMakeFiles/ctkLinkerAsNeededFlagCheck/CMakeCache.txt
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING=
CTK-build/Utilities/DGraph/CMakeCache.txt
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING=
DCMTK-build/CMakeCache.txt
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING=
ITK-build/CMakeCache.txt
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING=
ITK-build/ITKInternalEigen3-build/CMakeCache.txt
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING=
ITK-build/Modules/Core/Common/CMakeTmp/ITK_PRIVATE_DYNAMIC_CAST/CMakeCache.txt
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING=
Log4Qt-build/CMakeCache.txt
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING=
PythonQt-build/CMakeCache.txt
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING=
QtSOAP-build/CMakeCache.txt
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING=
QtTesting-build/CMakeCache.txt
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING=
Utilities/DGraph/CMakeCache.txt
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING=
VTK-build/CMakeCache.txt
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING=
VTK-build/Utilities/Python/CMakeTmp/vtk_undefined_symbols_allowed/CMakeCache.txt
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING= -Wl,-lc
qRestAPI-build/CMakeCache.txt
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING=
qxmlrpc-build/CMakeCache.txt
CMAKE_EXE_LINKER_FLAGS:STRING=
CMAKE_MODULE_LINKER_FLAGS:STRING=
CMAKE_SHARED_LINKER_FLAGS:STRING=

CMakeLists.txt Outdated Show resolved Hide resolved
@RafaelPalomar RafaelPalomar force-pushed the feature/enable_propagation_link_flags branch from 22daecd to 7a99ef3 Compare November 3, 2023 17:02
@RafaelPalomar
Copy link
Author

Updated this PR and Slicer/Slicer#7294 to update CMakeCache.txt values related to gold linker. @jcfr

This change allows customizing the linker flags at the superbuild level.
The motivation behind this modification was to enable the use of the
gold linker in 3D Slicer, as referenced in
Slicer/Slicer#7294, to expedite the linking
phase during the build process.

Co-authored-by: Jean-Christophe Fillion-Robin <[email protected]>
@RafaelPalomar RafaelPalomar force-pushed the feature/enable_propagation_link_flags branch from 7a99ef3 to 9f0641f Compare November 3, 2023 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants