aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornia <29542929+niacat@users.noreply.github.com>2021-02-26 17:54:36 +0100
committerGitHub <noreply@github.com>2021-02-26 16:54:36 +0000
commitf8692f85a437b4fc82b35fe80622f09e3346c78a (patch)
treeb2247c8932c820db2a9fcd7315ee765df9ed18e2
parent89051f63d4c6c62ca18110037534a9fc575574f2 (diff)
Only use special ar and ranlib command when ENABLE_LTO is ON. (#1018)
This allows melonDS to be built with the standard system toolchain on NetBSD, see discussion in #1016
-rw-r--r--CMakeLists.txt21
1 files changed, 10 insertions, 11 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a7ac4e6..65afb59 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -102,18 +102,17 @@ if (ENABLE_LTO)
add_compile_options(-flto -fPIC)
add_link_options(-flto -fuse-linker-plugin -pie)
endif()
-endif()
-
-if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
- set(CMAKE_AR "gcc-ar")
- set(CMAKE_RANLIB "gcc-ranlib")
-elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
- find_program(LLD NAMES ld.lld ld64.lld lld-link)
- if (NOT LLD STREQUAL "LLD-NOTFOUND")
- add_link_options(-fuse-ld=lld)
+ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
+ set(CMAKE_AR "gcc-ar")
+ set(CMAKE_RANLIB "gcc-ranlib")
+ elseif (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
+ find_program(LLD NAMES ld.lld ld64.lld lld-link)
+ if (NOT LLD STREQUAL "LLD-NOTFOUND")
+ add_link_options(-fuse-ld=lld)
+ endif()
+ set(CMAKE_AR "llvm-ar")
+ set(CMAKE_RANLIB "llvm-ranlib")
endif()
- set(CMAKE_AR "llvm-ar")
- set(CMAKE_RANLIB "llvm-ranlib")
endif()
option(BUILD_QT_SDL "Build Qt/SDL frontend" ON)