Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Christian Butz
VTK
Commits
83bd462c
Commit
83bd462c
authored
Apr 21, 2011
by
David Partyka
Browse files
Add checks for compiler flags instead of just blindly trying to use them.
Change-Id: I57f297b893125cc5935f98badbcaa733116916ed
parent
22e19e78
Changes
1
Hide whitespace changes
Inline
Side-by-side
Utilities/vtkhdf5/CMakeLists.txt
View file @
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
)
#-----------------------------------------------------------------------------
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment