From bba825f0c8622e8023f5e0e531c30b0c38d15da1 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Wed, 3 Apr 2024 19:48:20 -0500 Subject: [PATCH] update CMake presets --- CMakeLists.txt | 4 ++-- CMakePresets.json | 55 +++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 48 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d08c60ca..63389b43 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,7 +58,8 @@ if(UNIX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wuninitialized -fPIC") add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0 _GLIBCXX_USE_CXX17_ABI=0) - if(NOT APPLE) + # For all except Clang and Apple Clang + if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -static-libgcc -lstdc++fs") endif() @@ -73,7 +74,6 @@ if(UNIX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -fPIC") elseif(MSVC) # Skip warning for invalid conversion from size_t to uint32_t for all targets below for now - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}") add_compile_options ("/wd4267" "/utf-8") elseif(WIN32) add_compile_definitions(_CRT_SECURE_NO_WARNINGS) diff --git a/CMakePresets.json b/CMakePresets.json index 3191abb6..3ae4f80b 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -18,9 +18,8 @@ "displayName": "CI configure step for Ubuntu", "description": "Same as default, Used in GitHub actions workflow", "inherits": "default", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release", - "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" } }, { @@ -28,9 +27,8 @@ "displayName": "Debug configure step for Ubuntu", "description": "Used to generate debug configuration for Ubuntu", "inherits": "default", - "cacheVariables": { + "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug", - "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", "CMAKE_CXX_FLAGS_INIT" : "-Og", "CMAKE_C_FLAGS_INIT" : "-Og" } @@ -39,7 +37,19 @@ "name": "ci-macos-13", "displayName": "CI configure step for MacOS", "description": "Same as default, Used in GitHub actions workflow", - "inherits": "default" + "inherits": "default", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, + { + "name": "debug-macos-13", + "displayName": "Debug configure step for MacOS", + "description": "Used to generate debug configuration for MacOS", + "inherits": "default", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } }, { "name": "ci-windows-2022", @@ -50,10 +60,22 @@ "architecture": { "value": "x64" }, - "cacheVariables": { + "cacheVariables": { "CMAKE_BUILD_TYPE": "Release", - "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", - "CMAKE_CXX_FLAGS_INIT": "/O2 /Zc:inline" + "CMAKE_CXX_FLAGS_INIT": "/Zc:inline" + } + }, + { + "name": "debug-windows-2022", + "displayName": "Debug configure step for Windows", + "description": "Set architecture to 64-bit (b/c RakNet)", + "inherits": "default", + "generator": "Visual Studio 17 2022", + "architecture": { + "value": "x64" + }, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" } }, { @@ -100,12 +122,27 @@ "configuration": "Release", "jobs": 2 }, + { + "name": "debug-windows-2022", + "configurePreset": "debug-windows-2022", + "displayName": "Windows Debug Build", + "description": "This preset is used to debug the build on windows", + "configuration": "Release", + "jobs": 2 + }, { "name": "ci-macos-13", "configurePreset": "ci-macos-13", "displayName": "MacOS CI Build", "description": "This preset is used by the CI build on MacOS", "jobs": 2 + }, + { + "name": "debug-macos-13", + "configurePreset": "debug-macos-13", + "displayName": "MacOS Debug Build", + "description": "This preset is used to debug the build on MacOS", + "jobs": 2 } ], "testPresets": [