From 81768305771cd7623443f79b4d6b6f0afb9f21ce Mon Sep 17 00:00:00 2001 From: ozeng Date: Mon, 31 Jul 2017 19:25:59 -0400 Subject: [PATCH] CMakeLists changes to make thunk buildable on CentOS 6.9 Removed Werror CFLAGS for lower version of gcc. there will be some warning message on lower gcc version but build is ok. Signed-off-by: Oak Zeng Change-Id: Icf556625cb870c4ad73e1d89f3d4ade3a96e821f --- CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8c954d20bb..bb283f1e27 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -53,7 +53,11 @@ set ( BUILD_VERSION_STRING "${BUILD_VERSION_MAJOR}.${BUILD_VERSION_MINOR}.${BUIL set ( CMAKE_VERBOSE_MAKEFILE on ) ## Compiler flags -set ( CMAKE_C_FLAGS "-fPIC -W -Wall -Wextra -Werror -Wno-unused-parameter -Wformat-security -Wswitch-default -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wlogical-op -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wunreachable-code -std=gnu99 -fvisibility=hidden -O2" ) +set ( CMAKE_C_FLAGS "-fPIC -W -Wall -Wextra -Wno-unused-parameter -Wformat-security -Wswitch-default -Wundef -Wshadow -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wlogical-op -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wredundant-decls -Wunreachable-code -std=gnu99 -fvisibility=hidden -O2" ) +if ( "${CMAKE_C_COMPILER_VERSION}" STRGREATER "4.8.0") + set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Werror" ) +endif () + set ( HSAKMT_LINKER_SCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/src/libhsakmt.ver" )