summaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2013-08-21 17:12:08 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2013-08-21 17:12:08 (GMT)
commit6bc36a0c46a9864ae580ca43f00d3f4ec3e28147 (patch)
tree6eb0305122018349e5d7b7f092fd0597d12550b0 /src/CMakeLists.txt
parent482a9c28e71b0c1b3767bcf30be3c534bbc65ed9 (diff)
downloadhdf5-6bc36a0c46a9864ae580ca43f00d3f4ec3e28147.zip
hdf5-6bc36a0c46a9864ae580ca43f00d3f4ec3e28147.tar.gz
hdf5-6bc36a0c46a9864ae580ca43f00d3f4ec3e28147.tar.bz2
[svn-r24046] HDFFV-8500: set h5detect compile optimization to -O0
will generate correct H5Tinit.c file. Tested: local gcc 4.8.2 linux
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 74283fe..91872af 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -773,8 +773,13 @@ INCLUDE_DIRECTORIES (${CMAKE_BINARY_DIR})
# Setup the H5Detect utility which generates H5Tinit with platform
# specific type checks inside
#-----------------------------------------------------------------------------
+IF (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+ SET (LOCAL_OPT_FLAG "-O0")
+ELSE (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
+ SET (LOCAL_OPT_FLAG " ")
+ENDIF (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_GNUCXX)
ADD_EXECUTABLE (H5detect ${HDF5_SRC_DIR}/H5detect.c)
-TARGET_C_PROPERTIES (H5detect " " " ")
+TARGET_C_PROPERTIES (H5detect ${LOCAL_OPT_FLAG} " ")
IF (MSVC)
TARGET_LINK_LIBRARIES (H5detect "ws2_32.lib")
ENDIF (MSVC)