Skip to content

Commit

Permalink
Don't override default AR and RANLIB without LTO
Browse files Browse the repository at this point in the history
`ar` is not always available, and when it is, it's not always correct, e.g. during cross-compilation.

https://bugs.gentoo.org/732096
  • Loading branch information
DarthGandalf authored and Pentarctagon committed Oct 24, 2020
1 parent a184b39 commit 60564a9
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions CMakeLists.txt
Expand Up @@ -421,12 +421,6 @@ if(ENABLE_LTO)
find_program(LTO_RANLIB NAMES gcc-ranlib)
set(CMAKE_AR "${LTO_AR}" CACHE STRING "Supports LTO" FORCE)
set(CMAKE_RANLIB "${LTO_RANLIB}" CACHE STRING "Supports LTO" FORCE)
else()
MESSAGE("Using ar, ranlib, and default linker")
find_program(NON_LTO_AR NAMES ar)
find_program(NON_LTO_RANLIB NAMES ranlib)
set(CMAKE_AR "${NON_LTO_AR}" CACHE STRING "Does not support LTO" FORCE)
set(CMAKE_RANLIB "${NON_LTO_RANLIB}" CACHE STRING "Does not support LTO" FORCE)
endif()
MARK_AS_ADVANCED(LTO_AR LTO_RANLIB NON_LTO_AR NON_LTO_RANLIB)

Expand Down

0 comments on commit 60564a9

Please sign in to comment.