summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcomex <comexk@gmail.com>2013-09-23 00:25:41 -0400
committercomex <comexk@gmail.com>2013-09-24 01:14:56 -0400
commit146cf56295cd366d05ab614d38a4627dc987a675 (patch)
tree97e4610b3c73255c3f8f7d8cfa1fae56e59b96cc
parent1bf2c03a99545b7669b162f2c12116169475349a (diff)
Darwin: Don't overwrite the C compiler if the user set one manually.
-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)