summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/CMakeLists.txt
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2009-11-23 20:31:29 (GMT)
committerBrad King <brad.king@kitware.com>2009-11-23 20:31:29 (GMT)
commit574902fef208b663feae226ffb2dde32c0925749 (patch)
tree9d081bd4d54e408311a988a5587add5c19159521 /Source/kwsys/CMakeLists.txt
parent647d7105b42af55f2f99972ee01589d91730850f (diff)
downloadCMake-574902fef208b663feae226ffb2dde32c0925749.zip
CMake-574902fef208b663feae226ffb2dde32c0925749.tar.gz
CMake-574902fef208b663feae226ffb2dde32c0925749.tar.bz2
KWSys: Work-around llvm-gcc-4.2 optimizer bug
Under -O3 optimization this compiler breaks our testProcess.c source file. We force -O0 for the file to avoid the problem.
Diffstat (limited to 'Source/kwsys/CMakeLists.txt')
-rw-r--r--Source/kwsys/CMakeLists.txt5
1 files changed, 5 insertions, 0 deletions
diff --git a/Source/kwsys/CMakeLists.txt b/Source/kwsys/CMakeLists.txt
index b48e032..1306edc 100644
--- a/Source/kwsys/CMakeLists.txt
+++ b/Source/kwsys/CMakeLists.txt
@@ -1095,6 +1095,11 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR)
KWSYS_SET_PROPERTY(TEST kwsys.testProcess-${n} PROPERTY LABELS ${KWSYS_LABELS_TEST})
ENDFOREACH(n)
+ # Some Apple compilers produce bad optimizations in this source.
+ IF(APPLE AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU|LLVM)$")
+ SET_SOURCE_FILES_PROPERTIES(testProcess.c PROPERTIES COMPILE_FLAGS -O0)
+ ENDIF()
+
# Test SharedForward
CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/testSharedForward.c.in
${PROJECT_BINARY_DIR}/testSharedForward.c @ONLY IMMEDIATE)