summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2023-03-19 20:40:27 +0100
committerStanislaw Halik <sthalik@misaki.pl>2023-03-19 20:54:19 +0100
commit55e508bffb9e96d375f79dec92c9d8ea7d97b9b1 (patch)
tree8c0b8c36de0f4b9896f4a0c301e02f45f7d323f0
parent19daf844f7493ca05ce7b427664f7345a85752b1 (diff)
cmake: handle changing build type in userconfig
-rw-r--r--userconfig-sthalik@Windows-Clang.cmake25
-rw-r--r--userconfig-sthalik@Windows-GNU.cmake52
-rw-r--r--userconfig-sthalik@Windows-MSVC.cmake35
3 files changed, 67 insertions, 45 deletions
diff --git a/userconfig-sthalik@Windows-Clang.cmake b/userconfig-sthalik@Windows-Clang.cmake
index 82b8c71f..b41dab64 100644
--- a/userconfig-sthalik@Windows-Clang.cmake
+++ b/userconfig-sthalik@Windows-Clang.cmake
@@ -22,6 +22,7 @@ else()
add_link_options(-Wl,--gc-sections -Wl,--icf=all)
sets(BOOL FLOORMAT_PRECOMPILED-HEADERS ON)
endif()
+
set(CMAKE_INSTALL_MESSAGE NEVER)
if(FLOORMAT_ASAN)
@@ -38,7 +39,6 @@ sets(STRING
CMAKE_EXE_LINKER_FLAGS_DEBUG ""
CMAKE_SHARED_LINKER_FLAGS_DEBUG ""
)
-
sets(STRING
CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS}"
CMAKE_CXX_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG}"
@@ -55,18 +55,29 @@ function(fm-userconfig-external)
-Wno-unused-but-set-variable
-Wno-error=return-type
)
- sets(BOOL
- CORRADE_BUILD_TESTS ON
- MAGNUM_BUILD_TESTS ON
- )
if(NOT CMAKE_BUILD_TYPE STREQUAL "DEBUG" OR FLOORMAT_ASAN)
sets(BOOL
- SDL_STATIC ON
+ FLOORMAT_SUBMODULE-SDL2 ON
SDL_SHARED OFF
+ SDL_STATIC ON
CORRADE_BUILD_STATIC ON
+ CORRADE_BUILD_TESTS OFF
CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT ON
- MAGNUM_BUILD_STATIC ON
MAGNUM_BUILD_PLUGINS_STATIC ON
+ MAGNUM_BUILD_STATIC ON
+ MAGNUM_BUILD_TESTS OFF
+ )
+ else()
+ sets(BOOL
+ FLOORMAT_SUBMODULE-SDL2 OFF
+ SDL_SHARED ON
+ SDL_STATIC OFF
+ CORRADE_BUILD_STATIC OFF
+ CORRADE_BUILD_TESTS OFF
+ CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT OFF
+ MAGNUM_BUILD_PLUGINS_STATIC OFF
+ MAGNUM_BUILD_STATIC OFF
+ MAGNUM_BUILD_TESTS OFF
)
endif()
endfunction()
diff --git a/userconfig-sthalik@Windows-GNU.cmake b/userconfig-sthalik@Windows-GNU.cmake
index b658b393..786f7f41 100644
--- a/userconfig-sthalik@Windows-GNU.cmake
+++ b/userconfig-sthalik@Windows-GNU.cmake
@@ -11,39 +11,43 @@ sets(STRING
CMAKE_CXX_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}"
)
+list(APPEND CMAKE_IGNORE_PATH "c:/msys64" "c:/msys64/clang64")
+list(APPEND CMAKE_IGNORE_PREFIX_PATH "c:/msys64" "c:/msys64/clang64")
+
add_compile_options(-fdiagnostics-color=always)
set(OpenCV_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../opentrack-depends/opencv/build-gcc/install" CACHE PATH "" FORCE)
-sets(BOOL FLOORMAT_PRECOMPILED-HEADERS ON)
-
if(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
add_definitions(-D_GLIBCXX_ASSERTIONS)
- sets(BOOL FLOORMAT_PRECOMPILED-HEADERS OFF)
+ sets(BOOL
+ FLOORMAT_PRECOMPILED-HEADERS OFF
+ CORRADE_BUILD_TESTS ON
+ MAGNUM_BUILD_TESTS ON
+ SDL_STATIC OFF
+ SDL_SHARED ON
+ CORRADE_BUILD_STATIC OFF
+ CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT OFF
+ MAGNUM_BUILD_STATIC OFF
+ MAGNUM_BUILD_PLUGINS_STATIC OFF
+ MAGNUM_BUILD_STATIC_UNIQUE_GLOBALS ON
+ )
+else()
+ sets(BOOL
+ FLOORMAT_PRECOMPILED-HEADERS ON
+ CORRADE_BUILD_TESTS OFF
+ MAGNUM_BUILD_TESTS OFF
+ SDL_STATIC ON
+ SDL_SHARED OFF
+ CORRADE_BUILD_STATIC ON
+ CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT ON
+ MAGNUM_BUILD_STATIC ON
+ MAGNUM_BUILD_PLUGINS_STATIC ON
+ MAGNUM_BUILD_STATIC_UNIQUE_GLOBALS OFF
+ )
endif()
# for building submodule dependencies
function(fm-userconfig-external)
- sets(BOOL
- CORRADE_BUILD_TESTS OFF
- MAGNUM_BUILD_TESTS OFF
- )
- if(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
- sets(BOOL
- CORRADE_BUILD_TESTS ON
- MAGNUM_BUILD_TESTS ON
- )
- else()
- sets(BOOL
- FLOORMAT_PRECOMPILED-HEADERS ON
- SDL_STATIC ON
- SDL_SHARED OFF
- CORRADE_BUILD_STATIC ON
- CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT ON
- MAGNUM_BUILD_STATIC ON
- MAGNUM_BUILD_PLUGINS_STATIC ON
- MAGNUM_BUILD_STATIC_UNIQUE_GLOBALS OFF
- )
- endif()
add_compile_options(
-Wno-ignored-attributes
-Wno-unused-function
diff --git a/userconfig-sthalik@Windows-MSVC.cmake b/userconfig-sthalik@Windows-MSVC.cmake
index 390faa2b..4f2b23d3 100644
--- a/userconfig-sthalik@Windows-MSVC.cmake
+++ b/userconfig-sthalik@Windows-MSVC.cmake
@@ -9,20 +9,27 @@ list(APPEND CMAKE_IGNORE_PATH "c:/msys64")
list(APPEND CMAKE_IGNORE_PREFIX_PATH "c:/msys64")
set(CMAKE_INSTALL_MESSAGE NEVER)
-function(fm-userconfig-external)
- if(NOT CMAKE_BUILD_TYPE STREQUAL "DEBUG")
- sets(BOOL
- SDL_STATIC ON
- SDL_SHARED OFF
- CORRADE_BUILD_STATIC ON
- CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT ON
- MAGNUM_BUILD_STATIC ON
- MAGNUM_BUILD_PLUGINS_STATIC ON
- )
- endif()
-endfunction()
-
-sets(BOOL FLOORMAT_PRECOMPILED-HEADERS OFF)
+if(CMAKE_BUILD_TYPE STREQUAL "DEBUG")
+ sets(BOOL
+ FLOORMAT_PRECOMPILED-HEADERS OFF
+ SDL_STATIC OFF
+ SDL_SHARED ON
+ CORRADE_BUILD_STATIC OFF
+ CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT OFF
+ MAGNUM_BUILD_STATIC OFF
+ MAGNUM_BUILD_PLUGINS_STATIC OFF
+ )
+else()
+ sets(BOOL
+ FLOORMAT_PRECOMPILED-HEADERS OFF
+ SDL_STATIC ON
+ SDL_SHARED OFF
+ CORRADE_BUILD_STATIC ON
+ CORRADE_PLUGINMANAGER_NO_DYNAMIC_PLUGIN_SUPPORT ON
+ MAGNUM_BUILD_STATIC ON
+ MAGNUM_BUILD_PLUGINS_STATIC ON
+ )
+endif()
function(fm-userconfig-src)
add_compile_options(-W4 -Qvec-report:1)