summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxim Biro <nurupo.contributions@gmail.com>2013-07-17 18:28:53 -0400
committerMaxim Biro <nurupo.contributions@gmail.com>2013-07-17 18:29:26 -0400
commit6939a48226ec9cf2ab5d0a46e583831c195f2b7e (patch)
tree70d78f8dd681f32fdbf10a5f03fed9a898fca368
parente9f0059a15bcc73e5b0cfb506bf3cebe693e75d0 (diff)
Apply compiler flags only once
-rw-r--r--CMakeLists.txt17
-rw-r--r--other/cmake/DHT_bootstrap.cmake1
-rw-r--r--testing/cmake/DHT_cryptosendfiletest.cmake3
-rw-r--r--testing/cmake/DHT_sendfiletest.cmake1
-rw-r--r--testing/cmake/DHT_test.cmake1
-rw-r--r--testing/cmake/Lossless_UDP_testclient.cmake1
-rw-r--r--testing/cmake/Lossless_UDP_testserver.cmake1
-rw-r--r--testing/cmake/Messenger_test.cmake1
-rw-r--r--testing/cmake/nTox.cmake1
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 @@
1cmake_minimum_required(VERSION 2.6.0) 1cmake_minimum_required(VERSION 2.6.0)
2 2
3if(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()
8endif()
9
3if(WIN32) 10if(WIN32)
4 include_directories(${CMAKE_HOME_DIRECTORY}/sodium/include/) 11 include_directories(${CMAKE_HOME_DIRECTORY}/sodium/include/)
5endif() 12endif()
@@ -24,15 +31,5 @@ macro(linkCoreLibraries exe_name)
24 endif() 31 endif()
25endmacro() 32endmacro()
26 33
27
28macro(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()
35endmacro()
36
37ADD_SUBDIRECTORY(testing) 34ADD_SUBDIRECTORY(testing)
38ADD_SUBDIRECTORY(other) \ No newline at end of file 35ADD_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
9linkCoreLibraries(${exe_name}) 9linkCoreLibraries(${exe_name})
10addCompilerFlags()
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)
6add_executable(${exe_name} 6add_executable(${exe_name}
7 DHT_cryptosendfiletest.c) 7 DHT_cryptosendfiletest.c)
8 8
9linkCoreLibraries(${exe_name}) 9linkCoreLibraries(${exe_name}) \ No newline at end of file
10addCompilerFlags()
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
9linkCoreLibraries(${exe_name}) 9linkCoreLibraries(${exe_name})
10addCompilerFlags()
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
9linkCoreLibraries(${exe_name}) 9linkCoreLibraries(${exe_name})
10addCompilerFlags()
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
9linkCoreLibraries(${exe_name}) 9linkCoreLibraries(${exe_name})
10addCompilerFlags()
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
9linkCoreLibraries(${exe_name}) 9linkCoreLibraries(${exe_name})
10addCompilerFlags()
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
9linkCoreLibraries(${exe_name}) 9linkCoreLibraries(${exe_name})
10addCompilerFlags()
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}
9target_link_libraries(${exe_name} ncurses) 9target_link_libraries(${exe_name} ncurses)
10 10
11linkCoreLibraries(${exe_name}) 11linkCoreLibraries(${exe_name})
12addCompilerFlags()