Darwin: Don't overwrite the C compiler if the user set one manually.

This commit is contained in:
comex 2013-09-23 00:25:41 -04:00
parent 1bf2c03a99
commit 146cf56295
1 changed files with 11 additions and 5 deletions

View File

@ -25,12 +25,18 @@ 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")
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_C_COMPILER "clang")
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)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/CMakeTests)