|
@@ -69,16 +69,59 @@ set(SRC_PERFORMANCE
|
|
|
|
|
|
if("${CMAKE_BUILD_TYPE}" STREQUAL "Release")
|
|
|
set(COMPILE_OPTIONS -flto)
|
|
|
- set(DEBUG_LINK "")
|
|
|
+ set(LINK_OPTIONS -flto)
|
|
|
set(LOG_LEVEL 2)
|
|
|
set(ERROR_SIMULATOR "")
|
|
|
else()
|
|
|
- set(COMPILE_OPTIONS --coverage)
|
|
|
- set(DEBUG_LINK gcov)
|
|
|
+ if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
|
+ set(COMPILE_OPTIONS --coverage)
|
|
|
+ endif()
|
|
|
+ set(LINK_OPTIONS gcov)
|
|
|
set(LOG_LEVEL 4)
|
|
|
set(ERROR_SIMULATOR "ERROR_SIMULATOR")
|
|
|
endif()
|
|
|
|
|
|
+if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
|
|
+ set(MORE_WARNINGS
|
|
|
+ -Waligned-new=all
|
|
|
+ -Walloc-zero
|
|
|
+ -Wanalyzer-too-complex
|
|
|
+ -Warith-conversion
|
|
|
+ -Warray-bounds=2
|
|
|
+ -Wattribute-alias=2
|
|
|
+ -Wbidi-chars=any
|
|
|
+ -Wcast-align=strict
|
|
|
+ -Wcatch-value=3
|
|
|
+ -Wcomma-subscript
|
|
|
+ -Wconditionally-supported
|
|
|
+ -Wduplicated-branches
|
|
|
+ -Wduplicated-cond
|
|
|
+ -Wformat-overflow=2
|
|
|
+ -Wformat-signedness
|
|
|
+ -Wformat-truncation=2
|
|
|
+ -Wimplicit-fallthrough=5
|
|
|
+ -Winvalid-imported-macros
|
|
|
+ -Wlogical-op
|
|
|
+ -Wmultiple-inheritance
|
|
|
+ -Wnoexcept
|
|
|
+ -Wnormalized=nfkc
|
|
|
+ -Wplacement-new=2
|
|
|
+ -Wredundant-tags
|
|
|
+ -Wshift-overflow=2
|
|
|
+ -Wstack-usage=8388608
|
|
|
+ -Wstrict-null-sentinel
|
|
|
+ -Wstringop-overflow=4
|
|
|
+ -Wsuggest-final-methods
|
|
|
+ -Wsuggest-final-types
|
|
|
+ -Wtrampolines
|
|
|
+ -Wtrivial-auto-var-init
|
|
|
+ -Wunused-const-variable=2
|
|
|
+ -Wuse-after-free=3
|
|
|
+ -Wvirtual-inheritance
|
|
|
+ -Wvolatile
|
|
|
+ )
|
|
|
+endif()
|
|
|
+
|
|
|
add_library(core STATIC ${SRC})
|
|
|
target_compile_options(core PUBLIC
|
|
|
${COMPILE_OPTIONS}
|
|
@@ -89,21 +132,10 @@ target_compile_options(core PUBLIC
|
|
|
-nostdinc++
|
|
|
-pedantic
|
|
|
-pedantic-errors
|
|
|
- -Waligned-new=all
|
|
|
-Wall
|
|
|
-Walloca
|
|
|
- -Walloc-zero
|
|
|
- -Wanalyzer-too-complex
|
|
|
- -Warith-conversion
|
|
|
- -Warray-bounds=2
|
|
|
-Warray-parameter
|
|
|
- -Wattribute-alias=2
|
|
|
- -Wbidi-chars=any
|
|
|
- -Wcast-align=strict
|
|
|
-Wcast-qual
|
|
|
- -Wcatch-value=3
|
|
|
- -Wcomma-subscript
|
|
|
- -Wconditionally-supported
|
|
|
-Wconversion
|
|
|
-Wctad-maybe-unsupported
|
|
|
-Wctor-dtor-privacy
|
|
@@ -113,8 +145,6 @@ target_compile_options(core PUBLIC
|
|
|
-Wdeprecated-enum-float-conversion
|
|
|
-Wdisabled-optimization
|
|
|
-Wdouble-promotion
|
|
|
- -Wduplicated-branches
|
|
|
- -Wduplicated-cond
|
|
|
-Weffc++
|
|
|
-Wenum-compare
|
|
|
-Wenum-conversion
|
|
@@ -123,60 +153,38 @@ target_compile_options(core PUBLIC
|
|
|
-Wextra-semi
|
|
|
-Wfloat-equal
|
|
|
-Wformat=2
|
|
|
- -Wformat-overflow=2
|
|
|
- -Wformat-signedness
|
|
|
- -Wformat-truncation=2
|
|
|
-Wframe-larger-than=8388608
|
|
|
- -Wimplicit-fallthrough=5
|
|
|
-Winfinite-recursion
|
|
|
-Winit-self
|
|
|
- -Winvalid-imported-macros
|
|
|
-Winvalid-pch
|
|
|
-Wlarger-than=1073741824
|
|
|
- -Wlogical-op
|
|
|
-Wmismatched-tags
|
|
|
-Wmissing-braces
|
|
|
-Wmissing-declarations
|
|
|
-Wmissing-include-dirs
|
|
|
-Wmultichar
|
|
|
- -Wmultiple-inheritance
|
|
|
- -Wnoexcept
|
|
|
-Wnon-virtual-dtor
|
|
|
- -Wnormalized=nfkc
|
|
|
-Wnull-dereference
|
|
|
-Wold-style-cast
|
|
|
-Woverlength-strings
|
|
|
-Woverloaded-virtual
|
|
|
- -Wplacement-new=2
|
|
|
-Wredundant-decls
|
|
|
- -Wredundant-tags
|
|
|
-Wregister
|
|
|
-Wshadow
|
|
|
- -Wshift-overflow=2
|
|
|
-Wsign-conversion
|
|
|
-Wsign-promo
|
|
|
-Wstack-protector
|
|
|
- -Wstack-usage=8388608
|
|
|
- -Wstrict-null-sentinel
|
|
|
-Wstrict-overflow=5
|
|
|
- -Wstringop-overflow=4
|
|
|
- -Wsuggest-final-methods
|
|
|
- -Wsuggest-final-types
|
|
|
-Wsuggest-override
|
|
|
-Wswitch-enum
|
|
|
-Wsynth
|
|
|
- -Wtrampolines
|
|
|
- -Wtrivial-auto-var-init
|
|
|
-Wundef
|
|
|
-Wunreachable-code
|
|
|
- -Wunused-const-variable=2
|
|
|
-Wunused-macros
|
|
|
- -Wuse-after-free=3
|
|
|
- -Wvirtual-inheritance
|
|
|
-Wvla
|
|
|
- -Wvolatile
|
|
|
-Wwrite-strings
|
|
|
-Wzero-as-null-pointer-constant
|
|
|
+ ${MORE_WARNINGS}
|
|
|
)
|
|
|
target_compile_definitions(core
|
|
|
PUBLIC CORE_LOG_LEVEL=${LOG_LEVEL}
|
|
@@ -184,7 +192,7 @@ target_compile_definitions(core
|
|
|
)
|
|
|
target_link_libraries(core
|
|
|
PUBLIC -nodefaultlibs c m
|
|
|
- PRIVATE ${DEBUG_LINK}
|
|
|
+ PRIVATE ${LINK_OPTIONS}
|
|
|
)
|
|
|
target_sources(core PUBLIC
|
|
|
FILE_SET HEADERS
|
|
@@ -236,4 +244,4 @@ target_link_libraries(test PRIVATE core)
|
|
|
target_compile_definitions(test PRIVATE ${ERROR_SIMULATOR})
|
|
|
|
|
|
add_executable(performance ${SRC_PERFORMANCE})
|
|
|
-target_link_libraries(performance PRIVATE core)
|
|
|
+target_link_libraries(performance PRIVATE core)
|