summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt16
1 files changed, 11 insertions, 5 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 966cd44efc..43db2ec6fb 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -25,11 +25,17 @@ option(UNITTESTS "Build unitests" OFF)
# Update compiler before calling project()
if (APPLE)
# Use clang compiler
- set(CMAKE_C_COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang")
- set(CMAKE_CXX_COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++")
- if (NOT EXISTS "${CMAKE_CXX_COMPILER}")
- set(CMAKE_C_COMPILER "clang")
- set(CMAKE_CXX_COMPILER "clang++")
+ if (NOT DEFINED CMAKE_CXX_COMPILER)
+ set(CMAKE_CXX_COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++")
+ if (NOT EXISTS "${CMAKE_CXX_COMPILER}")
+ set(CMAKE_CXX_COMPILER "clang++")
+ endif()
+ endif()
+ if (NOT DEFINED CMAKE_CXX_COMPILER)
+ set(CMAKE_C_COMPILER "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang")
+ if (NOT EXISTS "${CMAKE_C_COMPILER}")
+ set(CMAKE_C_COMPILER "clang")
+ endif()
endif()
endif()
project(dolphin-emu)