summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt23
-rw-r--r--userconfig-sthalik@Windows-Clang.cmake3
-rw-r--r--userconfig-sthalik@Windows-GNU.cmake16
3 files changed, 26 insertions, 16 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index cb93c5e0..54840a58 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -151,14 +151,26 @@ if(MSVC)
add_link_options(-HIGHENTROPYVA)
endif()
else()
+ if(CMAKE_CXX_COMPILER_ID MATCHES "Clang$")
+ add_definitions(-D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
+ add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-ambiguous-reversed-operator>)
+ add_compile_options(-Wno-reserved-macro-identifier)
+ #add_compile_definitions($<$<COMPILE_LANGUAGE:CXX>:$<$<CONFIG:DEBUG,Debug>:_LIBCPP_ENABLE_ASSERTIONS>>)
+ else()
+ #add_compile_definitions($<$<COMPILE_LANGUAGE:CXX>:$<$<CONFIG:DEBUG,Debug>:-D_GLIBCXX_ASSERTIONS>>)
+ #add_compile_definitions($<$<COMPILE_LANGUAGE:CXX>:$<$<CONFIG:DEBUG,Debug>:-D_GLIBCXX_DEBUG>>)
+ #add_compile_definitions($<$<COMPILE_LANGUAGE:CXX>:$<$<CONFIG:DEBUG,Debug>:-D_GLIBCXX_DEBUG_PEDANTIC>>)
+ endif()
+
add_compile_options(-Wstrict-aliasing -Werror=strict-aliasing)
add_compile_options(-Wno-float-equal)
- if(NOT WIN32)
+
+ if(NOT APPLE)
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fuse-cxa-atexit>)
endif()
if(WIN32)
add_link_options(-Wl,--nxcompat -Wl,--dynamicbase)
- if(CMAKE_SIZEOF_VOID_P GREATER_EQUAL 8)
+ if(CMAKE_SIZEOF_VOID_P GREATER 4)
add_link_options(-Wl,--high-entropy-va)
else()
add_link_options(-Wl,--large-address-aware)
@@ -166,12 +178,6 @@ else()
endif()
endif()
-if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "AppleClang")
- add_compile_definitions($<$<COMPILE_LANGUAGE:CXX>:$<$<CONFIG:DEBUG,Debug>:_LIBCPP_ENABLE_ASSERTIONS>>)
- add_compile_options(-Wno-reserved-macro-identifier)
- add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-Wno-ambiguous-reversed-operator>)
-endif()
-
set_directory_properties(PROPERTIES CORRADE_USE_PEDANTIC_FLAGS OFF)
set_directory_properties(PROPERTIES CORRADE_CXX_STANDARD ${CMAKE_CXX_STANDARD})
set_directory_properties(PROPERTIES INTERFACE_CORRADE_CXX_STANDARD ${CMAKE_CXX_STANDARD})
@@ -224,7 +230,6 @@ if(CMAKE_COMPILER_IS_GNUCXX)
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang$")
- add_definitions(-D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
add_compile_options(-Wno-shift-op-parentheses)
add_compile_options(-Wno-c99-compat)
elseif(CMAKE_COMPILER_IS_GNUCXX)
diff --git a/userconfig-sthalik@Windows-Clang.cmake b/userconfig-sthalik@Windows-Clang.cmake
index 524ccf77..cb03a067 100644
--- a/userconfig-sthalik@Windows-Clang.cmake
+++ b/userconfig-sthalik@Windows-Clang.cmake
@@ -42,6 +42,9 @@ sets(STRING
CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}"
)
+add_definitions(-D_LIBCPP_ENABLE_ASSERTIONS)
+add_definitions(-D_LIBCPP_REMOVE_TRANSITIVE_INCLUDES)
+
if(NOT CMAKE_CXX_COMPILER_VERSION LESS "18.0")
add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fassume-nothrow-exception-dtor>)
endif()
diff --git a/userconfig-sthalik@Windows-GNU.cmake b/userconfig-sthalik@Windows-GNU.cmake
index 10fe46c5..99bb412a 100644
--- a/userconfig-sthalik@Windows-GNU.cmake
+++ b/userconfig-sthalik@Windows-GNU.cmake
@@ -13,21 +13,22 @@ sets(STRING
list(APPEND CMAKE_IGNORE_PATH "c:/msys64" "c:/msys64/clang64")
list(APPEND CMAKE_IGNORE_PREFIX_PATH "c:/msys64" "c:/msys64/clang64")
-add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fconcepts-diagnostics-depth=3>)
+add_definitions(-D_GLIBCXX_USE_DEPRECATED=0 -D_GLIBCXX_USE_CXX11_ABI)
add_compile_options(-fdiagnostics-color=always)
-add_compile_options(-fstack-usage -Wstack-usage=16384)
+add_compile_options($<$<COMPILE_LANGUAGE:CXX>:-fconcepts-diagnostics-depth=3>)
+
+add_definitions(-D_GLIBCXX_ASSERTIONS)
+add_compile_definitions($<$<COMPILE_LANGUAGE:CXX>:$<$<CONFIG:DEBUG,Debug>:-D_GLIBCXX_DEBUG>>)
+add_compile_definitions($<$<COMPILE_LANGUAGE:CXX>:$<$<CONFIG:DEBUG,Debug>:-D_GLIBCXX_DEBUG_PEDANTIC>>)
+add_compile_definitions($<$<NOT:$<CONFIG:Debug,DEBUG>>:_FORTIFY_SOURCE=2>)
+add_compile_definitions($<$<CONFIG:Debug,DEBUG>:_FORTIFY_SOURCE=3>)
if(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
- add_definitions(-D_GLIBCXX_ASSERTIONS)
- add_definitions(-D_GLIBCXX_USE_DEPRECATED=0 -D_GLIBCXX_USE_CXX11_ABI)
- add_definitions(-D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC)
set(OpenCV_DIR "f:/build/opencv/build-gcc-debug-floormat/install" CACHE PATH "" FORCE)
else()
set(BUILD_SHARED_LIBS OFF)
set(OpenCV_DIR "f:/build/opencv/build-gcc-release-floormat/install" CACHE PATH "" FORCE)
endif()
-add_compile_definitions("$<$<CONFIG:Debug,DEBUG>:_FORTIFY_SOURCE=3>")
-add_compile_definitions("$<IF:$<CONFIG:Debug,DEBUG>,,_FORTIFY_SOURCE=3>")
# for building submodule dependencies
function(fm-userconfig-external)
@@ -68,6 +69,7 @@ endfunction()
# for floormat sources only
function(fm-userconfig-src)
+ add_compile_options(-fstack-usage -Wstack-usage=16384)
add_compile_options(
-Wall -Wextra -Wpedantic -Wno-old-style-cast -Wno-padded
-Wstringop-overflow -Wstringop-truncation