diff options
author | Maxim Biro <nurupo.contributions@gmail.com> | 2013-07-17 18:28:53 -0400 |
---|---|---|
committer | Maxim Biro <nurupo.contributions@gmail.com> | 2013-07-17 18:29:26 -0400 |
commit | 6939a48226ec9cf2ab5d0a46e583831c195f2b7e (patch) | |
tree | 70d78f8dd681f32fdbf10a5f03fed9a898fca368 | |
parent | e9f0059a15bcc73e5b0cfb506bf3cebe693e75d0 (diff) |
Apply compiler flags only once
-rw-r--r-- | CMakeLists.txt | 17 | ||||
-rw-r--r-- | other/cmake/DHT_bootstrap.cmake | 1 | ||||
-rw-r--r-- | testing/cmake/DHT_cryptosendfiletest.cmake | 3 | ||||
-rw-r--r-- | testing/cmake/DHT_sendfiletest.cmake | 1 | ||||
-rw-r--r-- | testing/cmake/DHT_test.cmake | 1 | ||||
-rw-r--r-- | testing/cmake/Lossless_UDP_testclient.cmake | 1 | ||||
-rw-r--r-- | testing/cmake/Lossless_UDP_testserver.cmake | 1 | ||||
-rw-r--r-- | testing/cmake/Messenger_test.cmake | 1 | ||||
-rw-r--r-- | testing/cmake/nTox.cmake | 1 |
9 files changed, 8 insertions, 19 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index db417a2f..c760beb5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt | |||
@@ -1,5 +1,12 @@ | |||
1 | cmake_minimum_required(VERSION 2.6.0) | 1 | cmake_minimum_required(VERSION 2.6.0) |
2 | 2 | ||
3 | if(NOT WIN32) | ||
4 | if(("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")) | ||
5 | message(STATUS "==== ${CMAKE_C_COMPILER_ID} detected - Adding compiler flags ====") | ||
6 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror") | ||
7 | endif() | ||
8 | endif() | ||
9 | |||
3 | if(WIN32) | 10 | if(WIN32) |
4 | include_directories(${CMAKE_HOME_DIRECTORY}/sodium/include/) | 11 | include_directories(${CMAKE_HOME_DIRECTORY}/sodium/include/) |
5 | endif() | 12 | endif() |
@@ -24,15 +31,5 @@ macro(linkCoreLibraries exe_name) | |||
24 | endif() | 31 | endif() |
25 | endmacro() | 32 | endmacro() |
26 | 33 | ||
27 | |||
28 | macro(addCompilerFlags) | ||
29 | if(NOT WIN32) | ||
30 | if(("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang")) | ||
31 | message(STATUS "==== ${CMAKE_C_COMPILER_ID} detected - Adding compiler flags ====") | ||
32 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror") | ||
33 | endif() | ||
34 | endif() | ||
35 | endmacro() | ||
36 | |||
37 | ADD_SUBDIRECTORY(testing) | 34 | ADD_SUBDIRECTORY(testing) |
38 | ADD_SUBDIRECTORY(other) \ No newline at end of file | 35 | ADD_SUBDIRECTORY(other) \ No newline at end of file |
diff --git a/other/cmake/DHT_bootstrap.cmake b/other/cmake/DHT_bootstrap.cmake index f978baa4..c3c313ae 100644 --- a/other/cmake/DHT_bootstrap.cmake +++ b/other/cmake/DHT_bootstrap.cmake | |||
@@ -7,4 +7,3 @@ add_executable(${exe_name} | |||
7 | DHT_bootstrap.c) | 7 | DHT_bootstrap.c) |
8 | 8 | ||
9 | linkCoreLibraries(${exe_name}) | 9 | linkCoreLibraries(${exe_name}) |
10 | addCompilerFlags() | ||
diff --git a/testing/cmake/DHT_cryptosendfiletest.cmake b/testing/cmake/DHT_cryptosendfiletest.cmake index 9396d91a..8d6079f8 100644 --- a/testing/cmake/DHT_cryptosendfiletest.cmake +++ b/testing/cmake/DHT_cryptosendfiletest.cmake | |||
@@ -6,5 +6,4 @@ set(exe_name DHT_cryptosendfiletest) | |||
6 | add_executable(${exe_name} | 6 | add_executable(${exe_name} |
7 | DHT_cryptosendfiletest.c) | 7 | DHT_cryptosendfiletest.c) |
8 | 8 | ||
9 | linkCoreLibraries(${exe_name}) | 9 | linkCoreLibraries(${exe_name}) \ No newline at end of file |
10 | addCompilerFlags() | ||
diff --git a/testing/cmake/DHT_sendfiletest.cmake b/testing/cmake/DHT_sendfiletest.cmake index c7595224..93737914 100644 --- a/testing/cmake/DHT_sendfiletest.cmake +++ b/testing/cmake/DHT_sendfiletest.cmake | |||
@@ -7,4 +7,3 @@ add_executable(${exe_name} | |||
7 | DHT_sendfiletest.c) | 7 | DHT_sendfiletest.c) |
8 | 8 | ||
9 | linkCoreLibraries(${exe_name}) | 9 | linkCoreLibraries(${exe_name}) |
10 | addCompilerFlags() | ||
diff --git a/testing/cmake/DHT_test.cmake b/testing/cmake/DHT_test.cmake index e5c18c03..bcde4370 100644 --- a/testing/cmake/DHT_test.cmake +++ b/testing/cmake/DHT_test.cmake | |||
@@ -7,4 +7,3 @@ add_executable(${exe_name} | |||
7 | DHT_test.c) | 7 | DHT_test.c) |
8 | 8 | ||
9 | linkCoreLibraries(${exe_name}) | 9 | linkCoreLibraries(${exe_name}) |
10 | addCompilerFlags() | ||
diff --git a/testing/cmake/Lossless_UDP_testclient.cmake b/testing/cmake/Lossless_UDP_testclient.cmake index 375bb733..e894d228 100644 --- a/testing/cmake/Lossless_UDP_testclient.cmake +++ b/testing/cmake/Lossless_UDP_testclient.cmake | |||
@@ -7,4 +7,3 @@ add_executable(${exe_name} | |||
7 | Lossless_UDP_testclient.c) | 7 | Lossless_UDP_testclient.c) |
8 | 8 | ||
9 | linkCoreLibraries(${exe_name}) | 9 | linkCoreLibraries(${exe_name}) |
10 | addCompilerFlags() | ||
diff --git a/testing/cmake/Lossless_UDP_testserver.cmake b/testing/cmake/Lossless_UDP_testserver.cmake index fe16e937..04306c1a 100644 --- a/testing/cmake/Lossless_UDP_testserver.cmake +++ b/testing/cmake/Lossless_UDP_testserver.cmake | |||
@@ -7,4 +7,3 @@ add_executable(${exe_name} | |||
7 | Lossless_UDP_testserver.c) | 7 | Lossless_UDP_testserver.c) |
8 | 8 | ||
9 | linkCoreLibraries(${exe_name}) | 9 | linkCoreLibraries(${exe_name}) |
10 | addCompilerFlags() | ||
diff --git a/testing/cmake/Messenger_test.cmake b/testing/cmake/Messenger_test.cmake index 2848818b..a85e043d 100644 --- a/testing/cmake/Messenger_test.cmake +++ b/testing/cmake/Messenger_test.cmake | |||
@@ -7,4 +7,3 @@ add_executable(${exe_name} | |||
7 | Messenger_test.c) | 7 | Messenger_test.c) |
8 | 8 | ||
9 | linkCoreLibraries(${exe_name}) | 9 | linkCoreLibraries(${exe_name}) |
10 | addCompilerFlags() | ||
diff --git a/testing/cmake/nTox.cmake b/testing/cmake/nTox.cmake index 814b1427..1656bc80 100644 --- a/testing/cmake/nTox.cmake +++ b/testing/cmake/nTox.cmake | |||
@@ -9,4 +9,3 @@ add_executable(${exe_name} | |||
9 | target_link_libraries(${exe_name} ncurses) | 9 | target_link_libraries(${exe_name} ncurses) |
10 | 10 | ||
11 | linkCoreLibraries(${exe_name}) | 11 | linkCoreLibraries(${exe_name}) |
12 | addCompilerFlags() | ||