summaryrefslogtreecommitdiff
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorSander Vrijders <sander.vrijders@intec.ugent.be>2016-02-23 15:09:58 +0100
committerSander Vrijders <sander.vrijders@intec.ugent.be>2016-02-23 15:09:58 +0100
commit839c76c814a01e3852f5da1c4e294e8668e13c4f (patch)
treec547bd37fb0c512d286032fed151355b2ce6f3f8 /CMakeLists.txt
parent59ee34ef5650c415a6a747afb816964378d17b36 (diff)
downloadouroboros-839c76c814a01e3852f5da1c4e294e8668e13c4f.tar.gz
ouroboros-839c76c814a01e3852f5da1c4e294e8668e13c4f.zip
build: Require usage of C89
This requires the usage of the C89 standard for all source files. It also fixes a wrong check for the compiler flags (was checking this for CXX compiler instead of the C compiler).
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt15
1 files changed, 9 insertions, 6 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1ca05c95..c3495e6a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,7 +3,7 @@ cmake_minimum_required(VERSION 3.1.0)
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
#set(CMAKE_VERBOSE_MAKEFILE ON)
-project(ouroboros)
+project(ouroboros C)
include(GitVersionGen)
GIT_VERSION_GEN()
@@ -27,13 +27,16 @@ message(STATUS "Package URL is: ${PACKAGE_URL}")
message(STATUS "Package bug-report address: ${PACKAGE_BUGREPORT}")
message(STATUS "Package install prefix: ${CMAKE_INSTALL_PREFIX}")
+# Enable C89 standard
+set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c89")
+
include(FindPkgConfig)
include(CompilerUtils)
-test_and_set_cxx_compiler_flag_global(-Wall)
-test_and_set_cxx_compiler_flag_global(-Werror)
-test_and_set_cxx_compiler_flag_global(-Wundef)
-test_and_set_cxx_compiler_flag_global(-fmax-errors=1)
+test_and_set_c_compiler_flag_global(-Wall)
+test_and_set_c_compiler_flag_global(-Werror)
+test_and_set_c_compiler_flag_global(-Wundef)
+test_and_set_c_compiler_flag_global(-fmax-errors=1)
configure_file(
"${CMAKE_CURRENT_SOURCE_DIR}/ouroboros.pc.in"
@@ -46,7 +49,7 @@ add_subdirectory(include)
add_subdirectory(src)
add_subdirectory(tests)
-# We may have to move this to the subdirs
+# FIXME: We may have to move this to the subdirs
include(MacroAddCompileFlags)
if (CMAKE_BUILD_TYPE MATCHES Debug)
MACRO_ADD_COMPILE_FLAGS(ipcpd -DCONFIG_OUROBOROS_DEBUG)