Commit 7dd13f49 authored by David Partyka's avatar David Partyka
Browse files

Merge branch 'hdf5-check-flags' into release

parents 22e19e78 83bd462c
......@@ -285,7 +285,26 @@ ENDIF (CMAKE_BUILD_TYPE MATCHES Debug)
# Compiler specific flags : Shouldn't there be compiler tests for these
#-----------------------------------------------------------------------------
IF (NOT WIN32)
SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} -std=c99 -fomit-frame-pointer -finline-functions -fno-common")
include(CheckCXXCompilerFlag)
check_cxx_compiler_flag(-std=c99 HAVE_STD_C99)
check_cxx_compiler_flag(-fomit-frame-pointer HAVE_OMIT_FRAME_POINTER)
check_cxx_compiler_flag(-finline-functions HAVE_INLINE_FUNCTIONS)
check_cxx_compiler_flag(-fno-common HAVE_NO_COMMON)
if(HAVE_STD_C99)
set(STD_C99 "-std=c99")
endif()
if(HAVE_OMIT_FRAME_POINTER)
set(OMIT_FRAME_POINTER "-fomit-frame-pointer")
endif()
if(HAVE_INLINE_FUNCTIONS)
set(INLINE_FUNCTIONS "-finline-functions")
endif()
if(HAVE_NO_COMMON)
set(NO_COMMON "-fno-common")
endif()
SET (CMAKE_C_FLAGS "${CMAKE_ANSI_CFLAGS} ${CMAKE_C_FLAGS} ${STD_C99} ${OMIT_FRAME_POINTER} ${INLINE_FUNCTIONS} ${NO_COMMON}")
ENDIF (NOT WIN32)
#-----------------------------------------------------------------------------
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment