mirror of
https://github.com/Naios/continuable.git
synced 2026-01-01 03:12:12 +08:00
Add targets for warnings, flags and noexcept flags
This commit is contained in:
parent
257c1b0062
commit
76f3fb0380
@ -1 +1,5 @@
|
||||
add_library(continuable-features-flags INTERFACE)
|
||||
add_library(continuable-features-warnings INTERFACE)
|
||||
add_library(continuable-features-noexcept INTERFACE)
|
||||
|
||||
include(cmake/configure_compiler.cmake)
|
||||
|
||||
@ -1,8 +1,15 @@
|
||||
# Enable full warnings
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra")
|
||||
target_compile_options(continuable-features-warnings
|
||||
INTERFACE
|
||||
-Wall
|
||||
-pedantic
|
||||
-Wextra)
|
||||
|
||||
if (TESTS_NO_EXCEPTIONS)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
|
||||
target_compile_options(continuable-features-noexcept
|
||||
INTERFACE
|
||||
-fno-exceptions)
|
||||
|
||||
message(STATUS "Clang: Disabled exceptions")
|
||||
endif()
|
||||
|
||||
|
||||
@ -1,7 +1,14 @@
|
||||
# Enable full warnings
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic -Wextra")
|
||||
target_compile_options(continuable-features-warnings
|
||||
INTERFACE
|
||||
-Wall
|
||||
-pedantic
|
||||
-Wextra)
|
||||
|
||||
if (TESTS_NO_EXCEPTIONS)
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-exceptions")
|
||||
target_compile_options(continuable-features-noexcept
|
||||
INTERFACE
|
||||
-fno-exceptions)
|
||||
|
||||
message(STATUS "GCC: Disabled exceptions")
|
||||
endif()
|
||||
|
||||
@ -5,13 +5,25 @@ else()
|
||||
endif()
|
||||
|
||||
if (PLATFORM EQUAL 64)
|
||||
add_definitions("-D_WIN64")
|
||||
target_compile_definitions(continuable-features-flags
|
||||
INTERFACE
|
||||
-D_WIN64)
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /MP2 /bigobj")
|
||||
target_compile_options(continuable-features-flags
|
||||
INTERFACE
|
||||
/MP2
|
||||
/bigobj)
|
||||
|
||||
target_compile_options(continuable-features-warnings
|
||||
INTERFACE
|
||||
/W4)
|
||||
|
||||
if (TESTS_NO_EXCEPTIONS)
|
||||
add_definitions(-D_HAS_EXCEPTIONS=0)
|
||||
target_compile_definitions(continuable-features-noexcept
|
||||
INTERFACE
|
||||
-D_HAS_EXCEPTIONS=0)
|
||||
|
||||
string(REGEX REPLACE "/GX" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
string(REGEX REPLACE "/EHsc" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||
message(STATUS "MSVC: Disabled exceptions")
|
||||
|
||||
@ -24,7 +24,10 @@ foreach(STEP RANGE 4)
|
||||
PRIVATE
|
||||
gtest-main
|
||||
cxx_function
|
||||
continuable)
|
||||
continuable
|
||||
continuable-features-flags
|
||||
continuable-features-warnings
|
||||
continuable-features-noexcept)
|
||||
|
||||
target_compile_definitions(${PROJECT_NAME}
|
||||
PUBLIC
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user