Skip to content

Commit

Permalink
[XrdPosix] Don't try to disable LTO if compiler doesn't support it
Browse files Browse the repository at this point in the history
  • Loading branch information
amadio committed Oct 28, 2024
1 parent a251ba6 commit fb574cb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/XrdPosix.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,13 @@ set_target_properties(
# It is meant to replace symbols from the system and as such
# must not be compiled with link-time optimizations.

target_compile_options(XrdPosixPreload PRIVATE -fno-lto)
include(CheckCXXCompilerFlag)

check_cxx_compiler_flag(-fno-lto HAS_NOLTO)

if(HAS_NOLTO)
target_compile_options(XrdPosixPreload PRIVATE -fno-lto)
endif()

#-------------------------------------------------------------------------------
# Install
Expand Down

0 comments on commit fb574cb

Please sign in to comment.