summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt7
1 files changed, 6 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index fa39d6c..53d5b66 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -8,7 +8,12 @@ project(cssh C)
set( CSSH_VERSION 0.0.1 )
-set(CMAKE_C_FLAGS "-std=c99 -Wall -pedantic -Wfatal-errors -Werror -fPIC -O0 -Wno-unused-but-set-variable -g -D_XOPEN_SOURCE=700")
+if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -pedantic -Wfatal-errors -Werror -fPIC -Wno-unused-but-set-variable -D_XOPEN_SOURCE=700")
+endif()
+if("${CMAKE_CXX_COMPILER_ID}" MATCHES "[cC]lang")
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -Wall -pedantic -Wfatal-errors -Werror -fPIC -D_XOPEN_SOURCE=700")
+endif()
enable_testing( )