From 146cf56295cd366d05ab614d38a4627dc987a675 Mon Sep 17 00:00:00 2001 From: comex Date: Mon, 23 Sep 2013 00:25:41 -0400 Subject: [PATCH] Darwin: Don't overwrite the C compiler if the user set one manually. --- CMakeLists.txt | 16 +++++++++++----- 1 file 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)