From fdff84a1685d9986cfb7c25bebb2135a84e7713d Mon Sep 17 00:00:00 2001 From: David Hodo Date: Fri, 20 Jul 2012 18:04:42 -0500 Subject: [PATCH 1/2] add option to not use Clang, even if it is installed --- serial.cmake | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/serial.cmake b/serial.cmake index 9081daf..f6a141c 100644 --- a/serial.cmake +++ b/serial.cmake @@ -23,13 +23,17 @@ macro(build_serial) endif() endif(UNIX) + IF(DEFINED BUILD_NO_CLANG) + option(BUILD_NO_CLANG "Do not use the Clang compiler." OFF) + ENDIF(DEFINED BUILD_NO_CLANG) + # Use clang if available - IF(EXISTS /usr/bin/clang) + IF(EXISTS /usr/bin/clang AND NOT BUILD_NO_CLANG) set(CMAKE_CXX_COMPILER /usr/bin/clang++) set(CMAKE_OSX_DEPLOYMENT_TARGET "") set(SERIAL_BUILD_WARNINGS TRUE) set(CMAKE_BUILD_TYPE Debug) - ENDIF(EXISTS /usr/bin/clang) + ENDIF(EXISTS /usr/bin/clang AND NOT BUILD_NO_CLANG) option(SERIAL_BUILD_TESTS "Build all of the Serial tests." OFF) option(SERIAL_BUILD_EXAMPLES "Build all of the Serial examples." OFF) From d7b12661e53d5c51684e2208f716ae6d43e111dc Mon Sep 17 00:00:00 2001 From: David Hodo Date: Sat, 21 Jul 2012 11:13:13 -0500 Subject: [PATCH 2/2] should have been if NOT defined --- serial.cmake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/serial.cmake b/serial.cmake index f6a141c..6a0b125 100644 --- a/serial.cmake +++ b/serial.cmake @@ -23,9 +23,9 @@ macro(build_serial) endif() endif(UNIX) - IF(DEFINED BUILD_NO_CLANG) + IF(NOT DEFINED BUILD_NO_CLANG) option(BUILD_NO_CLANG "Do not use the Clang compiler." OFF) - ENDIF(DEFINED BUILD_NO_CLANG) + ENDIF(NOT DEFINED BUILD_NO_CLANG) # Use clang if available IF(EXISTS /usr/bin/clang AND NOT BUILD_NO_CLANG)