mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Apply compiler flags only once
This commit is contained in:
parent
e9f0059a15
commit
6939a48226
|
@ -1,5 +1,12 @@
|
|||
cmake_minimum_required(VERSION 2.6.0)
|
||||
|
||||
if(NOT WIN32)
|
||||
if(("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang"))
|
||||
message(STATUS "==== ${CMAKE_C_COMPILER_ID} detected - Adding compiler flags ====")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
include_directories(${CMAKE_HOME_DIRECTORY}/sodium/include/)
|
||||
endif()
|
||||
|
@ -24,15 +31,5 @@ macro(linkCoreLibraries exe_name)
|
|||
endif()
|
||||
endmacro()
|
||||
|
||||
|
||||
macro(addCompilerFlags)
|
||||
if(NOT WIN32)
|
||||
if(("${CMAKE_C_COMPILER_ID}" STREQUAL "GNU") OR ("${CMAKE_C_COMPILER_ID}" STREQUAL "Clang"))
|
||||
message(STATUS "==== ${CMAKE_C_COMPILER_ID} detected - Adding compiler flags ====")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Werror")
|
||||
endif()
|
||||
endif()
|
||||
endmacro()
|
||||
|
||||
ADD_SUBDIRECTORY(testing)
|
||||
ADD_SUBDIRECTORY(other)
|
|
@ -7,4 +7,3 @@ add_executable(${exe_name}
|
|||
DHT_bootstrap.c)
|
||||
|
||||
linkCoreLibraries(${exe_name})
|
||||
addCompilerFlags()
|
||||
|
|
|
@ -6,5 +6,4 @@ set(exe_name DHT_cryptosendfiletest)
|
|||
add_executable(${exe_name}
|
||||
DHT_cryptosendfiletest.c)
|
||||
|
||||
linkCoreLibraries(${exe_name})
|
||||
addCompilerFlags()
|
||||
linkCoreLibraries(${exe_name})
|
|
@ -7,4 +7,3 @@ add_executable(${exe_name}
|
|||
DHT_sendfiletest.c)
|
||||
|
||||
linkCoreLibraries(${exe_name})
|
||||
addCompilerFlags()
|
||||
|
|
|
@ -7,4 +7,3 @@ add_executable(${exe_name}
|
|||
DHT_test.c)
|
||||
|
||||
linkCoreLibraries(${exe_name})
|
||||
addCompilerFlags()
|
||||
|
|
|
@ -7,4 +7,3 @@ add_executable(${exe_name}
|
|||
Lossless_UDP_testclient.c)
|
||||
|
||||
linkCoreLibraries(${exe_name})
|
||||
addCompilerFlags()
|
||||
|
|
|
@ -7,4 +7,3 @@ add_executable(${exe_name}
|
|||
Lossless_UDP_testserver.c)
|
||||
|
||||
linkCoreLibraries(${exe_name})
|
||||
addCompilerFlags()
|
||||
|
|
|
@ -7,4 +7,3 @@ add_executable(${exe_name}
|
|||
Messenger_test.c)
|
||||
|
||||
linkCoreLibraries(${exe_name})
|
||||
addCompilerFlags()
|
||||
|
|
|
@ -9,4 +9,3 @@ add_executable(${exe_name}
|
|||
target_link_libraries(${exe_name} ncurses)
|
||||
|
||||
linkCoreLibraries(${exe_name})
|
||||
addCompilerFlags()
|
||||
|
|
Loading…
Reference in New Issue
Block a user