From 2239507d3c05cdf07d5d57156de2865021e18e3f Mon Sep 17 00:00:00 2001 From: jadebenn Date: Mon, 29 Jan 2024 06:14:47 -0600 Subject: [PATCH 01/74] Add MSVC optimization flags --- CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 09cbac97e..9aac1e9d8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,8 +68,8 @@ if(UNIX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -O2 -fPIC") elseif(MSVC) - # Skip warning for invalid conversion from size_t to uint32_t for all targets below for now - add_compile_options("/wd4267" "/utf-8") + # Set MSVC-specific optimization flags and skip warning for invalid conversion from size_t to uint32_t for all targets below + add_compile_options("/O2" "/Zc:inline" "/wd4267" "/utf-8") elseif(WIN32) add_compile_definitions(_CRT_SECURE_NO_WARNINGS) endif() From 8a34544d0ea4d20b1092e71a84b7d93f3329f9a9 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Tue, 30 Jan 2024 08:44:29 -0600 Subject: [PATCH 02/74] test moving flags to json --- CMakeLists.txt | 3 --- CMakePresets.json | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 04ebd4311..f64bfb36d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,9 +68,6 @@ if(UNIX) endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -O2 -fPIC") -elseif(MSVC) - # Set MSVC-specific optimization flags and skip warning for invalid conversion from size_t to uint32_t for all targets below - add_compile_options("/O2" "/Zc:inline" "/wd4267" "/utf-8") elseif(WIN32) add_compile_definitions(_CRT_SECURE_NO_WARNINGS) endif() diff --git a/CMakePresets.json b/CMakePresets.json index 2feabc538..104d138c9 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -35,6 +35,7 @@ "value": "x64" }, "cacheVariables": { + "COMPILE_OPTIONS": "/O2 /Zc:inline /wd4267 /utf-8", "CMAKE_BUILD_TYPE": "RelWithDebInfo" } }, From 9b7c593ae9bb6fe2da8b3e4401384e97b8339b1d Mon Sep 17 00:00:00 2001 From: jadebenn Date: Tue, 30 Jan 2024 08:49:53 -0600 Subject: [PATCH 03/74] Update CMakePresets.json --- CMakePresets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakePresets.json b/CMakePresets.json index 104d138c9..6906ab6e6 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -35,7 +35,7 @@ "value": "x64" }, "cacheVariables": { - "COMPILE_OPTIONS": "/O2 /Zc:inline /wd4267 /utf-8", + "COMPILE_OPTIONS": "/permissive- /Zc:inline /wd4267 /utf-8", "CMAKE_BUILD_TYPE": "RelWithDebInfo" } }, From 70f37560986b956e21cf5473edf0f8f3f35e62ef Mon Sep 17 00:00:00 2001 From: jadebenn Date: Tue, 30 Jan 2024 18:49:46 -0600 Subject: [PATCH 04/74] testing --- .github/workflows/build-and-test.yml | 4 ++-- CMakePresets.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index fc44885d9..6211ece7b 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [ main ] + branches: [ main, MSVCCompilerFlags ] pull_request: - branches: [ main ] + branches: [ main, MSVCCompilerFlags ] jobs: build-and-test: diff --git a/CMakePresets.json b/CMakePresets.json index 6906ab6e6..c2d19788a 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -35,7 +35,7 @@ "value": "x64" }, "cacheVariables": { - "COMPILE_OPTIONS": "/permissive- /Zc:inline /wd4267 /utf-8", + "COMPILE_OPTIONS": "/permissive-;/Zc:inline;/wd4267;/utf-8", "CMAKE_BUILD_TYPE": "RelWithDebInfo" } }, From 10d7776fb2ab1e3f646035a4deb6b79b211193f0 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Tue, 30 Jan 2024 19:33:59 -0600 Subject: [PATCH 05/74] trying more variations on the flags --- CMakeLists.txt | 3 +++ CMakePresets.json | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f64bfb36d..1b6a775e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -68,6 +68,9 @@ if(UNIX) endif() set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -O2 -fPIC") +elseif(MSVC) + # Skip warning for invalid conversion from size_t to uint32_t for all targets below for now + add_compile_options("/wd4267" "/utf-8") elseif(WIN32) add_compile_definitions(_CRT_SECURE_NO_WARNINGS) endif() diff --git a/CMakePresets.json b/CMakePresets.json index c2d19788a..f4163dc24 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -34,9 +34,9 @@ "architecture": { "value": "x64" }, - "cacheVariables": { - "COMPILE_OPTIONS": "/permissive-;/Zc:inline;/wd4267;/utf-8", - "CMAKE_BUILD_TYPE": "RelWithDebInfo" + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo", + "COMPILE_OPTIONS": "/permissive-;/Zc:inline" } }, { From e7058be3dcee8dd5eb533122a663819e76855df7 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Tue, 30 Jan 2024 20:28:05 -0600 Subject: [PATCH 06/74] third test --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b6a775e5..24c71da7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,7 +70,7 @@ if(UNIX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -O2 -fPIC") elseif(MSVC) # Skip warning for invalid conversion from size_t to uint32_t for all targets below for now - add_compile_options("/wd4267" "/utf-8") + add_compile_options("${COMPILE_OPTIONS}" "/wd4267" "/utf-8") elseif(WIN32) add_compile_definitions(_CRT_SECURE_NO_WARNINGS) endif() From ab39754597b4576c174d5093685d3f361fb6028a Mon Sep 17 00:00:00 2001 From: jadebenn Date: Tue, 30 Jan 2024 20:34:41 -0600 Subject: [PATCH 07/74] testing if these even have any effect --- CMakeLists.txt | 2 +- CMakePresets.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 24c71da7d..1b6a775e5 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,7 +70,7 @@ if(UNIX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -O2 -fPIC") elseif(MSVC) # Skip warning for invalid conversion from size_t to uint32_t for all targets below for now - add_compile_options("${COMPILE_OPTIONS}" "/wd4267" "/utf-8") + add_compile_options("/wd4267" "/utf-8") elseif(WIN32) add_compile_definitions(_CRT_SECURE_NO_WARNINGS) endif() diff --git a/CMakePresets.json b/CMakePresets.json index f4163dc24..a29989792 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -36,7 +36,7 @@ }, "cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo", - "COMPILE_OPTIONS": "/permissive-;/Zc:inline" + "COMPILE_OPTIONS": "/W3;/permissive-;/Zc:inline" } }, { From 119937f5d980a702d1fc47531de330332830688d Mon Sep 17 00:00:00 2001 From: jadebenn Date: Tue, 30 Jan 2024 20:34:44 -0600 Subject: [PATCH 08/74] ditto --- CMakePresets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakePresets.json b/CMakePresets.json index a29989792..c8c69ec3b 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -36,7 +36,7 @@ }, "cacheVariables": { "CMAKE_BUILD_TYPE": "RelWithDebInfo", - "COMPILE_OPTIONS": "/W3;/permissive-;/Zc:inline" + "COMPILE_OPTIONS": "/W3;/WX;/permissive-;/Zc:inline" } }, { From ae2115c68d18b2b12bf4435764248a2bba2f7d68 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Tue, 30 Jan 2024 20:52:33 -0600 Subject: [PATCH 09/74] final(?) try for now --- CMakeLists.txt | 2 +- CMakePresets.json | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1b6a775e5..ae3dada69 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,7 +70,7 @@ if(UNIX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -O2 -fPIC") elseif(MSVC) # Skip warning for invalid conversion from size_t to uint32_t for all targets below for now - add_compile_options("/wd4267" "/utf-8") + add_compile_options ("/permissive-;/Zc:inline;/wd4267;/utf-8") elseif(WIN32) add_compile_definitions(_CRT_SECURE_NO_WARNINGS) endif() diff --git a/CMakePresets.json b/CMakePresets.json index c8c69ec3b..a0a7cb8dd 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -35,8 +35,7 @@ "value": "x64" }, "cacheVariables": { - "CMAKE_BUILD_TYPE": "RelWithDebInfo", - "COMPILE_OPTIONS": "/W3;/WX;/permissive-;/Zc:inline" + "CMAKE_BUILD_TYPE": "RelWithDebInfo" } }, { From 3fa80063e926fa70222f23f9b00860ff7a31026b Mon Sep 17 00:00:00 2001 From: jadebenn Date: Tue, 30 Jan 2024 21:13:47 -0600 Subject: [PATCH 10/74] ONE MORE TIME --- CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index ae3dada69..fd672209a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,7 +70,8 @@ if(UNIX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -O2 -fPIC") elseif(MSVC) # Skip warning for invalid conversion from size_t to uint32_t for all targets below for now - add_compile_options ("/permissive-;/Zc:inline;/wd4267;/utf-8") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /permissive- /Zc:inline") + add_compile_options ("/wd4267" "/utf-8") elseif(WIN32) add_compile_definitions(_CRT_SECURE_NO_WARNINGS) endif() From 4b7d1d65937d6261fe505950b055a8e03577a087 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Tue, 30 Jan 2024 21:49:24 -0600 Subject: [PATCH 11/74] trying 'init' flags instead --- CMakeLists.txt | 2 +- CMakePresets.json | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fd672209a..b06162f97 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -70,7 +70,7 @@ if(UNIX) set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -O2 -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} /permissive- /Zc:inline") + 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 a0a7cb8dd..e15d4a7d8 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -35,7 +35,8 @@ "value": "x64" }, "cacheVariables": { - "CMAKE_BUILD_TYPE": "RelWithDebInfo" + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_CXX_FLAGS_INIT": "/W3 /Zc:inline" } }, { @@ -63,7 +64,7 @@ "configurePreset": "ci-windows-2022", "displayName": "Windows CI Build", "description": "This preset is used by the CI build on windows", - "configuration": "RelWithDebInfo", + "configuration": "Release", "jobs": 2 }, { From 962763916d301cee21fa675d6743ced871c53fa1 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Tue, 30 Jan 2024 22:00:49 -0600 Subject: [PATCH 12/74] export the compile commands so I can see if they're having any effect --- CMakePresets.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakePresets.json b/CMakePresets.json index e15d4a7d8..f4b173afc 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -36,7 +36,8 @@ }, "cacheVariables": { "CMAKE_BUILD_TYPE": "Release", - "CMAKE_CXX_FLAGS_INIT": "/W3 /Zc:inline" + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", + "CMAKE_CXX_FLAGS_INIT": "/O2 /Zc:inline" } }, { From 7c9f56ff76bed9d33d577d78b9dc8060b3ac373a Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 3 Feb 2024 16:02:53 -0600 Subject: [PATCH 13/74] move out g++ O2 flag --- CMakeLists.txt | 4 ++-- CMakePresets.json | 7 ++++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b06162f97..fab064d1d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,7 @@ set(RECASTNAVIGATION_EXAMPLES OFF CACHE BOOL "" FORCE) # Disabled no-register # Disabled unknown pragmas because Linux doesn't understand Windows pragmas. if(UNIX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O2 -Wuninitialized -fPIC") + 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) @@ -67,7 +67,7 @@ if(UNIX) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb") endif() - set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -O2 -fPIC") + 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}") diff --git a/CMakePresets.json b/CMakePresets.json index f4b173afc..433d77faf 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -17,7 +17,12 @@ "name": "ci-ubuntu-22.04", "displayName": "CI configure step for Ubuntu", "description": "Same as default, Used in GitHub actions workflow", - "inherits": "default" + "inherits": "default", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release", + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", + "CMAKE_CXX_FLAGS_INIT": "-O2" + } }, { "name": "ci-macos-13", From d5089b72cc667bb8ba47b370ef5b33589ae856fa Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sun, 4 Feb 2024 16:26:38 -0600 Subject: [PATCH 14/74] add Linux debug preset --- CMakePresets.json | 82 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 58 insertions(+), 24 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 433d77faf..3191abb64 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -18,10 +18,21 @@ "displayName": "CI configure step for Ubuntu", "description": "Same as default, Used in GitHub actions workflow", "inherits": "default", - "cacheVariables": { + "cacheVariables": { "CMAKE_BUILD_TYPE": "Release", + "CMAKE_EXPORT_COMPILE_COMMANDS": "ON" + } + }, + { + "name": "debug-ubuntu-22.04", + "displayName": "Debug configure step for Ubuntu", + "description": "Used to generate debug configuration for Ubuntu", + "inherits": "default", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug", "CMAKE_EXPORT_COMPILE_COMMANDS": "ON", - "CMAKE_CXX_FLAGS_INIT": "-O2" + "CMAKE_CXX_FLAGS_INIT" : "-Og", + "CMAKE_C_FLAGS_INIT" : "-Og" } }, { @@ -65,6 +76,22 @@ "description": "Default Build", "jobs": 2 }, + { + "name": "ci-ubuntu-22.04", + "configurePreset": "ci-ubuntu-22.04", + "displayName": "Linux CI Build", + "description": "This preset is used by the CI build on linux", + "configuration": "Release", + "jobs": 2 + }, + { + "name": "debug-ubuntu-22.04", + "configurePreset": "debug-ubuntu-22.04", + "displayName": "Linux Debug Build ", + "description": "This preset is used to debug the build on linux", + "configuration": "Debug", + "jobs": 2 + }, { "name": "ci-windows-2022", "configurePreset": "ci-windows-2022", @@ -73,13 +100,6 @@ "configuration": "Release", "jobs": 2 }, - { - "name": "ci-ubuntu-22.04", - "configurePreset": "ci-ubuntu-22.04", - "displayName": "Linux CI Build", - "description": "This preset is used by the CI build on linux", - "jobs": 2 - }, { "name": "ci-macos-13", "configurePreset": "ci-macos-13", @@ -94,9 +114,23 @@ "configurePreset": "ci-ubuntu-22.04", "displayName": "CI Tests on Linux", "description": "Runs all tests on a linux configuration", - "execution": { - "jobs": 2 - }, + "configuration": "Release", + "execution": { + "jobs": 2 + }, + "output": { + "outputOnFailure": true + } + }, + { + "name": "debug-ubuntu-22.04", + "configurePreset": "debug-ubuntu-22.04", + "displayName": "Debug Tests on Linux", + "description": "Runs all tests on a linux configuration", + "configuration": "Debug", + "execution": { + "jobs": 2 + }, "output": { "outputOnFailure": true } @@ -106,9 +140,9 @@ "configurePreset": "ci-macos-13", "displayName": "CI Tests on MacOS", "description": "Runs all tests on a Mac configuration", - "execution": { - "jobs": 2 - }, + "execution": { + "jobs": 2 + }, "output": { "outputOnFailure": true } @@ -118,18 +152,18 @@ "configurePreset": "ci-windows-2022", "displayName": "CI Tests on windows", "description": "Runs all tests on a windows configuration", - "configuration": "RelWithDebInfo", - "execution": { - "jobs": 2 - }, + "configuration": "RelWithDebInfo", + "execution": { + "jobs": 2 + }, "output": { "outputOnFailure": true }, - "filter": { - "exclude": { - "name": "((example)|(minigzip))+" - } - } + "filter": { + "exclude": { + "name": "((example)|(minigzip))+" + } + } } ] } From bba825f0c8622e8023f5e0e531c30b0c38d15da1 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Wed, 3 Apr 2024 19:48:20 -0500 Subject: [PATCH 15/74] 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 d08c60ca8..63389b43b 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 3191abb64..3ae4f80bb 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": [ From 005d439a4a13728b52712aadfd3a41a4ce365877 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Wed, 3 Apr 2024 19:58:44 -0500 Subject: [PATCH 16/74] edit macos presets --- CMakePresets.json | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 3ae4f80bb..a5aca9131 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -37,19 +37,13 @@ "name": "ci-macos-13", "displayName": "CI configure step for MacOS", "description": "Same as default, Used in GitHub actions workflow", - "inherits": "default", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release" - } + "inherits": "default" }, { "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" - } + "inherits": "default" }, { "name": "ci-windows-2022", From a3d70197f2c7d79cee190aca382c915a1dd04ff9 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Wed, 3 Apr 2024 20:13:37 -0500 Subject: [PATCH 17/74] try adding build types back to mac --- .github/workflows/build-and-test.yml | 4 ++-- CMakeLists.txt | 2 +- CMakePresets.json | 14 +++++++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 6211ece7b..fc44885d9 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -2,9 +2,9 @@ name: CI on: push: - branches: [ main, MSVCCompilerFlags ] + branches: [ main ] pull_request: - branches: [ main, MSVCCompilerFlags ] + branches: [ main ] jobs: build-and-test: diff --git a/CMakeLists.txt b/CMakeLists.txt index 63389b43b..6734db71d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,7 +74,7 @@ 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 - add_compile_options ("/wd4267" "/utf-8") + add_compile_options("/wd4267" "/utf-8") elseif(WIN32) add_compile_definitions(_CRT_SECURE_NO_WARNINGS) endif() diff --git a/CMakePresets.json b/CMakePresets.json index a5aca9131..26028759a 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -37,13 +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" + "inherits": "default", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } }, { "name": "ci-windows-2022", @@ -129,6 +135,7 @@ "configurePreset": "ci-macos-13", "displayName": "MacOS CI Build", "description": "This preset is used by the CI build on MacOS", + "configuration": "Release", "jobs": 2 }, { @@ -136,6 +143,7 @@ "configurePreset": "debug-macos-13", "displayName": "MacOS Debug Build", "description": "This preset is used to debug the build on MacOS", + "configuration": "Debug", "jobs": 2 } ], @@ -183,7 +191,7 @@ "configurePreset": "ci-windows-2022", "displayName": "CI Tests on windows", "description": "Runs all tests on a windows configuration", - "configuration": "RelWithDebInfo", + "configuration": "Release", "execution": { "jobs": 2 }, From 81e5f059d53575593a06291a580eec6da0de55fc Mon Sep 17 00:00:00 2001 From: jadebenn Date: Wed, 3 Apr 2024 20:20:31 -0500 Subject: [PATCH 18/74] macos refuses to work :( --- CMakePresets.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 26028759a..8316a3fbe 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -135,7 +135,6 @@ "configurePreset": "ci-macos-13", "displayName": "MacOS CI Build", "description": "This preset is used by the CI build on MacOS", - "configuration": "Release", "jobs": 2 }, { @@ -143,7 +142,6 @@ "configurePreset": "debug-macos-13", "displayName": "MacOS Debug Build", "description": "This preset is used to debug the build on MacOS", - "configuration": "Debug", "jobs": 2 } ], From 018e5707d78a866ab78a2f087cc7c22c6c0d00ca Mon Sep 17 00:00:00 2001 From: jadebenn Date: Wed, 3 Apr 2024 20:30:33 -0500 Subject: [PATCH 19/74] try using compiler flags for mac instead --- CMakePresets.json | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 8316a3fbe..7fb1d3457 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -39,17 +39,15 @@ "description": "Same as default, Used in GitHub actions workflow", "inherits": "default", "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release" + "CMAKE_CXX_FLAGS_INIT" : "-O2", + "CMAKE_C_FLAGS_INIT" : "-O2" } }, { "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" - } + "inherits": "default" }, { "name": "ci-windows-2022", @@ -75,7 +73,7 @@ "value": "x64" }, "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug" + "CMAKE_CXX_FLAGS_INIT": "Debug" } }, { From 661e0939b7e5f80c44a2ed08293e3c558738dbfc Mon Sep 17 00:00:00 2001 From: jadebenn Date: Wed, 3 Apr 2024 22:13:11 -0500 Subject: [PATCH 20/74] fix typo in windows preset --- CMakePresets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakePresets.json b/CMakePresets.json index 7fb1d3457..82c5a6c11 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -73,7 +73,7 @@ "value": "x64" }, "cacheVariables": { - "CMAKE_CXX_FLAGS_INIT": "Debug" + "CMAKE_BUILD_TYPE": "Debug" } }, { From 145f97cfdcfc7f5229342e926a29960bdefe6d51 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Fri, 5 Apr 2024 16:50:39 -0500 Subject: [PATCH 21/74] build reorganization and experimental clang support --- .github/workflows/build-and-test.yml | 4 +- CMakePresets.json | 414 +++++++++++++++------------ dCommon/GeneralUtils.cpp | 2 +- thirdparty/CMakeLists.txt | 5 + 4 files changed, 234 insertions(+), 191 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index fc44885d9..3e45273d1 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -33,9 +33,7 @@ jobs: - name: cmake uses: lukka/run-cmake@v10 with: - configurePreset: "ci-${{matrix.os}}" - buildPreset: "ci-${{matrix.os}}" - testPreset: "ci-${{matrix.os}}" + workflowPreset: "ci-${{matrix.os}}" - name: artifacts uses: actions/upload-artifact@v3 with: diff --git a/CMakePresets.json b/CMakePresets.json index 7fb1d3457..084c43347 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,204 +1,244 @@ { - "version": 3, - "cmakeMinimumRequired": { - "major": 3, - "minor": 14, - "patch": 0 + "version": 6, + "cmakeMinimumRequired": { + "major": 3, + "minor": 25, + "patch": 0 + }, + "configurePresets": [ + { + "name": "default", + "displayName": "Default configure step", + "description": "Use 'build' dir and Unix makefiles", + "binaryDir": "${sourceDir}/build", + "generator": "Unix Makefiles" }, - "configurePresets": [ - { - "name": "default", - "displayName": "Default configure step", - "description": "Use 'build' dir and Unix makefiles", - "binaryDir": "${sourceDir}/build", - "generator": "Unix Makefiles" - }, - { - "name": "ci-ubuntu-22.04", - "displayName": "CI configure step for Ubuntu", - "description": "Same as default, Used in GitHub actions workflow", - "inherits": "default", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release" - } - }, - { - "name": "debug-ubuntu-22.04", - "displayName": "Debug configure step for Ubuntu", - "description": "Used to generate debug configuration for Ubuntu", - "inherits": "default", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug", - "CMAKE_CXX_FLAGS_INIT" : "-Og", - "CMAKE_C_FLAGS_INIT" : "-Og" - } - }, - { - "name": "ci-macos-13", - "displayName": "CI configure step for MacOS", - "description": "Same as default, Used in GitHub actions workflow", - "inherits": "default", - "cacheVariables": { - "CMAKE_CXX_FLAGS_INIT" : "-O2", - "CMAKE_C_FLAGS_INIT" : "-O2" - } - }, - { - "name": "debug-macos-13", - "displayName": "Debug configure step for MacOS", - "description": "Used to generate debug configuration for MacOS", - "inherits": "default" - }, - { - "name": "ci-windows-2022", - "displayName": "CI 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": "Release", - "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_CXX_FLAGS_INIT": "Debug" - } - }, - { - "name": "windows-default", - "inherits": "ci-windows-2022", - "displayName": "Windows only Configure Settings", - "description": "Sets build and install directories", - "generator": "Ninja", - "architecture": { - "value": "x64", - "strategy": "external" - } + { + "name": "ci-windows-2022", + "displayName": "CI configure step for Windows", + "description": "Set architecture to 64-bit (b/c RakNet)", + "inherits": "default", + "generator": "Visual Studio 17 2022", + "architecture": { + "value": "x64" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + }, + "cacheVariables": { + "CMAKE_CXX_FLAGS_INIT": "/Zc:inline" } - ], - "buildPresets": [ - { - "name": "default", - "configurePreset": "default", - "displayName": "Default Build", - "description": "Default Build", - "jobs": 2 - }, - { - "name": "ci-ubuntu-22.04", - "configurePreset": "ci-ubuntu-22.04", - "displayName": "Linux CI Build", - "description": "This preset is used by the CI build on linux", - "configuration": "Release", - "jobs": 2 - }, - { - "name": "debug-ubuntu-22.04", - "configurePreset": "debug-ubuntu-22.04", - "displayName": "Linux Debug Build ", - "description": "This preset is used to debug the build on linux", - "configuration": "Debug", - "jobs": 2 - }, - { - "name": "ci-windows-2022", - "configurePreset": "ci-windows-2022", - "displayName": "Windows CI Build", - "description": "This preset is used by the CI build on windows", - "configuration": "Release", + }, + { + "name": "windows-default", + "inherits": "ci-windows-2022", + "displayName": "Windows only Configure Settings", + "description": "Sets build and install directories", + "generator": "Ninja", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + }, + "architecture": { + "value": "x64", + "strategy": "external" + } + }, + { + "name": "linux-base", + "displayName": "x86_64-pc-linux-gnu", + "description": "Linux base configuration", + "hidden": true, + "binaryDir": "${sourceDir}/build", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + } + }, + { + "name": "linux-clang-debug", + "inherits": "linux-base", + "displayName": "[Debug] Linux (Clang)", + "description": "Create a debug build using the Clang toolchain for Linux", + "binaryDir": "${sourceDir}/build", + "toolchainFile": "${sourceDir}/cmake/toolchains/linux-clang.cmake", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "linux-clang-release", + "inherits": "linux-clang-debug", + "displayName": "[Release] Linux (Clang)", + "description": "Create a release build using the Clang toolchain for Linux", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, + { + "name": "linux-gcc-debug", + "displayName": "[Debug] Linux (GCC)", + "description": "Create a debug build using the GNU toolchain for Linux", + "binaryDir": "${sourceDir}/build", + "toolchainFile": "${sourceDir}/cmake/toolchains/linux-gcc.cmake", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "linux-gcc-release", + "inherits": "linux-gcc-debug", + "displayName": "[Release] Linux (GCC)", + "description": "Create a release build using the GNU toolchain for Linux", + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, + { + "name": "macos-appleclang-debug", + "displayName": "[Debug] MacOS (AppleClang)", + "description": "Same as default, Used in GitHub actions workflow", + "inherits": "default", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "macos-appleclang-release", + "displayName": "[Release] MacOS (AppleClang)", + "description": "Same as default, Used in GitHub actions workflow", + "inherits": "default", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + } + ], + "buildPresets": [ + { + "name": "default", + "configurePreset": "default", + "displayName": "Default Build", + "description": "Default Build", + "jobs": 2 + }, + { + "name": "ci-windows-2022", + "configurePreset": "ci-windows-2022", + "displayName": "Windows CI Build", + "description": "This preset is used by the CI build on windows", + "configuration": "Release", + "jobs": 2 + }, + { + "name": "debug-windows-2022", + "configurePreset": "ci-windows-2022", + "displayName": "Windows Debug Build", + "description": "This preset is used to debug the build on windows", + "configuration": "Release", + "jobs": 2 + } + ], + "testPresets": [ + { + "name": "default", + "configurePreset": "default", + "execution": { "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", + "output": { + "outputOnFailure": true + } + }, + { + "name": "ci-windows-2022", + "configurePreset": "ci-windows-2022", + "displayName": "CI Tests on windows", + "description": "Runs all tests on a windows configuration", + "configuration": "Release", + "execution": { "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 + "output": { + "outputOnFailure": true }, - { - "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 + "filter": { + "exclude": { + "name": "((example)|(minigzip))+" + } } - ], - "testPresets": [ - { - "name": "ci-ubuntu-22.04", - "configurePreset": "ci-ubuntu-22.04", - "displayName": "CI Tests on Linux", - "description": "Runs all tests on a linux configuration", - "configuration": "Release", - "execution": { - "jobs": 2 + } + ], + "workflowPresets": [ + { + "name": "ci-windows-2022", + "displayName": "Windows CI Workflow", + "description": "CI workflow preset for Windows", + "steps": [ + { + "type": "configure", + "name": "ci-windows-2022" }, - "output": { - "outputOnFailure": true - } - }, - { - "name": "debug-ubuntu-22.04", - "configurePreset": "debug-ubuntu-22.04", - "displayName": "Debug Tests on Linux", - "description": "Runs all tests on a linux configuration", - "configuration": "Debug", - "execution": { - "jobs": 2 + { + "type": "build", + "name": "default" }, - "output": { - "outputOnFailure": true + { + "type": "test", + "name": "default" } - }, - { - "name": "ci-macos-13", - "configurePreset": "ci-macos-13", - "displayName": "CI Tests on MacOS", - "description": "Runs all tests on a Mac configuration", - "execution": { - "jobs": 2 + ] + }, + { + "name": "ci-ubuntu-22.04", + "displayName": "Ubuntu CI Workflow", + "description": "CI workflow preset for Ubuntu", + "steps": [ + { + "type": "configure", + "name": "linux-gcc-release" + }, + { + "type": "build", + "name": "default" }, - "output": { - "outputOnFailure": true + { + "type": "test", + "name": "default" } - }, - { - "name": "ci-windows-2022", - "configurePreset": "ci-windows-2022", - "displayName": "CI Tests on windows", - "description": "Runs all tests on a windows configuration", - "configuration": "Release", - "execution": { - "jobs": 2 + ] + }, + { + "name": "ci-macos-13", + "displayName": "MacOS CI Workflow", + "description": "CI workflow preset for MacOS", + "steps": [ + { + "type": "configure", + "name": "macos-appleclang-release" }, - "output": { - "outputOnFailure": true + { + "type": "build", + "name": "default" }, - "filter": { - "exclude": { - "name": "((example)|(minigzip))+" - } + { + "type": "test", + "name": "default" } - } - ] - } + ] + } + ] +} diff --git a/dCommon/GeneralUtils.cpp b/dCommon/GeneralUtils.cpp index 27ebfb2c6..159cc127a 100644 --- a/dCommon/GeneralUtils.cpp +++ b/dCommon/GeneralUtils.cpp @@ -320,7 +320,7 @@ std::vector GeneralUtils::GetSqlFileNamesFromFolder(const std::stri return sortedFiles; } -#ifdef DARKFLAME_PLATFORM_MACOS +#if !(__GNUC__ >= 11 || _MSC_VER >= 1924) // MacOS floating-point parse function specializations namespace GeneralUtils::details { diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 41135a807..9ce7f5a16 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -23,6 +23,11 @@ if(NOT WIN32) target_include_directories(bcrypt PRIVATE "libbcrypt/include/bcrypt") endif() +# Need to define this on Clang (Linux) for 'strdup' support +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") + target_compile_definitions(bcrypt PRIVATE "_POSIX_C_SOURCE=200809L") +endif() + target_include_directories(bcrypt INTERFACE "libbcrypt/include") target_include_directories(bcrypt PRIVATE "libbcrypt/src") From db5c10c331491c1e4866652603107b21701b3d0c Mon Sep 17 00:00:00 2001 From: jadebenn Date: Fri, 5 Apr 2024 16:58:00 -0500 Subject: [PATCH 22/74] temporarily remove macos build for testing purposes --- CMakePresets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakePresets.json b/CMakePresets.json index 084c43347..66d7850f8 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -228,7 +228,7 @@ "steps": [ { "type": "configure", - "name": "macos-appleclang-release" + "name": "default" }, { "type": "build", From 9ce7d9043c5159998620b9f9d731ca6f61aae0d7 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Fri, 5 Apr 2024 17:55:02 -0500 Subject: [PATCH 23/74] updated cmake workflows --- CMakePresets.json | 261 ++++++++++++++++++++++++++++++++++------------ 1 file changed, 192 insertions(+), 69 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 66d7850f8..be4a4295d 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,8 +1,8 @@ { - "version": 6, + "version": 7, "cmakeMinimumRequired": { "major": 3, - "minor": 25, + "minor": 27, "patch": 0 }, "configurePresets": [ @@ -13,6 +13,30 @@ "binaryDir": "${sourceDir}/build", "generator": "Unix Makefiles" }, + { + "name": "debug-base", + "hidden": true, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "release-base", + "hidden": true, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, + { + "name": "clang-base", + "hidden": true, + "toolchainFile": "${sourceDir}/cmake/toolchains/linux-clang.cmake" + }, + { + "name": "gcc-base", + "hidden": true, + "toolchainFile": "${sourceDir}/cmake/toolchains/linux-gcc.cmake" + }, { "name": "ci-windows-2022", "displayName": "CI configure step for Windows", @@ -49,82 +73,79 @@ }, { "name": "linux-base", - "displayName": "x86_64-pc-linux-gnu", - "description": "Linux base configuration", "hidden": true, - "binaryDir": "${sourceDir}/build", "condition": { "type": "equals", "lhs": "${hostSystemName}", "rhs": "Linux" } }, + { + "name": "macos-base", + "hidden": true, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + } + }, { "name": "linux-clang-debug", - "inherits": "linux-base", + "inherits": [ + "linux-base", + "clang-base", + "debug-base" + ], "displayName": "[Debug] Linux (Clang)", - "description": "Create a debug build using the Clang toolchain for Linux", - "binaryDir": "${sourceDir}/build", - "toolchainFile": "${sourceDir}/cmake/toolchains/linux-clang.cmake", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug" - } + "description": "Create a debug build using the Clang toolchain for Linux" }, { "name": "linux-clang-release", - "inherits": "linux-clang-debug", + "inherits": [ + "linux-base", + "clang-base", + "release-base" + ], "displayName": "[Release] Linux (Clang)", - "description": "Create a release build using the Clang toolchain for Linux", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release" - } + "description": "Create a release build using the Clang toolchain for Linux" }, { "name": "linux-gcc-debug", + "inherits": [ + "linux-base", + "gcc-base", + "debug-base" + ], "displayName": "[Debug] Linux (GCC)", - "description": "Create a debug build using the GNU toolchain for Linux", - "binaryDir": "${sourceDir}/build", - "toolchainFile": "${sourceDir}/cmake/toolchains/linux-gcc.cmake", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug" - } + "description": "Create a debug build using the GNU toolchain for Linux" }, { "name": "linux-gcc-release", - "inherits": "linux-gcc-debug", + "inherits": [ + "linux-base", + "gcc-base", + "release-base" + ], "displayName": "[Release] Linux (GCC)", - "description": "Create a release build using the GNU toolchain for Linux", - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release" - } + "description": "Create a release build using the GNU toolchain for Linux" }, { - "name": "macos-appleclang-debug", - "displayName": "[Debug] MacOS (AppleClang)", - "description": "Same as default, Used in GitHub actions workflow", - "inherits": "default", - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Darwin" - }, - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug" - } + "name": "macos-debug", + "inherits": [ + "macos-base", + "release-base" + ], + "displayName": "[Debug] MacOS", + "description": "Create a debug build using MacOS" }, { - "name": "macos-appleclang-release", - "displayName": "[Release] MacOS (AppleClang)", - "description": "Same as default, Used in GitHub actions workflow", - "inherits": "default", - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Darwin" - }, - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release" - } + "name": "macos-release", + "inherits": [ + "macos-base", + "release-base" + ], + "displayName": "[Release] MacOS", + "description": "Create a release build using MacOS" } ], "buildPresets": [ @@ -144,10 +165,50 @@ "jobs": 2 }, { - "name": "debug-windows-2022", - "configurePreset": "ci-windows-2022", - "displayName": "Windows Debug Build", - "description": "This preset is used to debug the build on windows", + "name": "linux-clang-debug", + "configurePreset": "linux-clang-debug", + "displayName": "[Debug] Linux (Clang)", + "description": "This preset is used to build in debug mode using the Clang toolchain on Linux", + "configuration": "Debug", + "jobs": 2 + }, + { + "name": "linux-clang-release", + "configurePreset": "linux-clang-release", + "displayName": "[Release] Linux (Clang)", + "description": "This preset is used to build in release mode using the Clang toolchain on Linux", + "configuration": "Release", + "jobs": 2 + }, + { + "name": "linux-gcc-debug", + "configurePreset": "linux-gcc-debug", + "displayName": "[Debug] Linux (GCC)", + "description": "This preset is used to build in debug mode using the GCC toolchain on Linux", + "configuration": "Debug", + "jobs": 2 + }, + { + "name": "linux-gcc-release", + "configurePreset": "linux-gcc-release", + "displayName": "[Release] Linux (GCC)", + "description": "This preset is used to build in release mode using the GCC toolchain on Linux", + "configuration": "Release", + "jobs": 2 + }, + { + "name": "macos-debug", + "configurePreset": "macos-debug", + "displayName": "[Debug] MacOS", + "description": "This preset is used to build in debug mode on MacOS", + "configuration": "Debug", + "jobs": 2 + }, + { + "name": "macos-release", + "configurePreset": "macos-release", + "displayName": "[Release] MacOS", + "description": "This preset is used to build in release mode on MacOS", "configuration": "Release", "jobs": 2 } @@ -165,21 +226,64 @@ }, { "name": "ci-windows-2022", + "inherits": "default", "configurePreset": "ci-windows-2022", "displayName": "CI Tests on windows", "description": "Runs all tests on a windows configuration", "configuration": "Release", - "execution": { - "jobs": 2 - }, - "output": { - "outputOnFailure": true - }, "filter": { "exclude": { "name": "((example)|(minigzip))+" } } + }, + { + "name": "linux-clang-debug", + "inherits": "default", + "configurePreset": "linux-clang-debug", + "displayName": "[Debug] Linux (Clang)", + "description": "Runs all tests on a Linux Clang configuration", + "configuration": "Release" + }, + { + "name": "linux-clang-release", + "inherits": "default", + "configurePreset": "linux-clang-release", + "displayName": "[Release] Linux (Clang)", + "description": "Runs all tests on a Linux Clang configuration", + "configuration": "Release" + }, + { + "name": "linux-gcc-debug", + "inherits": "default", + "configurePreset": "linux-gcc-debug", + "displayName": "[Debug] Linux (GCC)", + "description": "Runs all tests on a Linux GCC configuration", + "configuration": "Release" + }, + { + "name": "linux-gcc-release", + "inherits": "default", + "configurePreset": "linux-gcc-release", + "displayName": "[Release] Linux (GCC)", + "description": "Runs all tests on a Linux GCC configuration", + "configuration": "Release" + }, + { + "name": "macos-debug", + "inherits": "default", + "configurePreset": "macos-debug", + "displayName": "[Debug] MacOS", + "description": "Runs all tests on a MacOS configuration", + "configuration": "Release" + }, + { + "name": "macos-release", + "inherits": "default", + "configurePreset": "macos-release", + "displayName": "[Release] MacOS", + "description": "Runs all tests on a MacOS configuration", + "configuration": "Release" } ], "workflowPresets": [ @@ -194,11 +298,11 @@ }, { "type": "build", - "name": "default" + "name": "ci-windows-2022" }, { "type": "test", - "name": "default" + "name": "ci-windows-2022" } ] }, @@ -213,11 +317,30 @@ }, { "type": "build", - "name": "default" + "name": "linux-gcc-release" + }, + { + "type": "test", + "name": "linux-gcc-release" + } + ] + }, + { + "name": "linux-clang-release", + "displayName": "Build using Clang on Linux", + "description": "Clang workflow preset for Linux", + "steps": [ + { + "type": "configure", + "name": "linux-clang-release" + }, + { + "type": "build", + "name": "linux-clang-release" }, { "type": "test", - "name": "default" + "name": "linux-clang-release" } ] }, @@ -228,15 +351,15 @@ "steps": [ { "type": "configure", - "name": "default" + "name": "macos-release" }, { "type": "build", - "name": "default" + "name": "macos-release" }, { "type": "test", - "name": "default" + "name": "macos-release" } ] } From 426d34a0aa2ef9ef9c520facfe0e0ef816d58a77 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Fri, 5 Apr 2024 17:58:19 -0500 Subject: [PATCH 24/74] unexclude toolchain dir --- .gitignore | 2 +- CMakePresets.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 12a3b284f..9cb5f02e8 100644 --- a/.gitignore +++ b/.gitignore @@ -122,4 +122,4 @@ docker/__pycache__ docker-compose.override.yml !*Test.bin -!cmake/* +# !cmake/* Why was this directory excluded? diff --git a/CMakePresets.json b/CMakePresets.json index be4a4295d..884c39257 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,8 +1,8 @@ { - "version": 7, + "version": 6, "cmakeMinimumRequired": { "major": 3, - "minor": 27, + "minor": 25, "patch": 0 }, "configurePresets": [ From a19afaaab0fc0fb3efae7d1e6d9caf167ef278da Mon Sep 17 00:00:00 2001 From: jadebenn Date: Fri, 5 Apr 2024 18:06:37 -0500 Subject: [PATCH 25/74] update .gitignore --- .gitignore | 5 ++++- cmake/toolchains/linux-clang.cmake | 14 ++++++++++++++ cmake/toolchains/linux-gcc.cmake | 11 +++++++++++ 3 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 cmake/toolchains/linux-clang.cmake create mode 100644 cmake/toolchains/linux-gcc.cmake diff --git a/.gitignore b/.gitignore index 9cb5f02e8..0b0d2ecf7 100644 --- a/.gitignore +++ b/.gitignore @@ -122,4 +122,7 @@ docker/__pycache__ docker-compose.override.yml !*Test.bin -# !cmake/* Why was this directory excluded? + +# CMake scripts +!cmake/* +!cmake/toolchains/* diff --git a/cmake/toolchains/linux-clang.cmake b/cmake/toolchains/linux-clang.cmake new file mode 100644 index 000000000..abcd681c3 --- /dev/null +++ b/cmake/toolchains/linux-clang.cmake @@ -0,0 +1,14 @@ +# Try and find a clang-16 install, falling back to a generic clang install otherwise +find_program(CLANG_C_COMPILER clang-16 | clang REQUIRED) +find_program(CLANG_CXX_COMPILER clang++-16 | clang++ REQUIRED) + +# Debug messages +message("CLANG_C_COMPILER = ${CLANG_C_COMPILER}") +message("CLANG_CXX_COMPILER = ${CLANG_CXX_COMPILER}") + +# Set compilers to clang +set(CMAKE_C_COMPILER ${CLANG_C_COMPILER}) +set(CMAKE_CXX_COMPILER ${CLANG_CXX_COMPILER}) + +# Set linker to lld +add_link_options("-fuse-ld=lld") diff --git a/cmake/toolchains/linux-gcc.cmake b/cmake/toolchains/linux-gcc.cmake new file mode 100644 index 000000000..c4e0891b3 --- /dev/null +++ b/cmake/toolchains/linux-gcc.cmake @@ -0,0 +1,11 @@ +# Try and find a gcc/g++ install, falling back to a generic clang install otherwise +find_program(GNU_C_COMPILER gcc REQUIRED) +find_program(GNU_CXX_COMPILER g++ REQUIRED) + +# Debug messages +message("GNU_C_COMPILER = ${GNU_C_COMPILER}") +message("GNU_CXX_COMPILER = ${GNU_C_COMPILER}") + +# Set compilers to clang +set(CMAKE_C_COMPILER ${GNU_C_COMPILER}) +set(CMAKE_CXX_COMPILER ${GNU_CXX_COMPILER}) From 9fc6b4e97330c054409d3211fba92de2e0ea7f2a Mon Sep 17 00:00:00 2001 From: jadebenn Date: Fri, 5 Apr 2024 18:10:09 -0500 Subject: [PATCH 26/74] fix build directory issue --- CMakePresets.json | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CMakePresets.json b/CMakePresets.json index 884c39257..be4d684fe 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -73,6 +73,7 @@ }, { "name": "linux-base", + "inherits": "default", "hidden": true, "condition": { "type": "equals", @@ -82,6 +83,7 @@ }, { "name": "macos-base", + "inherits": "default", "hidden": true, "condition": { "type": "equals", From 04a7bc2b8da3e59d8dc19855b654a6833a571614 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Fri, 5 Apr 2024 21:00:23 -0500 Subject: [PATCH 27/74] edit build script --- CMakePresets.json | 17 +++++++++++++++++ build.sh | 3 +-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index be4d684fe..8def32847 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -289,6 +289,23 @@ } ], "workflowPresets": [ + { + "name": "default", + "steps": [ + { + "type": "configure", + "name": "default" + }, + { + "type": "build", + "name": "default" + }, + { + "type": "test", + "name": "default" + } + ] + }, { "name": "ci-windows-2022", "displayName": "Windows CI Workflow", diff --git a/build.sh b/build.sh index b8d33492a..4b1e7df16 100755 --- a/build.sh +++ b/build.sh @@ -6,8 +6,7 @@ mkdir -p build cd build # Run cmake to generate make files -cmake .. +cmake .. -DCMAKE_BUILD_TYPE="Release" # To build utilizing multiple cores, append `-j` and the amount of cores to utilize, for example `cmake --build . --config Release -j8' cmake --build . --config Release $1 - From ef8029d46fa01a41470cad2135bd9543eea0530a Mon Sep 17 00:00:00 2001 From: jadebenn Date: Fri, 5 Apr 2024 23:30:26 -0500 Subject: [PATCH 28/74] update cmake configs --- CMakeLists.txt | 2 +- CMakePresets.json | 82 ++++++++++++++++++-------------- build.sh | 2 +- cmake/toolchains/linux-gcc.cmake | 2 +- 4 files changed, 48 insertions(+), 40 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6734db71d..538b44b5f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -74,7 +74,7 @@ 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 - add_compile_options("/wd4267" "/utf-8") + add_compile_options("/wd4267" "/utf-8" "/volatile:iso") elseif(WIN32) add_compile_definitions(_CRT_SECURE_NO_WARNINGS) endif() diff --git a/CMakePresets.json b/CMakePresets.json index 8def32847..e78505206 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -14,32 +14,32 @@ "generator": "Unix Makefiles" }, { - "name": "debug-base", + "name": "debug-config", "hidden": true, "cacheVariables": { "CMAKE_BUILD_TYPE": "Debug" } }, { - "name": "release-base", + "name": "release-config", "hidden": true, "cacheVariables": { "CMAKE_BUILD_TYPE": "Release" } }, { - "name": "clang-base", + "name": "clang-config", "hidden": true, "toolchainFile": "${sourceDir}/cmake/toolchains/linux-clang.cmake" }, { - "name": "gcc-base", + "name": "gcc-config", "hidden": true, "toolchainFile": "${sourceDir}/cmake/toolchains/linux-gcc.cmake" }, { - "name": "ci-windows-2022", - "displayName": "CI configure step for Windows", + "name": "windows-msvc", + "displayName": "[Multi] Windows (MSVC)", "description": "Set architecture to 64-bit (b/c RakNet)", "inherits": "default", "generator": "Visual Studio 17 2022", @@ -57,7 +57,7 @@ }, { "name": "windows-default", - "inherits": "ci-windows-2022", + "inherits": "windows-msvc", "displayName": "Windows only Configure Settings", "description": "Sets build and install directories", "generator": "Ninja", @@ -72,7 +72,7 @@ } }, { - "name": "linux-base", + "name": "linux-config", "inherits": "default", "hidden": true, "condition": { @@ -82,7 +82,7 @@ } }, { - "name": "macos-base", + "name": "macos-config", "inherits": "default", "hidden": true, "condition": { @@ -94,9 +94,9 @@ { "name": "linux-clang-debug", "inherits": [ - "linux-base", - "clang-base", - "debug-base" + "linux-config", + "clang-config", + "debug-config" ], "displayName": "[Debug] Linux (Clang)", "description": "Create a debug build using the Clang toolchain for Linux" @@ -104,9 +104,9 @@ { "name": "linux-clang-release", "inherits": [ - "linux-base", - "clang-base", - "release-base" + "linux-config", + "clang-config", + "release-config" ], "displayName": "[Release] Linux (Clang)", "description": "Create a release build using the Clang toolchain for Linux" @@ -114,9 +114,9 @@ { "name": "linux-gcc-debug", "inherits": [ - "linux-base", - "gcc-base", - "debug-base" + "linux-config", + "gcc-config", + "debug-config" ], "displayName": "[Debug] Linux (GCC)", "description": "Create a debug build using the GNU toolchain for Linux" @@ -124,9 +124,9 @@ { "name": "linux-gcc-release", "inherits": [ - "linux-base", - "gcc-base", - "release-base" + "linux-config", + "gcc-config", + "release-config" ], "displayName": "[Release] Linux (GCC)", "description": "Create a release build using the GNU toolchain for Linux" @@ -134,8 +134,8 @@ { "name": "macos-debug", "inherits": [ - "macos-base", - "release-base" + "macos-config", + "release-config" ], "displayName": "[Debug] MacOS", "description": "Create a debug build using MacOS" @@ -143,8 +143,8 @@ { "name": "macos-release", "inherits": [ - "macos-base", - "release-base" + "macos-config", + "release-config" ], "displayName": "[Release] MacOS", "description": "Create a release build using MacOS" @@ -159,13 +159,21 @@ "jobs": 2 }, { - "name": "ci-windows-2022", - "configurePreset": "ci-windows-2022", - "displayName": "Windows CI Build", - "description": "This preset is used by the CI build on windows", - "configuration": "Release", + "name": "windows-msvc-debug", + "configurePreset": "windows-msvc", + "displayName": "[Debug] Windows (MSVC)", + "description": "This preset is used to build in debug mode using the MSVC toolchain on Windows", + "configuration": "Debug", "jobs": 2 }, + { + "name": "windows-msvc-release", + "configurePreset": "windows-msvc", + "displayName": "[Release] Windows (MSVC)", + "description": "This preset is used to build in release mode using the MSVC toolchain on Windows", + "configuration": "Release", + "jobs": 2 + }, { "name": "linux-clang-debug", "configurePreset": "linux-clang-debug", @@ -227,11 +235,11 @@ } }, { - "name": "ci-windows-2022", + "name": "windows-msvc", "inherits": "default", - "configurePreset": "ci-windows-2022", - "displayName": "CI Tests on windows", - "description": "Runs all tests on a windows configuration", + "configurePreset": "windows-msvc", + "displayName": "[Multi] Windows (MSVC)", + "description": "Runs all tests on a Windows configuration", "configuration": "Release", "filter": { "exclude": { @@ -313,15 +321,15 @@ "steps": [ { "type": "configure", - "name": "ci-windows-2022" + "name": "windows-msvc" }, { "type": "build", - "name": "ci-windows-2022" + "name": "windows-msvc-release" }, { "type": "test", - "name": "ci-windows-2022" + "name": "windows-msvc" } ] }, diff --git a/build.sh b/build.sh index 4b1e7df16..3f36e8a3c 100755 --- a/build.sh +++ b/build.sh @@ -6,7 +6,7 @@ mkdir -p build cd build # Run cmake to generate make files -cmake .. -DCMAKE_BUILD_TYPE="Release" +cmake -DCMAKE_BUILD_TYPE="Release" .. # To build utilizing multiple cores, append `-j` and the amount of cores to utilize, for example `cmake --build . --config Release -j8' cmake --build . --config Release $1 diff --git a/cmake/toolchains/linux-gcc.cmake b/cmake/toolchains/linux-gcc.cmake index c4e0891b3..d55af82f7 100644 --- a/cmake/toolchains/linux-gcc.cmake +++ b/cmake/toolchains/linux-gcc.cmake @@ -1,4 +1,4 @@ -# Try and find a gcc/g++ install, falling back to a generic clang install otherwise +# Try and find a gcc/g++ install find_program(GNU_C_COMPILER gcc REQUIRED) find_program(GNU_CXX_COMPILER g++ REQUIRED) From 24cbd94a80ac8aac6a72c18b04c9b5bef374a505 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 02:34:36 -0500 Subject: [PATCH 29/74] attempted docker fix --- CMakePresets.json | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index e78505206..fe155b529 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -297,23 +297,6 @@ } ], "workflowPresets": [ - { - "name": "default", - "steps": [ - { - "type": "configure", - "name": "default" - }, - { - "type": "build", - "name": "default" - }, - { - "type": "test", - "name": "default" - } - ] - }, { "name": "ci-windows-2022", "displayName": "Windows CI Workflow", From d6031ce9f5d9686673ef1cf4b5629dfffc311d6d Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 03:04:52 -0500 Subject: [PATCH 30/74] try zero-initializinng this struct to solve docker issue --- CMakePresets.json | 17 +++++++++++++++++ dGame/dUtilities/VanityUtilities.cpp | 4 ++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index fe155b529..e78505206 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -297,6 +297,23 @@ } ], "workflowPresets": [ + { + "name": "default", + "steps": [ + { + "type": "configure", + "name": "default" + }, + { + "type": "build", + "name": "default" + }, + { + "type": "test", + "name": "default" + } + ] + }, { "name": "ci-windows-2022", "displayName": "Windows CI Workflow", diff --git a/dGame/dUtilities/VanityUtilities.cpp b/dGame/dUtilities/VanityUtilities.cpp index cb893da30..54daa4926 100644 --- a/dGame/dUtilities/VanityUtilities.cpp +++ b/dGame/dUtilities/VanityUtilities.cpp @@ -102,7 +102,7 @@ void VanityUtilities::SpawnVanity() { } LWOOBJID SpawnSpawner(const VanityObject& object, const VanityObjectLocation& location) { - SceneObject obj; + SceneObject obj {}; obj.lot = object.m_LOT; // guratantee we have no collisions do { @@ -268,7 +268,7 @@ void ParseXml(const std::string& file) { for (auto* location = locations->FirstChildElement("location"); location != nullptr; location = location->NextSiblingElement("location")) { - + // Get the location data auto zoneID = GeneralUtils::TryParse(location->Attribute("zone")); auto x = GeneralUtils::TryParse(location->Attribute("x")); From bc79a17ddb50df28148ca128eabe41c04ec40572 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 03:50:41 -0500 Subject: [PATCH 31/74] try fixing macos build --- CMakePresets.json | 2 -- dGame/dUtilities/VanityUtilities.cpp | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index e78505206..6736629ba 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -211,7 +211,6 @@ "configurePreset": "macos-debug", "displayName": "[Debug] MacOS", "description": "This preset is used to build in debug mode on MacOS", - "configuration": "Debug", "jobs": 2 }, { @@ -219,7 +218,6 @@ "configurePreset": "macos-release", "displayName": "[Release] MacOS", "description": "This preset is used to build in release mode on MacOS", - "configuration": "Release", "jobs": 2 } ], diff --git a/dGame/dUtilities/VanityUtilities.cpp b/dGame/dUtilities/VanityUtilities.cpp index 54daa4926..4f2887477 100644 --- a/dGame/dUtilities/VanityUtilities.cpp +++ b/dGame/dUtilities/VanityUtilities.cpp @@ -102,7 +102,7 @@ void VanityUtilities::SpawnVanity() { } LWOOBJID SpawnSpawner(const VanityObject& object, const VanityObjectLocation& location) { - SceneObject obj {}; + SceneObject obj{}; obj.lot = object.m_LOT; // guratantee we have no collisions do { From 6e41423dc3b3bd9366ca769cb13d69ab274877dc Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 04:01:07 -0500 Subject: [PATCH 32/74] one last MacOS try for the night --- CMakePresets.json | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 6736629ba..d3952f1e4 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -134,8 +134,7 @@ { "name": "macos-debug", "inherits": [ - "macos-config", - "release-config" + "macos-config" ], "displayName": "[Debug] MacOS", "description": "Create a debug build using MacOS" @@ -143,8 +142,7 @@ { "name": "macos-release", "inherits": [ - "macos-config", - "release-config" + "macos-config" ], "displayName": "[Release] MacOS", "description": "Create a release build using MacOS" From 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 16:29:29 -0500 Subject: [PATCH 33/74] try disabling an apple-specific build rule --- CMakePresets.json | 8 ++++++-- tests/CMakeLists.txt | 10 +++++----- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index d3952f1e4..fae320286 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -134,7 +134,8 @@ { "name": "macos-debug", "inherits": [ - "macos-config" + "macos-config", + "debug-config" ], "displayName": "[Debug] MacOS", "description": "Create a debug build using MacOS" @@ -142,7 +143,8 @@ { "name": "macos-release", "inherits": [ - "macos-config" + "macos-config", + "release-config" ], "displayName": "[Release] MacOS", "description": "Create a release build using MacOS" @@ -209,6 +211,7 @@ "configurePreset": "macos-debug", "displayName": "[Debug] MacOS", "description": "This preset is used to build in debug mode on MacOS", + "configuration": "Debug", "jobs": 2 }, { @@ -216,6 +219,7 @@ "configurePreset": "macos-release", "displayName": "[Release] MacOS", "description": "This preset is used to build in release mode on MacOS", + "configuration": "Release", "jobs": 2 } ], diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e8765191f..b4f9d2d08 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -6,11 +6,11 @@ include(GoogleTest) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) -if(APPLE) - set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) - set(CMAKE_BUILD_WITH_INSTALL_RPATH True) - set(CMAKE_INSTALL_RPATH "@executable_path") -endif() +#if(APPLE) +# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) +# set(CMAKE_BUILD_WITH_INSTALL_RPATH True) +# set(CMAKE_INSTALL_RPATH "@executable_path") +#endif() add_custom_target(conncpp_tests ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) From 0f843c02c90b2aa5f0c211e19c47b00798c295c8 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 16:47:19 -0500 Subject: [PATCH 34/74] more fiddling with mac test builds --- tests/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b4f9d2d08..bc44bd30d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,7 +4,7 @@ enable_testing() find_package(GoogleTest REQUIRED) include(GoogleTest) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) +#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) #if(APPLE) # set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) @@ -13,7 +13,7 @@ set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) #endif() add_custom_target(conncpp_tests - ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + ${CMAKE_COMMAND} -E copy $ ${CMAKE_CURRENT_BINARY_DIR}) # ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) # Add the subdirectories add_subdirectory(dCommonTests) From 5fd86833fa6e421860496c3626415ab70c93a795 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 16:54:53 -0500 Subject: [PATCH 35/74] try and narrow down the macos build failure cause --- tests/CMakeLists.txt | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bc44bd30d..7d3e67300 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,16 +4,20 @@ enable_testing() find_package(GoogleTest REQUIRED) include(GoogleTest) -#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) +message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_CURRENT_BINARY_DIR}/bin") -#if(APPLE) -# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) -# set(CMAKE_BUILD_WITH_INSTALL_RPATH True) -# set(CMAKE_INSTALL_RPATH "@executable_path") -#endif() +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) + +if(APPLE) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) + set(CMAKE_BUILD_WITH_INSTALL_RPATH True) + set(CMAKE_INSTALL_RPATH "@executable_path") +endif() + +message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") add_custom_target(conncpp_tests - ${CMAKE_COMMAND} -E copy $ ${CMAKE_CURRENT_BINARY_DIR}) # ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) # Add the subdirectories add_subdirectory(dCommonTests) From cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 17:09:45 -0500 Subject: [PATCH 36/74] try stripping out all the custom macos test logic again --- tests/CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7d3e67300..ccb78eae3 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,20 +4,20 @@ enable_testing() find_package(GoogleTest REQUIRED) include(GoogleTest) -message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_CURRENT_BINARY_DIR}/bin") +message(STATUS "CMAKE_CURRENT_BINARY_DIR = ${CMAKE_CURRENT_BINARY_DIR}") -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) +#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) -if(APPLE) - set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) - set(CMAKE_BUILD_WITH_INSTALL_RPATH True) - set(CMAKE_INSTALL_RPATH "@executable_path") -endif() +#if(APPLE) +# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) +# set(CMAKE_BUILD_WITH_INSTALL_RPATH True) +# set(CMAKE_INSTALL_RPATH "@executable_path") +#endif() -message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") +#message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") add_custom_target(conncpp_tests - ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + ${CMAKE_COMMAND} -E copy $ ${CMAKE_CURRENT_BINARY_DIR}) #${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) # Add the subdirectories add_subdirectory(dCommonTests) From 1a05b027fe822a94e5a6b70e6c744623d6a98e61 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 17:18:41 -0500 Subject: [PATCH 37/74] I'm really just throwing everything to the wall and seeing what sticks --- tests/dCommonTests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/dCommonTests/CMakeLists.txt b/tests/dCommonTests/CMakeLists.txt index ef7c4cba9..fadf43c4e 100644 --- a/tests/dCommonTests/CMakeLists.txt +++ b/tests/dCommonTests/CMakeLists.txt @@ -28,7 +28,7 @@ add_custom_command(TARGET dCommonTests POST_BUILD COMMAND otool ARGS -D libmariadbcpp.dylib COMMAND install_name_tool ARGS -change libmariadbcpp.dylib @rpath/libmariadbcpp.dylib dCommonTests COMMAND otool ARGS -L dCommonTests - WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) endif() # Link needed libraries From 829ec35b57983ad4444d90ab780fff95a8b47608 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 17:43:47 -0500 Subject: [PATCH 38/74] more macos tinkering --- tests/dCommonTests/CMakeLists.txt | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/tests/dCommonTests/CMakeLists.txt b/tests/dCommonTests/CMakeLists.txt index fadf43c4e..a20e4b6b3 100644 --- a/tests/dCommonTests/CMakeLists.txt +++ b/tests/dCommonTests/CMakeLists.txt @@ -20,19 +20,21 @@ add_executable(dCommonTests ${DCOMMONTEST_SOURCES}) add_dependencies(dCommonTests conncpp_tests) # Apple needs some special linkage for the mariadb connector for tests. -if(APPLE) -add_custom_command(TARGET dCommonTests POST_BUILD - COMMAND otool ARGS -l dCommonTests - COMMAND otool ARGS -L dCommonTests - COMMAND ls - COMMAND otool ARGS -D libmariadbcpp.dylib - COMMAND install_name_tool ARGS -change libmariadbcpp.dylib @rpath/libmariadbcpp.dylib dCommonTests - COMMAND otool ARGS -L dCommonTests - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) -endif() +#if(APPLE) +#add_custom_command(TARGET dCommonTests POST_BUILD +# COMMAND otool ARGS -l dCommonTests +# COMMAND otool ARGS -L dCommonTests +# COMMAND ls +# COMMAND otool ARGS -D libmariadbcpp.dylib +# COMMAND install_name_tool ARGS -change libmariadbcpp.dylib @rpath/libmariadbcpp.dylib dCommonTests +# COMMAND otool ARGS -L dCommonTests +# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +#endif() + +#set_target_properties(libmariadbcpp PROPERTIES IMPORTED_LOCATION @rpath/libmariadbcpp.dylib) # Link needed libraries -target_link_libraries(dCommonTests ${COMMON_LIBRARIES} GTest::gtest_main) +target_link_libraries(dCommonTests ${COMMON_LIBRARIES} GTest::gtest_main MariaDB::ConnCpp) # Copy test files to testing directory add_subdirectory(TestBitStreams) From d41349d6edada6a041c64971730eed1c51af14c5 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 17:52:20 -0500 Subject: [PATCH 39/74] implib --- cmake/FindMariaDB.cmake | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/cmake/FindMariaDB.cmake b/cmake/FindMariaDB.cmake index d3f899312..6f047a70b 100644 --- a/cmake/FindMariaDB.cmake +++ b/cmake/FindMariaDB.cmake @@ -18,10 +18,10 @@ if(WIN32 AND NOT MARIADB_BUILD_SOURCE) set(MARIADB_CONNECTOR_CPP_VERSION "1.0.2") set(MARIADB_CONNECTOR_CPP_BUCKET "2531525") set(MARIADB_CONNECTOR_CPP_MD5 "3034bbd6ca00a0125345f9fd1a178401") - + set(MARIADB_CONNECTOR_C_MSI "mariadb-connector-c-${MARIADB_CONNECTOR_C_VERSION}-win64.msi") set(MARIADB_CONNECTOR_CPP_MSI "mariadb-connector-cpp-${MARIADB_CONNECTOR_CPP_VERSION}-win64.msi") - + if(NOT EXISTS "${MARIADB_MSI_DIR}/${MARIADB_CONNECTOR_C_MSI}" ) message(STATUS "Downloading mariadb connector/c") file(DOWNLOAD https://dlm.mariadb.com/${MARIADB_CONNECTOR_C_BUCKET}/Connectors/c/connector-c-${MARIADB_CONNECTOR_C_VERSION}/${MARIADB_CONNECTOR_C_MSI} @@ -137,6 +137,7 @@ if(WIN32) IMPORTED_IMPLIB "${MARIADB_IMPLIB_LOCATION}") elseif(APPLE) set_target_properties(MariaDB::ConnCpp PROPERTIES + IMPORTED_IMPLIB "${MARIADB_IMPLIB_LOCATION}" IMPORTED_SONAME "libmariadbcpp") endif() From 0c2d40632ee5df9c241532d8bf62de9969e47f51 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 18:09:03 -0500 Subject: [PATCH 40/74] try manual link directory specification --- cmake/FindMariaDB.cmake | 2 +- tests/dCommonTests/CMakeLists.txt | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cmake/FindMariaDB.cmake b/cmake/FindMariaDB.cmake index 6f047a70b..65f77db42 100644 --- a/cmake/FindMariaDB.cmake +++ b/cmake/FindMariaDB.cmake @@ -121,6 +121,7 @@ else() # Build from source endif() set(MARIADBCPP_SHARED_LIBRARY_LOCATION "${MARIADBCPP_LIBRARY_DIR}/${MARIADB_SHARED_LIBRARY_NAME}") + message(STATUS "MARIADBCPP_SHARED_LIBRARY_LOCATION = ${MARIADBCPP_SHARED_LIBRARY_LOCATION}") if(WIN32) set(MARIADBC_SHARED_LIBRARY_LOCATION "${MARIADBCPP_LIBRARY_DIR}/libmariadb.lib") endif() @@ -137,7 +138,6 @@ if(WIN32) IMPORTED_IMPLIB "${MARIADB_IMPLIB_LOCATION}") elseif(APPLE) set_target_properties(MariaDB::ConnCpp PROPERTIES - IMPORTED_IMPLIB "${MARIADB_IMPLIB_LOCATION}" IMPORTED_SONAME "libmariadbcpp") endif() diff --git a/tests/dCommonTests/CMakeLists.txt b/tests/dCommonTests/CMakeLists.txt index a20e4b6b3..c3c0faa9d 100644 --- a/tests/dCommonTests/CMakeLists.txt +++ b/tests/dCommonTests/CMakeLists.txt @@ -33,6 +33,11 @@ add_dependencies(dCommonTests conncpp_tests) #set_target_properties(libmariadbcpp PROPERTIES IMPORTED_LOCATION @rpath/libmariadbcpp.dylib) +# TEST +if(APPLE) + link_directories(${CMAKE_BINARY_DIR}/mariadbcpp) +endif() + # Link needed libraries target_link_libraries(dCommonTests ${COMMON_LIBRARIES} GTest::gtest_main MariaDB::ConnCpp) From bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 18:21:16 -0500 Subject: [PATCH 41/74] save me --- cmake/FindMariaDB.cmake | 1 + 1 file changed, 1 insertion(+) diff --git a/cmake/FindMariaDB.cmake b/cmake/FindMariaDB.cmake index 65f77db42..3ab4654e1 100644 --- a/cmake/FindMariaDB.cmake +++ b/cmake/FindMariaDB.cmake @@ -143,5 +143,6 @@ endif() # Add directories to include lists target_include_directories(MariaDB::ConnCpp SYSTEM INTERFACE ${MARIADB_INCLUDE_DIR}) +target_link_directories(MariaDB::ConnCpp PUBLIC ${MARIADBCPP_LIBRARY_DIR}) set(MariaDB_FOUND TRUE) From 338279c396e7c4a78174929a0aaf5205f2c026e6 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 18:29:01 -0500 Subject: [PATCH 42/74] aaaaaaaaa --- cmake/FindMariaDB.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/FindMariaDB.cmake b/cmake/FindMariaDB.cmake index 3ab4654e1..74b6038b6 100644 --- a/cmake/FindMariaDB.cmake +++ b/cmake/FindMariaDB.cmake @@ -143,6 +143,6 @@ endif() # Add directories to include lists target_include_directories(MariaDB::ConnCpp SYSTEM INTERFACE ${MARIADB_INCLUDE_DIR}) -target_link_directories(MariaDB::ConnCpp PUBLIC ${MARIADBCPP_LIBRARY_DIR}) +target_link_directories(MariaDB::ConnCpp INTERFACE ${MARIADBCPP_LIBRARY_DIR}) set(MariaDB_FOUND TRUE) From 9a7d86aa6c59e73de27fbcda2111f7a1472008f4 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 18:39:08 -0500 Subject: [PATCH 43/74] paths paths paths --- cmake/FindMariaDB.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmake/FindMariaDB.cmake b/cmake/FindMariaDB.cmake index 74b6038b6..8773140e6 100644 --- a/cmake/FindMariaDB.cmake +++ b/cmake/FindMariaDB.cmake @@ -121,12 +121,13 @@ else() # Build from source endif() set(MARIADBCPP_SHARED_LIBRARY_LOCATION "${MARIADBCPP_LIBRARY_DIR}/${MARIADB_SHARED_LIBRARY_NAME}") - message(STATUS "MARIADBCPP_SHARED_LIBRARY_LOCATION = ${MARIADBCPP_SHARED_LIBRARY_LOCATION}") if(WIN32) set(MARIADBC_SHARED_LIBRARY_LOCATION "${MARIADBCPP_LIBRARY_DIR}/libmariadb.lib") endif() endif() +message(STATUS "MARIADBCPP_SHARED_LIBRARY_LOCATION = ${MARIADBCPP_SHARED_LIBRARY_LOCATION}") + # Create mariadb connector library object add_library(MariaDB::ConnCpp SHARED IMPORTED GLOBAL) add_dependencies(MariaDB::ConnCpp mariadb_connector_cpp) @@ -138,6 +139,7 @@ if(WIN32) IMPORTED_IMPLIB "${MARIADB_IMPLIB_LOCATION}") elseif(APPLE) set_target_properties(MariaDB::ConnCpp PROPERTIES + IMPORTED_IMPLIB "${MARIADB_IMPLIB_LOCATION}" IMPORTED_SONAME "libmariadbcpp") endif() From dccac945bb100289cd0bff67e071563cc51bf7e8 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 18:47:08 -0500 Subject: [PATCH 44/74] Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. --- cmake/FindMariaDB.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/cmake/FindMariaDB.cmake b/cmake/FindMariaDB.cmake index 8773140e6..74b6038b6 100644 --- a/cmake/FindMariaDB.cmake +++ b/cmake/FindMariaDB.cmake @@ -121,13 +121,12 @@ else() # Build from source endif() set(MARIADBCPP_SHARED_LIBRARY_LOCATION "${MARIADBCPP_LIBRARY_DIR}/${MARIADB_SHARED_LIBRARY_NAME}") + message(STATUS "MARIADBCPP_SHARED_LIBRARY_LOCATION = ${MARIADBCPP_SHARED_LIBRARY_LOCATION}") if(WIN32) set(MARIADBC_SHARED_LIBRARY_LOCATION "${MARIADBCPP_LIBRARY_DIR}/libmariadb.lib") endif() endif() -message(STATUS "MARIADBCPP_SHARED_LIBRARY_LOCATION = ${MARIADBCPP_SHARED_LIBRARY_LOCATION}") - # Create mariadb connector library object add_library(MariaDB::ConnCpp SHARED IMPORTED GLOBAL) add_dependencies(MariaDB::ConnCpp mariadb_connector_cpp) @@ -139,7 +138,6 @@ if(WIN32) IMPORTED_IMPLIB "${MARIADB_IMPLIB_LOCATION}") elseif(APPLE) set_target_properties(MariaDB::ConnCpp PROPERTIES - IMPORTED_IMPLIB "${MARIADB_IMPLIB_LOCATION}" IMPORTED_SONAME "libmariadbcpp") endif() From c420a72016df072a7bd190ca3d4106ef0af9a202 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 18:47:36 -0500 Subject: [PATCH 45/74] Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. --- cmake/FindMariaDB.cmake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cmake/FindMariaDB.cmake b/cmake/FindMariaDB.cmake index 74b6038b6..3ab4654e1 100644 --- a/cmake/FindMariaDB.cmake +++ b/cmake/FindMariaDB.cmake @@ -143,6 +143,6 @@ endif() # Add directories to include lists target_include_directories(MariaDB::ConnCpp SYSTEM INTERFACE ${MARIADB_INCLUDE_DIR}) -target_link_directories(MariaDB::ConnCpp INTERFACE ${MARIADBCPP_LIBRARY_DIR}) +target_link_directories(MariaDB::ConnCpp PUBLIC ${MARIADBCPP_LIBRARY_DIR}) set(MariaDB_FOUND TRUE) From ce568189fca00cccae412ee81593ec74b760781b Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 18:47:40 -0500 Subject: [PATCH 46/74] Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. --- cmake/FindMariaDB.cmake | 1 - 1 file changed, 1 deletion(-) diff --git a/cmake/FindMariaDB.cmake b/cmake/FindMariaDB.cmake index 3ab4654e1..65f77db42 100644 --- a/cmake/FindMariaDB.cmake +++ b/cmake/FindMariaDB.cmake @@ -143,6 +143,5 @@ endif() # Add directories to include lists target_include_directories(MariaDB::ConnCpp SYSTEM INTERFACE ${MARIADB_INCLUDE_DIR}) -target_link_directories(MariaDB::ConnCpp PUBLIC ${MARIADBCPP_LIBRARY_DIR}) set(MariaDB_FOUND TRUE) From 37dbb52104917116a344b86dab90160f5b43411d Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 18:47:42 -0500 Subject: [PATCH 47/74] Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. --- cmake/FindMariaDB.cmake | 2 +- tests/dCommonTests/CMakeLists.txt | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/cmake/FindMariaDB.cmake b/cmake/FindMariaDB.cmake index 65f77db42..6f047a70b 100644 --- a/cmake/FindMariaDB.cmake +++ b/cmake/FindMariaDB.cmake @@ -121,7 +121,6 @@ else() # Build from source endif() set(MARIADBCPP_SHARED_LIBRARY_LOCATION "${MARIADBCPP_LIBRARY_DIR}/${MARIADB_SHARED_LIBRARY_NAME}") - message(STATUS "MARIADBCPP_SHARED_LIBRARY_LOCATION = ${MARIADBCPP_SHARED_LIBRARY_LOCATION}") if(WIN32) set(MARIADBC_SHARED_LIBRARY_LOCATION "${MARIADBCPP_LIBRARY_DIR}/libmariadb.lib") endif() @@ -138,6 +137,7 @@ if(WIN32) IMPORTED_IMPLIB "${MARIADB_IMPLIB_LOCATION}") elseif(APPLE) set_target_properties(MariaDB::ConnCpp PROPERTIES + IMPORTED_IMPLIB "${MARIADB_IMPLIB_LOCATION}" IMPORTED_SONAME "libmariadbcpp") endif() diff --git a/tests/dCommonTests/CMakeLists.txt b/tests/dCommonTests/CMakeLists.txt index c3c0faa9d..a20e4b6b3 100644 --- a/tests/dCommonTests/CMakeLists.txt +++ b/tests/dCommonTests/CMakeLists.txt @@ -33,11 +33,6 @@ add_dependencies(dCommonTests conncpp_tests) #set_target_properties(libmariadbcpp PROPERTIES IMPORTED_LOCATION @rpath/libmariadbcpp.dylib) -# TEST -if(APPLE) - link_directories(${CMAKE_BINARY_DIR}/mariadbcpp) -endif() - # Link needed libraries target_link_libraries(dCommonTests ${COMMON_LIBRARIES} GTest::gtest_main MariaDB::ConnCpp) From 495e70c37641673f420bd6589e3706247eb741fd Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 18:47:44 -0500 Subject: [PATCH 48/74] Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. --- cmake/FindMariaDB.cmake | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cmake/FindMariaDB.cmake b/cmake/FindMariaDB.cmake index 6f047a70b..d3f899312 100644 --- a/cmake/FindMariaDB.cmake +++ b/cmake/FindMariaDB.cmake @@ -18,10 +18,10 @@ if(WIN32 AND NOT MARIADB_BUILD_SOURCE) set(MARIADB_CONNECTOR_CPP_VERSION "1.0.2") set(MARIADB_CONNECTOR_CPP_BUCKET "2531525") set(MARIADB_CONNECTOR_CPP_MD5 "3034bbd6ca00a0125345f9fd1a178401") - + set(MARIADB_CONNECTOR_C_MSI "mariadb-connector-c-${MARIADB_CONNECTOR_C_VERSION}-win64.msi") set(MARIADB_CONNECTOR_CPP_MSI "mariadb-connector-cpp-${MARIADB_CONNECTOR_CPP_VERSION}-win64.msi") - + if(NOT EXISTS "${MARIADB_MSI_DIR}/${MARIADB_CONNECTOR_C_MSI}" ) message(STATUS "Downloading mariadb connector/c") file(DOWNLOAD https://dlm.mariadb.com/${MARIADB_CONNECTOR_C_BUCKET}/Connectors/c/connector-c-${MARIADB_CONNECTOR_C_VERSION}/${MARIADB_CONNECTOR_C_MSI} @@ -137,7 +137,6 @@ if(WIN32) IMPORTED_IMPLIB "${MARIADB_IMPLIB_LOCATION}") elseif(APPLE) set_target_properties(MariaDB::ConnCpp PROPERTIES - IMPORTED_IMPLIB "${MARIADB_IMPLIB_LOCATION}" IMPORTED_SONAME "libmariadbcpp") endif() From e143f22adafa82cfa3462869f0842f2acbdbdebb Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 18:47:46 -0500 Subject: [PATCH 49/74] Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. --- tests/dCommonTests/CMakeLists.txt | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/tests/dCommonTests/CMakeLists.txt b/tests/dCommonTests/CMakeLists.txt index a20e4b6b3..fadf43c4e 100644 --- a/tests/dCommonTests/CMakeLists.txt +++ b/tests/dCommonTests/CMakeLists.txt @@ -20,21 +20,19 @@ add_executable(dCommonTests ${DCOMMONTEST_SOURCES}) add_dependencies(dCommonTests conncpp_tests) # Apple needs some special linkage for the mariadb connector for tests. -#if(APPLE) -#add_custom_command(TARGET dCommonTests POST_BUILD -# COMMAND otool ARGS -l dCommonTests -# COMMAND otool ARGS -L dCommonTests -# COMMAND ls -# COMMAND otool ARGS -D libmariadbcpp.dylib -# COMMAND install_name_tool ARGS -change libmariadbcpp.dylib @rpath/libmariadbcpp.dylib dCommonTests -# COMMAND otool ARGS -L dCommonTests -# WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) -#endif() - -#set_target_properties(libmariadbcpp PROPERTIES IMPORTED_LOCATION @rpath/libmariadbcpp.dylib) +if(APPLE) +add_custom_command(TARGET dCommonTests POST_BUILD + COMMAND otool ARGS -l dCommonTests + COMMAND otool ARGS -L dCommonTests + COMMAND ls + COMMAND otool ARGS -D libmariadbcpp.dylib + COMMAND install_name_tool ARGS -change libmariadbcpp.dylib @rpath/libmariadbcpp.dylib dCommonTests + COMMAND otool ARGS -L dCommonTests + WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) +endif() # Link needed libraries -target_link_libraries(dCommonTests ${COMMON_LIBRARIES} GTest::gtest_main MariaDB::ConnCpp) +target_link_libraries(dCommonTests ${COMMON_LIBRARIES} GTest::gtest_main) # Copy test files to testing directory add_subdirectory(TestBitStreams) From 8af35727a6038eb29d60d0fcebdebb536e6417f0 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 18:47:48 -0500 Subject: [PATCH 50/74] Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. --- tests/dCommonTests/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/dCommonTests/CMakeLists.txt b/tests/dCommonTests/CMakeLists.txt index fadf43c4e..ef7c4cba9 100644 --- a/tests/dCommonTests/CMakeLists.txt +++ b/tests/dCommonTests/CMakeLists.txt @@ -28,7 +28,7 @@ add_custom_command(TARGET dCommonTests POST_BUILD COMMAND otool ARGS -D libmariadbcpp.dylib COMMAND install_name_tool ARGS -change libmariadbcpp.dylib @rpath/libmariadbcpp.dylib dCommonTests COMMAND otool ARGS -L dCommonTests - WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) + WORKING_DIRECTORY ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) endif() # Link needed libraries From 54876bf886b16f7c217af82aa805cf85321f369e Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 18:47:50 -0500 Subject: [PATCH 51/74] Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. --- tests/CMakeLists.txt | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index ccb78eae3..7d3e67300 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,20 +4,20 @@ enable_testing() find_package(GoogleTest REQUIRED) include(GoogleTest) -message(STATUS "CMAKE_CURRENT_BINARY_DIR = ${CMAKE_CURRENT_BINARY_DIR}") +message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_CURRENT_BINARY_DIR}/bin") -#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) -#if(APPLE) -# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) -# set(CMAKE_BUILD_WITH_INSTALL_RPATH True) -# set(CMAKE_INSTALL_RPATH "@executable_path") -#endif() +if(APPLE) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) + set(CMAKE_BUILD_WITH_INSTALL_RPATH True) + set(CMAKE_INSTALL_RPATH "@executable_path") +endif() -#message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") +message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") add_custom_target(conncpp_tests - ${CMAKE_COMMAND} -E copy $ ${CMAKE_CURRENT_BINARY_DIR}) #${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) # Add the subdirectories add_subdirectory(dCommonTests) From 8f5c10d15806b0b9f5e425e146f67bc3da4b34ca Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 18:47:52 -0500 Subject: [PATCH 52/74] Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. --- tests/CMakeLists.txt | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 7d3e67300..bc44bd30d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,20 +4,16 @@ enable_testing() find_package(GoogleTest REQUIRED) include(GoogleTest) -message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_CURRENT_BINARY_DIR}/bin") +#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) - -if(APPLE) - set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) - set(CMAKE_BUILD_WITH_INSTALL_RPATH True) - set(CMAKE_INSTALL_RPATH "@executable_path") -endif() - -message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") +#if(APPLE) +# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) +# set(CMAKE_BUILD_WITH_INSTALL_RPATH True) +# set(CMAKE_INSTALL_RPATH "@executable_path") +#endif() add_custom_target(conncpp_tests - ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + ${CMAKE_COMMAND} -E copy $ ${CMAKE_CURRENT_BINARY_DIR}) # ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) # Add the subdirectories add_subdirectory(dCommonTests) From 8154207848918ae5d2d13edc90522c104479f242 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 18:47:53 -0500 Subject: [PATCH 53/74] Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. --- tests/CMakeLists.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index bc44bd30d..b4f9d2d08 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,7 +4,7 @@ enable_testing() find_package(GoogleTest REQUIRED) include(GoogleTest) -#set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) #if(APPLE) # set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) @@ -13,7 +13,7 @@ include(GoogleTest) #endif() add_custom_target(conncpp_tests - ${CMAKE_COMMAND} -E copy $ ${CMAKE_CURRENT_BINARY_DIR}) # ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) + ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) # Add the subdirectories add_subdirectory(dCommonTests) From bdf9adc0e84bfad8bdec408af7f55c7dd0c8f1d4 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 18:47:55 -0500 Subject: [PATCH 54/74] Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. --- CMakePresets.json | 8 ++------ tests/CMakeLists.txt | 10 +++++----- 2 files changed, 7 insertions(+), 11 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index fae320286..d3952f1e4 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -134,8 +134,7 @@ { "name": "macos-debug", "inherits": [ - "macos-config", - "debug-config" + "macos-config" ], "displayName": "[Debug] MacOS", "description": "Create a debug build using MacOS" @@ -143,8 +142,7 @@ { "name": "macos-release", "inherits": [ - "macos-config", - "release-config" + "macos-config" ], "displayName": "[Release] MacOS", "description": "Create a release build using MacOS" @@ -211,7 +209,6 @@ "configurePreset": "macos-debug", "displayName": "[Debug] MacOS", "description": "This preset is used to build in debug mode on MacOS", - "configuration": "Debug", "jobs": 2 }, { @@ -219,7 +216,6 @@ "configurePreset": "macos-release", "displayName": "[Release] MacOS", "description": "This preset is used to build in release mode on MacOS", - "configuration": "Release", "jobs": 2 } ], diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b4f9d2d08..e8765191f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -6,11 +6,11 @@ include(GoogleTest) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) -#if(APPLE) -# set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) -# set(CMAKE_BUILD_WITH_INSTALL_RPATH True) -# set(CMAKE_INSTALL_RPATH "@executable_path") -#endif() +if(APPLE) + set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) + set(CMAKE_BUILD_WITH_INSTALL_RPATH True) + set(CMAKE_INSTALL_RPATH "@executable_path") +endif() add_custom_target(conncpp_tests ${CMAKE_COMMAND} -E copy $ ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}) From 07626f8ebba098d7ed04b0269666774c291683df Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 19:04:59 -0500 Subject: [PATCH 55/74] back to debug messages --- tests/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index e8765191f..1e184716d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,7 +4,11 @@ enable_testing() find_package(GoogleTest REQUIRED) include(GoogleTest) +message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) +message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") + +message(STATUS "Executable Path: @executable_path") if(APPLE) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) From a4b6b7c0d9b905dc53d5c34668d312c0a39a4e6c Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 19:27:34 -0500 Subject: [PATCH 56/74] see if this re-breaks mac --- tests/CMakeLists.txt | 2 -- thirdparty/CMakeLists.txt | 4 ++-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 1e184716d..4fb7d30eb 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -8,8 +8,6 @@ message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTOR set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") -message(STATUS "Executable Path: @executable_path") - if(APPLE) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) set(CMAKE_BUILD_WITH_INSTALL_RPATH True) diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 9ce7f5a16..6a2f865e9 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -23,8 +23,8 @@ if(NOT WIN32) target_include_directories(bcrypt PRIVATE "libbcrypt/include/bcrypt") endif() -# Need to define this on Clang (Linux) for 'strdup' support -if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang") +# Need to define this on Clang and GNU for 'strdup' support +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR "GNU") target_compile_definitions(bcrypt PRIVATE "_POSIX_C_SOURCE=200809L") endif() From fab74c90b645d77765004521fa8109af02118843 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 19:37:02 -0500 Subject: [PATCH 57/74] are these messages actually somehow fixing the issue? --- tests/CMakeLists.txt | 4 ++-- thirdparty/CMakeLists.txt | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4fb7d30eb..6a0bbaa3d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,9 +4,9 @@ enable_testing() find_package(GoogleTest REQUIRED) include(GoogleTest) -message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") +#message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) -message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") +#message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") if(APPLE) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 6a2f865e9..55dd10be3 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -24,7 +24,7 @@ if(NOT WIN32) endif() # Need to define this on Clang and GNU for 'strdup' support -if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR "GNU") +if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") target_compile_definitions(bcrypt PRIVATE "_POSIX_C_SOURCE=200809L") endif() From 6c6966afd25494897dd9c3c20b5d44160c557268 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 19:46:58 -0500 Subject: [PATCH 58/74] was not actually fixed --- CMakePresets.json | 8 +++++--- tests/CMakeLists.txt | 4 ++-- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index d3952f1e4..3342fbe02 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -134,7 +134,8 @@ { "name": "macos-debug", "inherits": [ - "macos-config" + "macos-config", + "debug-config" ], "displayName": "[Debug] MacOS", "description": "Create a debug build using MacOS" @@ -142,7 +143,8 @@ { "name": "macos-release", "inherits": [ - "macos-config" + "macos-config", + "release-config" ], "displayName": "[Release] MacOS", "description": "Create a release build using MacOS" @@ -281,7 +283,7 @@ "configurePreset": "macos-debug", "displayName": "[Debug] MacOS", "description": "Runs all tests on a MacOS configuration", - "configuration": "Release" + "configuration": "Debug" }, { "name": "macos-release", diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6a0bbaa3d..4fb7d30eb 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,9 +4,9 @@ enable_testing() find_package(GoogleTest REQUIRED) include(GoogleTest) -#message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") +message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) -#message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") +message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") if(APPLE) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) From c6c771b892d713d789a3fb4fb008693522af845b Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 20:16:00 -0500 Subject: [PATCH 59/74] add debug messages (again) --- tests/CMakeLists.txt | 4 ++++ tests/dCommonTests/CMakeLists.txt | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4fb7d30eb..5807a3c67 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,7 +4,11 @@ enable_testing() find_package(GoogleTest REQUIRED) include(GoogleTest) +message(STARUS "TESTS") message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") +message(STATUS "CMAKE_CURRENT_SOURCE_DIR = ${CMAKE_CURRENT_SOURCE_DIR}") +message(STATUS "CMAKE_CURRENT_BINARY_DIR = ${CMAKE_CURRENT_BINARY_DIR}") +message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE}") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") diff --git a/tests/dCommonTests/CMakeLists.txt b/tests/dCommonTests/CMakeLists.txt index ef7c4cba9..e18b8092d 100644 --- a/tests/dCommonTests/CMakeLists.txt +++ b/tests/dCommonTests/CMakeLists.txt @@ -12,6 +12,13 @@ set(DCOMMONTEST_SOURCES "dCommonDependencies.cpp" ) +message(STARUS "TESTS") +message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") +message(STATUS "CMAKE_CURRENT_SOURCE_DIR = ${CMAKE_CURRENT_SOURCE_DIR}") +message(STATUS "CMAKE_CURRENT_BINARY_DIR = ${CMAKE_CURRENT_BINARY_DIR}") +message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE}") +message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") + add_subdirectory(dEnumsTests) list(APPEND DCOMMONTEST_SOURCES ${DENUMS_TESTS}) From abe413f239c2d4ac82b98621b3948fc0822e01f3 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 20:22:47 -0500 Subject: [PATCH 60/74] debug try 2 --- tests/CMakeLists.txt | 10 +++++----- tests/dCommonTests/CMakeLists.txt | 12 ++++++------ 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 5807a3c67..6c9a6a70e 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,11 +4,11 @@ enable_testing() find_package(GoogleTest REQUIRED) include(GoogleTest) -message(STARUS "TESTS") -message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") -message(STATUS "CMAKE_CURRENT_SOURCE_DIR = ${CMAKE_CURRENT_SOURCE_DIR}") -message(STATUS "CMAKE_CURRENT_BINARY_DIR = ${CMAKE_CURRENT_BINARY_DIR}") -message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE}") +message(STATUS "TESTS + CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + CMAKE_CURRENT_SOURCE_DIR = ${CMAKE_CURRENT_SOURCE_DIR} + CMAKE_CURRENT_BINARY_DIR = ${CMAKE_CURRENT_BINARY_DIR} + CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE}") set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") diff --git a/tests/dCommonTests/CMakeLists.txt b/tests/dCommonTests/CMakeLists.txt index e18b8092d..7b48296a0 100644 --- a/tests/dCommonTests/CMakeLists.txt +++ b/tests/dCommonTests/CMakeLists.txt @@ -12,12 +12,12 @@ set(DCOMMONTEST_SOURCES "dCommonDependencies.cpp" ) -message(STARUS "TESTS") -message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") -message(STATUS "CMAKE_CURRENT_SOURCE_DIR = ${CMAKE_CURRENT_SOURCE_DIR}") -message(STATUS "CMAKE_CURRENT_BINARY_DIR = ${CMAKE_CURRENT_BINARY_DIR}") -message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE}") -message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") +message(STATUS "COMMONTESTS + CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} + CMAKE_CURRENT_SOURCE_DIR = ${CMAKE_CURRENT_SOURCE_DIR} + CMAKE_CURRENT_BINARY_DIR = ${CMAKE_CURRENT_BINARY_DIR} + CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE} + CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") add_subdirectory(dEnumsTests) list(APPEND DCOMMONTEST_SOURCES ${DENUMS_TESTS}) From d6e4edd886c0d38d465728584a76dc2569a2b5e4 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 20:27:20 -0500 Subject: [PATCH 61/74] change runtime output dir --- tests/CMakeLists.txt | 8 -------- tests/dCommonTests/CMakeLists.txt | 7 ------- 2 files changed, 15 deletions(-) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6c9a6a70e..24adec61d 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -4,14 +4,6 @@ enable_testing() find_package(GoogleTest REQUIRED) include(GoogleTest) -message(STATUS "TESTS - CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - CMAKE_CURRENT_SOURCE_DIR = ${CMAKE_CURRENT_SOURCE_DIR} - CMAKE_CURRENT_BINARY_DIR = ${CMAKE_CURRENT_BINARY_DIR} - CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE}") -set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/bin) -message(STATUS "CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") - if(APPLE) set(CMAKE_INSTALL_RPATH_USE_LINK_PATH True) set(CMAKE_BUILD_WITH_INSTALL_RPATH True) diff --git a/tests/dCommonTests/CMakeLists.txt b/tests/dCommonTests/CMakeLists.txt index 7b48296a0..ef7c4cba9 100644 --- a/tests/dCommonTests/CMakeLists.txt +++ b/tests/dCommonTests/CMakeLists.txt @@ -12,13 +12,6 @@ set(DCOMMONTEST_SOURCES "dCommonDependencies.cpp" ) -message(STATUS "COMMONTESTS - CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY} - CMAKE_CURRENT_SOURCE_DIR = ${CMAKE_CURRENT_SOURCE_DIR} - CMAKE_CURRENT_BINARY_DIR = ${CMAKE_CURRENT_BINARY_DIR} - CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE} - CMAKE_RUNTIME_OUTPUT_DIRECTORY = ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}") - add_subdirectory(dEnumsTests) list(APPEND DCOMMONTEST_SOURCES ${DENUMS_TESTS}) From aa62d357bb133c6a770572bc3bcad8442941fc9a Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 20:50:26 -0500 Subject: [PATCH 62/74] rename gcc to gnu --- CMakePresets.json | 54 +++++++++---------- .../{linux-gcc.cmake => linux-gnu.cmake} | 0 2 files changed, 27 insertions(+), 27 deletions(-) rename cmake/toolchains/{linux-gcc.cmake => linux-gnu.cmake} (100%) diff --git a/CMakePresets.json b/CMakePresets.json index 3342fbe02..60191badb 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -33,9 +33,9 @@ "toolchainFile": "${sourceDir}/cmake/toolchains/linux-clang.cmake" }, { - "name": "gcc-config", + "name": "gnu-config", "hidden": true, - "toolchainFile": "${sourceDir}/cmake/toolchains/linux-gcc.cmake" + "toolchainFile": "${sourceDir}/cmake/toolchains/linux-gnu.cmake" }, { "name": "windows-msvc", @@ -112,23 +112,23 @@ "description": "Create a release build using the Clang toolchain for Linux" }, { - "name": "linux-gcc-debug", + "name": "linux-gnu-debug", "inherits": [ "linux-config", - "gcc-config", + "gnu-config", "debug-config" ], - "displayName": "[Debug] Linux (GCC)", + "displayName": "[Debug] Linux (GNU)", "description": "Create a debug build using the GNU toolchain for Linux" }, { - "name": "linux-gcc-release", + "name": "linux-gnu-release", "inherits": [ "linux-config", - "gcc-config", + "gnu-config", "release-config" ], - "displayName": "[Release] Linux (GCC)", + "displayName": "[Release] Linux (GNU)", "description": "Create a release build using the GNU toolchain for Linux" }, { @@ -191,18 +191,18 @@ "jobs": 2 }, { - "name": "linux-gcc-debug", - "configurePreset": "linux-gcc-debug", - "displayName": "[Debug] Linux (GCC)", - "description": "This preset is used to build in debug mode using the GCC toolchain on Linux", + "name": "linux-gnu-debug", + "configurePreset": "linux-gnu-debug", + "displayName": "[Debug] Linux (GNU)", + "description": "This preset is used to build in debug mode using the GNU toolchain on Linux", "configuration": "Debug", "jobs": 2 }, { - "name": "linux-gcc-release", - "configurePreset": "linux-gcc-release", - "displayName": "[Release] Linux (GCC)", - "description": "This preset is used to build in release mode using the GCC toolchain on Linux", + "name": "linux-gnu-release", + "configurePreset": "linux-gnu-release", + "displayName": "[Release] Linux (GNU)", + "description": "This preset is used to build in release mode using the GNU toolchain on Linux", "configuration": "Release", "jobs": 2 }, @@ -262,19 +262,19 @@ "configuration": "Release" }, { - "name": "linux-gcc-debug", + "name": "linux-gnu-debug", "inherits": "default", - "configurePreset": "linux-gcc-debug", - "displayName": "[Debug] Linux (GCC)", - "description": "Runs all tests on a Linux GCC configuration", + "configurePreset": "linux-gnu-debug", + "displayName": "[Debug] Linux (GNU)", + "description": "Runs all tests on a Linux GNU configuration", "configuration": "Release" }, { - "name": "linux-gcc-release", + "name": "linux-gnu-release", "inherits": "default", - "configurePreset": "linux-gcc-release", - "displayName": "[Release] Linux (GCC)", - "description": "Runs all tests on a Linux GCC configuration", + "configurePreset": "linux-gnu-release", + "displayName": "[Release] Linux (GNU)", + "description": "Runs all tests on a Linux GNU configuration", "configuration": "Release" }, { @@ -338,15 +338,15 @@ "steps": [ { "type": "configure", - "name": "linux-gcc-release" + "name": "linux-gnu-release" }, { "type": "build", - "name": "linux-gcc-release" + "name": "linux-gnu-release" }, { "type": "test", - "name": "linux-gcc-release" + "name": "linux-gnu-release" } ] }, diff --git a/cmake/toolchains/linux-gcc.cmake b/cmake/toolchains/linux-gnu.cmake similarity index 100% rename from cmake/toolchains/linux-gcc.cmake rename to cmake/toolchains/linux-gnu.cmake From 57d0b12f9b07caf3173be04587125fe4eca33fb1 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 21:50:32 -0500 Subject: [PATCH 63/74] expand cmake presets --- CMakePresets.json | 172 +++++++++++++++------ tests/dCommonTests/AMFDeserializeTests.cpp | 4 +- tests/dCommonTests/Amf3Tests.cpp | 4 +- 3 files changed, 129 insertions(+), 51 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 60191badb..fa2b47aa5 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -10,7 +10,7 @@ "name": "default", "displayName": "Default configure step", "description": "Use 'build' dir and Unix makefiles", - "binaryDir": "${sourceDir}/build", + "binaryDir": "${sourceDir}/build/default", "generator": "Unix Makefiles" }, { @@ -41,8 +41,8 @@ "name": "windows-msvc", "displayName": "[Multi] Windows (MSVC)", "description": "Set architecture to 64-bit (b/c RakNet)", - "inherits": "default", "generator": "Visual Studio 17 2022", + "binaryDir": "${sourceDir}/build/msvc", "architecture": { "value": "x64" }, @@ -81,16 +81,6 @@ "rhs": "Linux" } }, - { - "name": "macos-config", - "inherits": "default", - "hidden": true, - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Darwin" - } - }, { "name": "linux-clang-debug", "inherits": [ @@ -99,7 +89,8 @@ "debug-config" ], "displayName": "[Debug] Linux (Clang)", - "description": "Create a debug build using the Clang toolchain for Linux" + "description": "Create a debug build using the Clang toolchain for Linux", + "binaryDir": "${sourceDir}/build/clang/debug" }, { "name": "linux-clang-release", @@ -109,7 +100,8 @@ "release-config" ], "displayName": "[Release] Linux (Clang)", - "description": "Create a release build using the Clang toolchain for Linux" + "description": "Create a release build using the Clang toolchain for Linux", + "binaryDir": "${sourceDir}/build/clang/release" }, { "name": "linux-gnu-debug", @@ -119,7 +111,8 @@ "debug-config" ], "displayName": "[Debug] Linux (GNU)", - "description": "Create a debug build using the GNU toolchain for Linux" + "description": "Create a debug build using the GNU toolchain for Linux", + "binaryDir": "${sourceDir}/build/gnu/debug" }, { "name": "linux-gnu-release", @@ -129,25 +122,20 @@ "release-config" ], "displayName": "[Release] Linux (GNU)", - "description": "Create a release build using the GNU toolchain for Linux" + "description": "Create a release build using the GNU toolchain for Linux", + "binaryDir": "${sourceDir}/build/gnu/release" }, { - "name": "macos-debug", - "inherits": [ - "macos-config", - "debug-config" - ], - "displayName": "[Debug] MacOS", - "description": "Create a debug build using MacOS" - }, - { - "name": "macos-release", - "inherits": [ - "macos-config", - "release-config" - ], - "displayName": "[Release] MacOS", - "description": "Create a release build using MacOS" + "name": "macos", + "inherits": "macos-config", + "displayName": "[Multi] MacOS", + "description": "Create a build for MacOS", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "binaryDir": "${sourceDir}/build/macos" } ], "buildPresets": [ @@ -208,14 +196,14 @@ }, { "name": "macos-debug", - "configurePreset": "macos-debug", + "configurePreset": "macos", "displayName": "[Debug] MacOS", "description": "This preset is used to build in debug mode on MacOS", "jobs": 2 }, { "name": "macos-release", - "configurePreset": "macos-release", + "configurePreset": "macos", "displayName": "[Release] MacOS", "description": "This preset is used to build in release mode on MacOS", "jobs": 2 @@ -233,18 +221,32 @@ } }, { - "name": "windows-msvc", + "name": "windows-msvc-test", "inherits": "default", "configurePreset": "windows-msvc", - "displayName": "[Multi] Windows (MSVC)", - "description": "Runs all tests on a Windows configuration", - "configuration": "Release", + "hidden": true, "filter": { "exclude": { "name": "((example)|(minigzip))+" } } }, + { + "name": "windows-msvc-debug", + "inherits": "windows-msvc-test", + "configurePreset": "windows-msvc", + "displayName": "[Debug] Windows (MSVC)", + "description": "Runs all tests on a Windows configuration", + "configuration": "Debug" + }, + { + "name": "windows-msvc-release", + "inherits": "windows-msvc-test", + "configurePreset": "windows-msvc", + "displayName": "[Release] Windows (MSVC)", + "description": "Runs all tests on a Windows configuration", + "configuration": "Release" + }, { "name": "linux-clang-debug", "inherits": "default", @@ -280,7 +282,7 @@ { "name": "macos-debug", "inherits": "default", - "configurePreset": "macos-debug", + "configurePreset": "macos", "displayName": "[Debug] MacOS", "description": "Runs all tests on a MacOS configuration", "configuration": "Debug" @@ -288,7 +290,7 @@ { "name": "macos-release", "inherits": "default", - "configurePreset": "macos-release", + "configurePreset": "macos", "displayName": "[Release] MacOS", "description": "Runs all tests on a MacOS configuration", "configuration": "Release" @@ -312,9 +314,28 @@ } ] }, + { + "name": "windows-msvc-debug", + "displayName": "[Debug] Windows (MSVC)", + "description": "MSVC debug workflow preset for Windows", + "steps": [ + { + "type": "configure", + "name": "windows-msvc" + }, + { + "type": "build", + "name": "windows-msvc-debug" + }, + { + "type": "test", + "name": "windows-msvc-debug" + } + ] + }, { "name": "ci-windows-2022", - "displayName": "Windows CI Workflow", + "displayName": "[Release] Windows (MSVC)", "description": "CI workflow preset for Windows", "steps": [ { @@ -327,13 +348,32 @@ }, { "type": "test", - "name": "windows-msvc" + "name": "windows-msvc-release" + } + ] + }, + { + "name": "linux-gnu-debug", + "displayName": "[Debug] Linux (GNU)", + "description": "GNU debug workflow preset for Linux", + "steps": [ + { + "type": "configure", + "name": "linux-gnu-debug" + }, + { + "type": "build", + "name": "linux-gnu-debug" + }, + { + "type": "test", + "name": "linux-gnu-debug" } ] }, { "name": "ci-ubuntu-22.04", - "displayName": "Ubuntu CI Workflow", + "displayName": "[Release] Linux (GNU)", "description": "CI workflow preset for Ubuntu", "steps": [ { @@ -350,10 +390,29 @@ } ] }, + { + "name": "linux-clang-debug", + "displayName": "[Debug] Linux (Clang)", + "description": "Clang debug workflow preset for Linux", + "steps": [ + { + "type": "configure", + "name": "linux-clang-debug" + }, + { + "type": "build", + "name": "linux-clang-debug" + }, + { + "type": "test", + "name": "linux-clang-debug" + } + ] + }, { "name": "linux-clang-release", - "displayName": "Build using Clang on Linux", - "description": "Clang workflow preset for Linux", + "displayName": "[Release] Linux (Clang)", + "description": "Clang release workflow preset for Linux", "steps": [ { "type": "configure", @@ -369,14 +428,33 @@ } ] }, + { + "name": "macos-debug", + "displayName": "[Debug] MacOS", + "description": "Release workflow preset for MacOS", + "steps": [ + { + "type": "configure", + "name": "macos" + }, + { + "type": "build", + "name": "macos-debug" + }, + { + "type": "test", + "name": "macos-debug" + } + ] + }, { "name": "ci-macos-13", - "displayName": "MacOS CI Workflow", + "displayName": "[Release] MacOS", "description": "CI workflow preset for MacOS", "steps": [ { "type": "configure", - "name": "macos-release" + "name": "macos" }, { "type": "build", diff --git a/tests/dCommonTests/AMFDeserializeTests.cpp b/tests/dCommonTests/AMFDeserializeTests.cpp index c949ae502..fb9e5a4fe 100644 --- a/tests/dCommonTests/AMFDeserializeTests.cpp +++ b/tests/dCommonTests/AMFDeserializeTests.cpp @@ -176,7 +176,7 @@ TEST(dCommonTests, AMFDeserializeAMFArrayTest) { /** * @brief This test checks that if we recieve an unimplemented eAmf * we correctly throw an error and can actch it. - * Yes this leaks memory. + * Yes this leaks memory. */ TEST(dCommonTests, AMFDeserializeUnimplementedValuesTest) { std::vector unimplementedValues = { @@ -363,7 +363,7 @@ TEST(dCommonTests, AMFBadConversionTest) { ASSERT_EQ(result->Get("BehaviorID"), nullptr); // Does not exist in the associative portion - ASSERT_EQ(result->Get("DOES_NOT_EXIST"), nullptr); + ASSERT_EQ(result->Get("DOES_NOT_EXIST"), nullptr); result->Push(true); diff --git a/tests/dCommonTests/Amf3Tests.cpp b/tests/dCommonTests/Amf3Tests.cpp index 5b52cf277..79d0d496d 100644 --- a/tests/dCommonTests/Amf3Tests.cpp +++ b/tests/dCommonTests/Amf3Tests.cpp @@ -78,7 +78,7 @@ TEST(dCommonTests, AMF3InsertionAssociativeTest) { ASSERT_EQ(array.Get("Integer")->GetValueType(), eAmf::Integer); ASSERT_EQ(array.Get("Double")->GetValueType(), eAmf::Double); ASSERT_EQ(array.GetArray("Array")->GetValueType(), eAmf::Array); - ASSERT_EQ(array.Get("Null")->GetValueType(), eAmf::Null); + ASSERT_EQ(array.Get("Null")->GetValueType(), eAmf::Null); ASSERT_EQ(array.Get>("Undefined")->GetValueType(), eAmf::Undefined); } @@ -101,6 +101,6 @@ TEST(dCommonTests, AMF3InsertionDenseTest) { ASSERT_EQ(array.Get(4)->GetValueType(), eAmf::Integer); ASSERT_EQ(array.Get(5)->GetValueType(), eAmf::Double); ASSERT_EQ(array.GetArray(6)->GetValueType(), eAmf::Array); - ASSERT_EQ(array.Get(7)->GetValueType(), eAmf::Null); + ASSERT_EQ(array.Get(7)->GetValueType(), eAmf::Null); ASSERT_EQ(array.Get>(8)->GetValueType(), eAmf::Undefined); } From 7d7ea68bf9af88cc0f8565f334912638e18edc65 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 22:23:32 -0500 Subject: [PATCH 64/74] fix preset --- CMakePresets.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakePresets.json b/CMakePresets.json index fa2b47aa5..63f59c7ad 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -127,7 +127,7 @@ }, { "name": "macos", - "inherits": "macos-config", + "inherits": "default", "displayName": "[Multi] MacOS", "description": "Create a build for MacOS", "condition": { From 368f4ccabf576f4dc00f16e0c25646f46c2182b7 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 6 Apr 2024 23:00:04 -0500 Subject: [PATCH 65/74] change defaults --- CMakeLists.txt | 2 +- CMakePresets.json | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 56b923162..91459f5f9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,7 +75,7 @@ if(UNIX) elseif(MSVC) # Skip warning for invalid conversion from size_t to uint32_t for all targets below for now # Also disable non-portable MSVC volatile behavior - add_compile_options("/wd4267" "/utf-8" "/volatile:iso") + add_compile_options("/wd4267" "/utf-8" "/volatile:iso" "/Zc:inline") elseif(WIN32) add_compile_definitions(_CRT_SECURE_NO_WARNINGS) endif() diff --git a/CMakePresets.json b/CMakePresets.json index 63f59c7ad..d1fd8c5ce 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -10,7 +10,7 @@ "name": "default", "displayName": "Default configure step", "description": "Use 'build' dir and Unix makefiles", - "binaryDir": "${sourceDir}/build/default", + "binaryDir": "${sourceDir}/build", "generator": "Unix Makefiles" }, { @@ -50,9 +50,6 @@ "type": "equals", "lhs": "${hostSystemName}", "rhs": "Windows" - }, - "cacheVariables": { - "CMAKE_CXX_FLAGS_INIT": "/Zc:inline" } }, { From 24d3bc0ce65776671ce850e4535d1c4110089372 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Mon, 8 Apr 2024 20:11:59 -0500 Subject: [PATCH 66/74] altered cmake configuration scripts --- CMakeLists.txt | 48 ++++++++++++++++++------------ cmake/toolchains/linux-clang.cmake | 4 +-- cmake/toolchains/linux-gnu.cmake | 8 ++--- dMasterServer/CMakeLists.txt | 2 +- thirdparty/CMakeLists.txt | 2 +- 5 files changed, 37 insertions(+), 27 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 91459f5f9..a03b7e417 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,9 +1,14 @@ cmake_minimum_required(VERSION 3.25) -project(Darkflame) +project(Darkflame + HOMEPAGE_URL "https://github.com/DarkflameUniverse/DarkflameServer" + LANGUAGES C CXX +) include(CTest) +set(CMAKE_C_STANDARD 99) set(CMAKE_CXX_STANDARD 20) -set(CXX_STANDARD_REQUIRED ON) +set(CMAKE_C_STANDARD_REQUIRED ON) +set(CMAKE_CXX_STANDARD_REQUIRED ON) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) # Export the compile commands for debugging set(CMAKE_POLICY_DEFAULT_CMP0063 NEW) # Set CMAKE visibility policy to NEW on project and subprojects set(CMAKE_VISIBILITY_INLINES_HIDDEN ON) # Set C and C++ symbol visibility to hide inlined functions @@ -55,23 +60,21 @@ set(RECASTNAVIGATION_EXAMPLES OFF CACHE BOOL "" FORCE) # Disabled no-register # Disabled unknown pragmas because Linux doesn't understand Windows pragmas. if(UNIX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wuninitialized -fPIC") + add_compile_options("-fPIC") add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0 _GLIBCXX_USE_CXX17_ABI=0) # 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") + add_compile_options("-static-libgcc" "-lstdc++fs") endif() if(${DYNAMIC} AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -rdynamic") + add_compile_options("-rdynamic") endif() if(${GGDB}) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb") + add_compile_options("-ggdb") endif() - - 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 # Also disable non-portable MSVC volatile behavior @@ -231,14 +234,15 @@ include_directories( "tests/dGameTests" "tests/dGameTests/dComponentsTests" - SYSTEM "thirdparty/magic_enum/include/magic_enum" - SYSTEM "thirdparty/raknet/Source" - SYSTEM "thirdparty/tinyxml2" - SYSTEM "thirdparty/recastnavigation" - SYSTEM "thirdparty/SQLite" - SYSTEM "thirdparty/cpplinq" - SYSTEM "thirdparty/cpp-httplib" - SYSTEM "thirdparty/MD5" + SYSTEM + "thirdparty/magic_enum/include/magic_enum" + "thirdparty/raknet/Source" + "thirdparty/tinyxml2" + "thirdparty/recastnavigation" + "thirdparty/SQLite" + "thirdparty/cpplinq" + "thirdparty/cpp-httplib" + "thirdparty/MD5" ) # Add system specfic includes for Apple, Windows and Other Unix OS' (including Linux) @@ -247,10 +251,16 @@ if(APPLE) include_directories("/usr/local/include/") endif() -# Add linking directories: -if (UNIX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wold-style-cast -Werror") # Warning flags +# Set warning flags +if(MSVC) + add_compile_options("/WX") +elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") + add_compile_options("-Wuninitialized" "-Wold-style-cast" "-Werror") +else() + message(WARNING "Unknown compiler: '${CMAKE_CXX_COMPILER_ID}' No warning flags enabled.") endif() + +# Add linking directories: file( GLOB HEADERS_DZONEMANAGER LIST_DIRECTORIES false diff --git a/cmake/toolchains/linux-clang.cmake b/cmake/toolchains/linux-clang.cmake index abcd681c3..63bf92fce 100644 --- a/cmake/toolchains/linux-clang.cmake +++ b/cmake/toolchains/linux-clang.cmake @@ -3,8 +3,8 @@ find_program(CLANG_C_COMPILER clang-16 | clang REQUIRED) find_program(CLANG_CXX_COMPILER clang++-16 | clang++ REQUIRED) # Debug messages -message("CLANG_C_COMPILER = ${CLANG_C_COMPILER}") -message("CLANG_CXX_COMPILER = ${CLANG_CXX_COMPILER}") +message(DEBUG "CLANG_C_COMPILER = ${CLANG_C_COMPILER}") +message(DEBUG "CLANG_CXX_COMPILER = ${CLANG_CXX_COMPILER}") # Set compilers to clang set(CMAKE_C_COMPILER ${CLANG_C_COMPILER}) diff --git a/cmake/toolchains/linux-gnu.cmake b/cmake/toolchains/linux-gnu.cmake index d55af82f7..7a60c81f9 100644 --- a/cmake/toolchains/linux-gnu.cmake +++ b/cmake/toolchains/linux-gnu.cmake @@ -1,10 +1,10 @@ # Try and find a gcc/g++ install -find_program(GNU_C_COMPILER gcc REQUIRED) -find_program(GNU_CXX_COMPILER g++ REQUIRED) +find_program(GNU_C_COMPILER cc | gcc REQUIRED) +find_program(GNU_CXX_COMPILER c++ | g++ REQUIRED) # Debug messages -message("GNU_C_COMPILER = ${GNU_C_COMPILER}") -message("GNU_CXX_COMPILER = ${GNU_C_COMPILER}") +message(DEBUG "GNU_C_COMPILER = ${GNU_C_COMPILER}") +message(DEBUG "GNU_CXX_COMPILER = ${GNU_C_COMPILER}") # Set compilers to clang set(CMAKE_C_COMPILER ${GNU_C_COMPILER}) diff --git a/dMasterServer/CMakeLists.txt b/dMasterServer/CMakeLists.txt index 260e4f16a..2e2b4dd9d 100644 --- a/dMasterServer/CMakeLists.txt +++ b/dMasterServer/CMakeLists.txt @@ -6,7 +6,7 @@ set(DMASTERSERVER_SOURCES add_library(dMasterServer ${DMASTERSERVER_SOURCES}) add_executable(MasterServer "MasterServer.cpp") -add_compile_definitions(MasterServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}\"") +target_compile_definitions(MasterServer PRIVATE PROJECT_VERSION="\"${PROJECT_VERSION}\"") target_include_directories(dMasterServer PUBLIC "." "${PROJECT_SOURCE_DIR}/dZoneManager" # InstanceManager.h uses dZMCommon.h ${PROJECT_SOURCE_DIR}/dServer/ # BinaryPathFinder.h diff --git a/thirdparty/CMakeLists.txt b/thirdparty/CMakeLists.txt index 55dd10be3..79863a53b 100644 --- a/thirdparty/CMakeLists.txt +++ b/thirdparty/CMakeLists.txt @@ -24,7 +24,7 @@ if(NOT WIN32) endif() # Need to define this on Clang and GNU for 'strdup' support -if(CMAKE_CXX_COMPILER_ID STREQUAL "Clang" OR CMAKE_CXX_COMPILER_ID STREQUAL "GNU") +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") target_compile_definitions(bcrypt PRIVATE "_POSIX_C_SOURCE=200809L") endif() From 7eae64f8a6caa1462ce285ef1f55109a1aa5d5db Mon Sep 17 00:00:00 2001 From: jadebenn Date: Mon, 8 Apr 2024 20:18:46 -0500 Subject: [PATCH 67/74] disable /WX on MSVC --- CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index a03b7e417..b46503fcd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -253,7 +253,7 @@ endif() # Set warning flags if(MSVC) - add_compile_options("/WX") + add_compile_options("/W4") elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") add_compile_options("-Wuninitialized" "-Wold-style-cast" "-Werror") else() From 39a8029fdabd4787394ae185b84340cda6561af2 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Mon, 8 Apr 2024 20:30:06 -0500 Subject: [PATCH 68/74] update github actions --- .github/workflows/build-and-test.yml | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 3e45273d1..906115bfc 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -16,7 +16,7 @@ jobs: os: [ windows-2022, ubuntu-22.04, macos-13 ] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: true - name: Add msbuild to PATH (Windows only) @@ -35,17 +35,17 @@ jobs: with: workflowPreset: "ci-${{matrix.os}}" - name: artifacts - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: build-${{matrix.os}} path: | - build/*Server* - build/*.ini - build/*.so - build/*.dll - build/vanity/ - build/navmeshes/ - build/migrations/ - build/*.dcf - !build/*.pdb - !build/d*/ + build/*/*Server* + build/*/*.ini + build/*/*.so + build/*/*.dll + build/*/vanity/ + build/*/navmeshes/ + build/*/migrations/ + build/*/*.dcf + !build/*/*.pdb + !build/*/d*/ From 553740e8a0a899e8c261501e6c24f3f27b951ccc Mon Sep 17 00:00:00 2001 From: jadebenn Date: Mon, 8 Apr 2024 21:38:34 -0500 Subject: [PATCH 69/74] update build presets --- .github/workflows/build-and-test.yml | 2 +- CMakePresets.json | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 906115bfc..9c7341666 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -21,7 +21,7 @@ jobs: submodules: true - name: Add msbuild to PATH (Windows only) if: ${{ matrix.os == 'windows-2022' }} - uses: microsoft/setup-msbuild@v1.1 + uses: microsoft/setup-msbuild@v2 with: vs-version: '[17,18)' msbuild-architecture: x64 diff --git a/CMakePresets.json b/CMakePresets.json index d1fd8c5ce..3f66e50ff 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -64,8 +64,7 @@ "rhs": "Windows" }, "architecture": { - "value": "x64", - "strategy": "external" + "value": "x64" } }, { From 7f9fcb5b758c697d9ea75bb5cfb1720e000670d5 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Mon, 8 Apr 2024 22:10:01 -0500 Subject: [PATCH 70/74] change gnu and clang build directories to enable consistent artifact generation --- CMakePresets.json | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 3f66e50ff..83a3f639d 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -86,7 +86,7 @@ ], "displayName": "[Debug] Linux (Clang)", "description": "Create a debug build using the Clang toolchain for Linux", - "binaryDir": "${sourceDir}/build/clang/debug" + "binaryDir": "${sourceDir}/build/clang-debug" }, { "name": "linux-clang-release", @@ -97,7 +97,7 @@ ], "displayName": "[Release] Linux (Clang)", "description": "Create a release build using the Clang toolchain for Linux", - "binaryDir": "${sourceDir}/build/clang/release" + "binaryDir": "${sourceDir}/build/clang-release" }, { "name": "linux-gnu-debug", @@ -108,7 +108,7 @@ ], "displayName": "[Debug] Linux (GNU)", "description": "Create a debug build using the GNU toolchain for Linux", - "binaryDir": "${sourceDir}/build/gnu/debug" + "binaryDir": "${sourceDir}/build/gnu-debug" }, { "name": "linux-gnu-release", @@ -119,7 +119,7 @@ ], "displayName": "[Release] Linux (GNU)", "description": "Create a release build using the GNU toolchain for Linux", - "binaryDir": "${sourceDir}/build/gnu/release" + "binaryDir": "${sourceDir}/build/gnu-release" }, { "name": "macos", From 6ccd72c6a901b39612b524a7bb7cebf3b38c085c Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 13 Apr 2024 17:48:58 -0500 Subject: [PATCH 71/74] add RelWithDebInfo presets and move -Werror flag into presets.json --- CMakeLists.txt | 4 +- CMakePresets.json | 174 +++++++++++++++++++++++++++++++ thirdparty/SQLite/CMakeLists.txt | 2 +- 3 files changed, 177 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b46503fcd..9e6a2cf7d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -255,9 +255,9 @@ endif() if(MSVC) add_compile_options("/W4") elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") - add_compile_options("-Wuninitialized" "-Wold-style-cast" "-Werror") + add_compile_options("-Wuninitialized" "-Wold-style-cast") else() - message(WARNING "Unknown compiler: '${CMAKE_CXX_COMPILER_ID}' No warning flags enabled.") + message(WARNING "Unknown compiler: '${CMAKE_CXX_COMPILER_ID}' - No warning flags enabled.") endif() # Add linking directories: diff --git a/CMakePresets.json b/CMakePresets.json index 83a3f639d..6bde8f3bf 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -20,6 +20,13 @@ "CMAKE_BUILD_TYPE": "Debug" } }, + { + "name": "relwithdebinfo-config", + "hidden": true, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo" + } + }, { "name": "release-config", "hidden": true, @@ -75,6 +82,9 @@ "type": "equals", "lhs": "${hostSystemName}", "rhs": "Linux" + }, + "cacheVariables": { + "CMAKE_CXX_FLAGS_INIT": "-Werror" } }, { @@ -88,6 +98,17 @@ "description": "Create a debug build using the Clang toolchain for Linux", "binaryDir": "${sourceDir}/build/clang-debug" }, + { + "name": "linux-clang-relwithdebinfo", + "inherits": [ + "linux-config", + "clang-config", + "relwithdebinfo-config" + ], + "displayName": "[RelWithDebInfo] Linux (Clang)", + "description": "Create a release build with debug info using the Clang toolchain for Linux", + "binaryDir": "${sourceDir}/build/clang-relwithdebinfo" + }, { "name": "linux-clang-release", "inherits": [ @@ -110,6 +131,17 @@ "description": "Create a debug build using the GNU toolchain for Linux", "binaryDir": "${sourceDir}/build/gnu-debug" }, + { + "name": "linux-gnu-relwithdebinfo", + "inherits": [ + "linux-config", + "gnu-config", + "relwithdebinfo-config" + ], + "displayName": "[RelWithDebInfo] Linux (GNU)", + "description": "Create a release build with debug info using the GNU toolchain for Linux", + "binaryDir": "${sourceDir}/build/gnu-relwithdebinfo" + }, { "name": "linux-gnu-release", "inherits": [ @@ -150,6 +182,14 @@ "configuration": "Debug", "jobs": 2 }, + { + "name": "windows-msvc-relwithdebinfo", + "configurePreset": "windows-msvc", + "displayName": "[RelWithDebInfo] Windows (MSVC)", + "description": "This preset is used to build in debug mode using the MSVC toolchain on Windows", + "configuration": "RelWithDebInfo", + "jobs": 2 + }, { "name": "windows-msvc-release", "configurePreset": "windows-msvc", @@ -166,6 +206,14 @@ "configuration": "Debug", "jobs": 2 }, + { + "name": "linux-clang-relwithdebinfo", + "configurePreset": "linux-clang-relwithdebinfo", + "displayName": "[RelWithDebInfo] Linux (Clang)", + "description": "This preset is used to build in release mode with debug info using the Clang toolchain on Linux", + "configuration": "RelWithDebInfo", + "jobs": 2 + }, { "name": "linux-clang-release", "configurePreset": "linux-clang-release", @@ -182,6 +230,14 @@ "configuration": "Debug", "jobs": 2 }, + { + "name": "linux-gnu-relwithdebinfo", + "configurePreset": "linux-gnu-relwithdebinfo", + "displayName": "[RelWithDebInfo] Linux (GNU)", + "description": "This preset is used to build in release mode with debug info using the GNU toolchain on Linux", + "configuration": "RelWithDebInfo", + "jobs": 2 + }, { "name": "linux-gnu-release", "configurePreset": "linux-gnu-release", @@ -195,6 +251,15 @@ "configurePreset": "macos", "displayName": "[Debug] MacOS", "description": "This preset is used to build in debug mode on MacOS", + "configuration": "Debug", + "jobs": 2 + }, + { + "name": "macos-relwithdebinfo", + "configurePreset": "macos", + "displayName": "[RelWithDebInfo] MacOS", + "description": "This preset is used to build in release mode with debug info on MacOS", + "configuration": "RelWithDebInfo", "jobs": 2 }, { @@ -202,6 +267,7 @@ "configurePreset": "macos", "displayName": "[Release] MacOS", "description": "This preset is used to build in release mode on MacOS", + "configuration": "Release", "jobs": 2 } ], @@ -235,6 +301,14 @@ "description": "Runs all tests on a Windows configuration", "configuration": "Debug" }, + { + "name": "windows-msvc-relwithdebinfo", + "inherits": "windows-msvc-test", + "configurePreset": "windows-msvc", + "displayName": "[RelWithDebInfo] Windows (MSVC)", + "description": "Runs all tests on a Windows configuration", + "configuration": "RelWithDebInfo" + }, { "name": "windows-msvc-release", "inherits": "windows-msvc-test", @@ -251,6 +325,14 @@ "description": "Runs all tests on a Linux Clang configuration", "configuration": "Release" }, + { + "name": "linux-clang-relwithdebinfo", + "inherits": "default", + "configurePreset": "linux-clang-relwithdebinfo", + "displayName": "[RelWithDebInfo] Linux (Clang)", + "description": "Runs all tests on a Linux Clang configuration", + "configuration": "RelWithDebInfo" + }, { "name": "linux-clang-release", "inherits": "default", @@ -267,6 +349,14 @@ "description": "Runs all tests on a Linux GNU configuration", "configuration": "Release" }, + { + "name": "linux-gnu-relwithdebinfo", + "inherits": "default", + "configurePreset": "linux-gnu-relwithdebinfo", + "displayName": "[RelWithDebInfo] Linux (GNU)", + "description": "Runs all tests on a Linux GNU configuration", + "configuration": "RelWithDebInfo" + }, { "name": "linux-gnu-release", "inherits": "default", @@ -283,6 +373,14 @@ "description": "Runs all tests on a MacOS configuration", "configuration": "Debug" }, + { + "name": "macos-relwithdebinfo", + "inherits": "default", + "configurePreset": "macos", + "displayName": "[RelWithDebInfo] MacOS", + "description": "Runs all tests on a MacOS configuration", + "configuration": "RelWithDebInfo" + }, { "name": "macos-release", "inherits": "default", @@ -329,6 +427,25 @@ } ] }, + { + "name": "windows-msvc-relwithdebinfo", + "displayName": "[RelWithDebInfo] Windows (MSVC)", + "description": "MSVC release with debug info workflow preset for Windows", + "steps": [ + { + "type": "configure", + "name": "windows-msvc" + }, + { + "type": "build", + "name": "windows-msvc-relwithdebinfo" + }, + { + "type": "test", + "name": "windows-msvc-relwithdebinfo" + } + ] + }, { "name": "ci-windows-2022", "displayName": "[Release] Windows (MSVC)", @@ -367,6 +484,25 @@ } ] }, + { + "name": "linux-gnu-relwithdebinfo", + "displayName": "[RelWithDebInfo] Linux (GNU)", + "description": "GNU release with debug info workflow preset for Linux", + "steps": [ + { + "type": "configure", + "name": "linux-gnu-relwithdebinfo" + }, + { + "type": "build", + "name": "linux-gnu-relwithdebinfo" + }, + { + "type": "test", + "name": "linux-gnu-relwithdebinfo" + } + ] + }, { "name": "ci-ubuntu-22.04", "displayName": "[Release] Linux (GNU)", @@ -405,6 +541,25 @@ } ] }, + { + "name": "linux-clang-relwithdebinfo", + "displayName": "[RelWithDebInfo] Linux (Clang)", + "description": "Clang release with debug info workflow preset for Linux", + "steps": [ + { + "type": "configure", + "name": "linux-clang-relwithdebinfo" + }, + { + "type": "build", + "name": "linux-clang-relwithdebinfo" + }, + { + "type": "test", + "name": "linux-clang-relwithdebinfo" + } + ] + }, { "name": "linux-clang-release", "displayName": "[Release] Linux (Clang)", @@ -443,6 +598,25 @@ } ] }, + { + "name": "macos-relwithdebinfo", + "displayName": "[RelWithDebInfo] MacOS", + "description": "Release with debug info workflow preset for MacOS", + "steps": [ + { + "type": "configure", + "name": "macos" + }, + { + "type": "build", + "name": "macos-relwithdebinfo" + }, + { + "type": "test", + "name": "macos-relwithdebinfo" + } + ] + }, { "name": "ci-macos-13", "displayName": "[Release] MacOS", diff --git a/thirdparty/SQLite/CMakeLists.txt b/thirdparty/SQLite/CMakeLists.txt index 3aa066a42..e745c46aa 100644 --- a/thirdparty/SQLite/CMakeLists.txt +++ b/thirdparty/SQLite/CMakeLists.txt @@ -11,7 +11,7 @@ if(UNIX) # -Wno-unused-result -Wno-unknown-pragmas -fpermissive target_compile_options(sqlite3 PRIVATE) - if(NOT APPLE) + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") target_compile_options(sqlite3 PRIVATE "-Wno-return-local-addr" "-Wno-maybe-uninitialized") else() target_compile_options(sqlite3 PRIVATE "-Wno-return-stack-address" "-Wno-uninitialized" "-Wno-deprecated-declarations") From d7aa52a0fcd0db5225b5f807a59c2b63d16b7486 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 16 Nov 2024 21:03:37 -0600 Subject: [PATCH 72/74] use DLU_CONFIG_DIR envvar --- CMakeLists.txt | 28 +++++++++++------ CMakePresets.json | 78 +++++++++++++++++++++++------------------------ 2 files changed, 57 insertions(+), 49 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f705edf30..e12c10918 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -113,31 +113,39 @@ make_directory(${CMAKE_BINARY_DIR}/resServer) # Create a /logs directory make_directory(${CMAKE_BINARY_DIR}/logs) +# Get DLU config directory +if(DEFINED ENV{DLU_CONFIG_DIR}) + set(DLU_CONFIG_DIR $ENV{DLU_CONFIG_DIR}) +else() + set(DLU_CONFIG_DIR ${PROJECT_BINARY_DIR}) +endif() +message(STATUS "Variable: DLU_CONFIG_DIR = ${DLU_CONFIG_DIR}") + # Copy resource files on first build set(RESOURCE_FILES "sharedconfig.ini" "authconfig.ini" "chatconfig.ini" "worldconfig.ini" "masterconfig.ini" "blocklist.dcf") message(STATUS "Checking resource file integrity") include(Utils) -UpdateConfigOption(${PROJECT_BINARY_DIR}/authconfig.ini "port" "auth_server_port") -UpdateConfigOption(${PROJECT_BINARY_DIR}/chatconfig.ini "port" "chat_server_port") -UpdateConfigOption(${PROJECT_BINARY_DIR}/masterconfig.ini "port" "master_server_port") +UpdateConfigOption(${DLU_CONFIG_DIR}/authconfig.ini "port" "auth_server_port") +UpdateConfigOption(${DLU_CONFIG_DIR}/chatconfig.ini "port" "chat_server_port") +UpdateConfigOption(${DLU_CONFIG_DIR}/masterconfig.ini "port" "master_server_port") foreach(resource_file ${RESOURCE_FILES}) set(file_size 0) - if(EXISTS ${PROJECT_BINARY_DIR}/${resource_file}) - file(SIZE ${PROJECT_BINARY_DIR}/${resource_file} file_size) + if(EXISTS ${DLU_CONFIG_DIR}/${resource_file}) + file(SIZE ${DLU_CONFIG_DIR}/${resource_file} file_size) endif() if(${file_size} EQUAL 0) configure_file( - ${CMAKE_SOURCE_DIR}/resources/${resource_file} ${PROJECT_BINARY_DIR}/${resource_file} + ${CMAKE_SOURCE_DIR}/resources/${resource_file} ${DLU_CONFIG_DIR}/${resource_file} COPYONLY ) - message(STATUS "Moved " ${resource_file} " to project binary directory") + message(STATUS "Moved " ${resource_file} " to DLU config directory") elseif(resource_file MATCHES ".ini") message(STATUS "Checking " ${resource_file} " for missing config options") - file(READ ${PROJECT_BINARY_DIR}/${resource_file} current_file_contents) + file(READ ${DLU_CONFIG_DIR}/${resource_file} current_file_contents) string(REPLACE "\\\n" "" current_file_contents ${current_file_contents}) string(REPLACE "\n" ";" current_file_contents ${current_file_contents}) set(parsed_current_file_contents "") @@ -168,10 +176,10 @@ foreach(resource_file ${RESOURCE_FILES}) set(line_to_add ${line_to_add} ${line}) foreach(line_to_append ${line_to_add}) - file(APPEND ${PROJECT_BINARY_DIR}/${resource_file} "\n" ${line_to_append}) + file(APPEND ${DLU_CONFIG_DIR}/${resource_file} "\n" ${line_to_append}) endforeach() - file(APPEND ${PROJECT_BINARY_DIR}/${resource_file} "\n") + file(APPEND ${DLU_CONFIG_DIR}/${resource_file} "\n") endif() set(line_to_add "") diff --git a/CMakePresets.json b/CMakePresets.json index 6bde8f3bf..9c236c238 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -11,6 +11,9 @@ "displayName": "Default configure step", "description": "Use 'build' dir and Unix makefiles", "binaryDir": "${sourceDir}/build", + "environment": { + "DLU_CONFIG_DIR": "${sourceDir}/build" + }, "generator": "Unix Makefiles" }, { @@ -82,9 +85,6 @@ "type": "equals", "lhs": "${hostSystemName}", "rhs": "Linux" - }, - "cacheVariables": { - "CMAKE_CXX_FLAGS_INIT": "-Werror" } }, { @@ -94,7 +94,7 @@ "clang-config", "debug-config" ], - "displayName": "[Debug] Linux (Clang)", + "displayName": "EXPERIMENTAL - [Debug] Linux (Clang)", "description": "Create a debug build using the Clang toolchain for Linux", "binaryDir": "${sourceDir}/build/clang-debug" }, @@ -105,7 +105,7 @@ "clang-config", "relwithdebinfo-config" ], - "displayName": "[RelWithDebInfo] Linux (Clang)", + "displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)", "description": "Create a release build with debug info using the Clang toolchain for Linux", "binaryDir": "${sourceDir}/build/clang-relwithdebinfo" }, @@ -116,7 +116,7 @@ "clang-config", "release-config" ], - "displayName": "[Release] Linux (Clang)", + "displayName": "EXPERIMENTAL - [Release] Linux (Clang)", "description": "Create a release build using the Clang toolchain for Linux", "binaryDir": "${sourceDir}/build/clang-release" }, @@ -176,99 +176,99 @@ }, { "name": "windows-msvc-debug", + "inherits": "default", "configurePreset": "windows-msvc", "displayName": "[Debug] Windows (MSVC)", "description": "This preset is used to build in debug mode using the MSVC toolchain on Windows", - "configuration": "Debug", - "jobs": 2 + "configuration": "Debug" }, { "name": "windows-msvc-relwithdebinfo", + "inherits": "default", "configurePreset": "windows-msvc", "displayName": "[RelWithDebInfo] Windows (MSVC)", "description": "This preset is used to build in debug mode using the MSVC toolchain on Windows", - "configuration": "RelWithDebInfo", - "jobs": 2 + "configuration": "RelWithDebInfo" }, { "name": "windows-msvc-release", + "inherits": "default", "configurePreset": "windows-msvc", "displayName": "[Release] Windows (MSVC)", "description": "This preset is used to build in release mode using the MSVC toolchain on Windows", - "configuration": "Release", - "jobs": 2 + "configuration": "Release" }, { "name": "linux-clang-debug", + "inherits": "default", "configurePreset": "linux-clang-debug", - "displayName": "[Debug] Linux (Clang)", + "displayName": "EXPERIMENTAL - [Debug] Linux (Clang)", "description": "This preset is used to build in debug mode using the Clang toolchain on Linux", - "configuration": "Debug", - "jobs": 2 + "configuration": "Debug" }, { "name": "linux-clang-relwithdebinfo", + "inherits": "default", "configurePreset": "linux-clang-relwithdebinfo", - "displayName": "[RelWithDebInfo] Linux (Clang)", + "displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)", "description": "This preset is used to build in release mode with debug info using the Clang toolchain on Linux", - "configuration": "RelWithDebInfo", - "jobs": 2 + "configuration": "RelWithDebInfo" }, { "name": "linux-clang-release", + "inherits": "default", "configurePreset": "linux-clang-release", - "displayName": "[Release] Linux (Clang)", + "displayName": "EXPERIMENTAL - [Release] Linux (Clang)", "description": "This preset is used to build in release mode using the Clang toolchain on Linux", - "configuration": "Release", - "jobs": 2 + "configuration": "Release" }, { "name": "linux-gnu-debug", + "inherits": "default", "configurePreset": "linux-gnu-debug", "displayName": "[Debug] Linux (GNU)", "description": "This preset is used to build in debug mode using the GNU toolchain on Linux", - "configuration": "Debug", - "jobs": 2 + "configuration": "Debug" }, { "name": "linux-gnu-relwithdebinfo", + "inherits": "default", "configurePreset": "linux-gnu-relwithdebinfo", "displayName": "[RelWithDebInfo] Linux (GNU)", "description": "This preset is used to build in release mode with debug info using the GNU toolchain on Linux", - "configuration": "RelWithDebInfo", - "jobs": 2 + "configuration": "RelWithDebInfo" }, { "name": "linux-gnu-release", + "inherits": "default", "configurePreset": "linux-gnu-release", "displayName": "[Release] Linux (GNU)", "description": "This preset is used to build in release mode using the GNU toolchain on Linux", - "configuration": "Release", - "jobs": 2 + "configuration": "Release" }, { "name": "macos-debug", + "inherits": "default", "configurePreset": "macos", "displayName": "[Debug] MacOS", "description": "This preset is used to build in debug mode on MacOS", - "configuration": "Debug", - "jobs": 2 + "configuration": "Debug" }, { "name": "macos-relwithdebinfo", + "inherits": "default", "configurePreset": "macos", "displayName": "[RelWithDebInfo] MacOS", "description": "This preset is used to build in release mode with debug info on MacOS", - "configuration": "RelWithDebInfo", - "jobs": 2 + "configuration": "RelWithDebInfo" }, { "name": "macos-release", + "inherits": "default", "configurePreset": "macos", "displayName": "[Release] MacOS", "description": "This preset is used to build in release mode on MacOS", - "configuration": "Release", - "jobs": 2 + "configuration": "Release" } ], "testPresets": [ @@ -321,7 +321,7 @@ "name": "linux-clang-debug", "inherits": "default", "configurePreset": "linux-clang-debug", - "displayName": "[Debug] Linux (Clang)", + "displayName": "EXPERIMENTAL - [Debug] Linux (Clang)", "description": "Runs all tests on a Linux Clang configuration", "configuration": "Release" }, @@ -329,7 +329,7 @@ "name": "linux-clang-relwithdebinfo", "inherits": "default", "configurePreset": "linux-clang-relwithdebinfo", - "displayName": "[RelWithDebInfo] Linux (Clang)", + "displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)", "description": "Runs all tests on a Linux Clang configuration", "configuration": "RelWithDebInfo" }, @@ -337,7 +337,7 @@ "name": "linux-clang-release", "inherits": "default", "configurePreset": "linux-clang-release", - "displayName": "[Release] Linux (Clang)", + "displayName": "EXPERIMENTAL - [Release] Linux (Clang)", "description": "Runs all tests on a Linux Clang configuration", "configuration": "Release" }, @@ -524,7 +524,7 @@ }, { "name": "linux-clang-debug", - "displayName": "[Debug] Linux (Clang)", + "displayName": "EXPERIMENTAL - [Debug] Linux (Clang)", "description": "Clang debug workflow preset for Linux", "steps": [ { @@ -543,7 +543,7 @@ }, { "name": "linux-clang-relwithdebinfo", - "displayName": "[RelWithDebInfo] Linux (Clang)", + "displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)", "description": "Clang release with debug info workflow preset for Linux", "steps": [ { @@ -562,7 +562,7 @@ }, { "name": "linux-clang-release", - "displayName": "[Release] Linux (Clang)", + "displayName": "EXPERIMENTAL - [Release] Linux (Clang)", "description": "Clang release workflow preset for Linux", "steps": [ { From 0e81c69de858809de72c97ef1aa285711b303938 Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 16 Nov 2024 21:11:04 -0600 Subject: [PATCH 73/74] CMakePresets indentation --- CMakePresets.json | 1276 ++++++++++++++++++++++----------------------- 1 file changed, 638 insertions(+), 638 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 9c236c238..37773c9f9 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -1,640 +1,640 @@ { - "version": 6, - "cmakeMinimumRequired": { - "major": 3, - "minor": 25, - "patch": 0 - }, - "configurePresets": [ - { - "name": "default", - "displayName": "Default configure step", - "description": "Use 'build' dir and Unix makefiles", - "binaryDir": "${sourceDir}/build", - "environment": { - "DLU_CONFIG_DIR": "${sourceDir}/build" - }, - "generator": "Unix Makefiles" - }, - { - "name": "debug-config", - "hidden": true, - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Debug" - } - }, - { - "name": "relwithdebinfo-config", - "hidden": true, - "cacheVariables": { - "CMAKE_BUILD_TYPE": "RelWithDebInfo" - } - }, - { - "name": "release-config", - "hidden": true, - "cacheVariables": { - "CMAKE_BUILD_TYPE": "Release" - } - }, - { - "name": "clang-config", - "hidden": true, - "toolchainFile": "${sourceDir}/cmake/toolchains/linux-clang.cmake" - }, - { - "name": "gnu-config", - "hidden": true, - "toolchainFile": "${sourceDir}/cmake/toolchains/linux-gnu.cmake" - }, - { - "name": "windows-msvc", - "displayName": "[Multi] Windows (MSVC)", - "description": "Set architecture to 64-bit (b/c RakNet)", - "generator": "Visual Studio 17 2022", - "binaryDir": "${sourceDir}/build/msvc", - "architecture": { - "value": "x64" - }, - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Windows" - } - }, - { - "name": "windows-default", - "inherits": "windows-msvc", - "displayName": "Windows only Configure Settings", - "description": "Sets build and install directories", - "generator": "Ninja", - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Windows" - }, - "architecture": { - "value": "x64" - } - }, - { - "name": "linux-config", - "inherits": "default", - "hidden": true, - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Linux" - } - }, - { - "name": "linux-clang-debug", - "inherits": [ - "linux-config", - "clang-config", - "debug-config" - ], - "displayName": "EXPERIMENTAL - [Debug] Linux (Clang)", - "description": "Create a debug build using the Clang toolchain for Linux", - "binaryDir": "${sourceDir}/build/clang-debug" - }, - { - "name": "linux-clang-relwithdebinfo", - "inherits": [ - "linux-config", - "clang-config", - "relwithdebinfo-config" - ], - "displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)", - "description": "Create a release build with debug info using the Clang toolchain for Linux", - "binaryDir": "${sourceDir}/build/clang-relwithdebinfo" - }, - { - "name": "linux-clang-release", - "inherits": [ - "linux-config", - "clang-config", - "release-config" - ], - "displayName": "EXPERIMENTAL - [Release] Linux (Clang)", - "description": "Create a release build using the Clang toolchain for Linux", - "binaryDir": "${sourceDir}/build/clang-release" - }, - { - "name": "linux-gnu-debug", - "inherits": [ - "linux-config", - "gnu-config", - "debug-config" - ], - "displayName": "[Debug] Linux (GNU)", - "description": "Create a debug build using the GNU toolchain for Linux", - "binaryDir": "${sourceDir}/build/gnu-debug" - }, - { - "name": "linux-gnu-relwithdebinfo", - "inherits": [ - "linux-config", - "gnu-config", - "relwithdebinfo-config" - ], - "displayName": "[RelWithDebInfo] Linux (GNU)", - "description": "Create a release build with debug info using the GNU toolchain for Linux", - "binaryDir": "${sourceDir}/build/gnu-relwithdebinfo" - }, - { - "name": "linux-gnu-release", - "inherits": [ - "linux-config", - "gnu-config", - "release-config" - ], - "displayName": "[Release] Linux (GNU)", - "description": "Create a release build using the GNU toolchain for Linux", - "binaryDir": "${sourceDir}/build/gnu-release" - }, - { - "name": "macos", - "inherits": "default", - "displayName": "[Multi] MacOS", - "description": "Create a build for MacOS", - "condition": { - "type": "equals", - "lhs": "${hostSystemName}", - "rhs": "Darwin" - }, - "binaryDir": "${sourceDir}/build/macos" - } - ], - "buildPresets": [ - { - "name": "default", - "configurePreset": "default", - "displayName": "Default Build", - "description": "Default Build", - "jobs": 2 - }, - { - "name": "windows-msvc-debug", - "inherits": "default", - "configurePreset": "windows-msvc", - "displayName": "[Debug] Windows (MSVC)", - "description": "This preset is used to build in debug mode using the MSVC toolchain on Windows", - "configuration": "Debug" - }, - { - "name": "windows-msvc-relwithdebinfo", - "inherits": "default", - "configurePreset": "windows-msvc", - "displayName": "[RelWithDebInfo] Windows (MSVC)", - "description": "This preset is used to build in debug mode using the MSVC toolchain on Windows", - "configuration": "RelWithDebInfo" - }, - { - "name": "windows-msvc-release", - "inherits": "default", - "configurePreset": "windows-msvc", - "displayName": "[Release] Windows (MSVC)", - "description": "This preset is used to build in release mode using the MSVC toolchain on Windows", - "configuration": "Release" - }, - { - "name": "linux-clang-debug", - "inherits": "default", - "configurePreset": "linux-clang-debug", - "displayName": "EXPERIMENTAL - [Debug] Linux (Clang)", - "description": "This preset is used to build in debug mode using the Clang toolchain on Linux", - "configuration": "Debug" - }, - { - "name": "linux-clang-relwithdebinfo", - "inherits": "default", - "configurePreset": "linux-clang-relwithdebinfo", - "displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)", - "description": "This preset is used to build in release mode with debug info using the Clang toolchain on Linux", - "configuration": "RelWithDebInfo" - }, - { - "name": "linux-clang-release", - "inherits": "default", - "configurePreset": "linux-clang-release", - "displayName": "EXPERIMENTAL - [Release] Linux (Clang)", - "description": "This preset is used to build in release mode using the Clang toolchain on Linux", - "configuration": "Release" - }, - { - "name": "linux-gnu-debug", - "inherits": "default", - "configurePreset": "linux-gnu-debug", - "displayName": "[Debug] Linux (GNU)", - "description": "This preset is used to build in debug mode using the GNU toolchain on Linux", - "configuration": "Debug" - }, - { - "name": "linux-gnu-relwithdebinfo", - "inherits": "default", - "configurePreset": "linux-gnu-relwithdebinfo", - "displayName": "[RelWithDebInfo] Linux (GNU)", - "description": "This preset is used to build in release mode with debug info using the GNU toolchain on Linux", - "configuration": "RelWithDebInfo" - }, - { - "name": "linux-gnu-release", - "inherits": "default", - "configurePreset": "linux-gnu-release", - "displayName": "[Release] Linux (GNU)", - "description": "This preset is used to build in release mode using the GNU toolchain on Linux", - "configuration": "Release" - }, - { - "name": "macos-debug", - "inherits": "default", - "configurePreset": "macos", - "displayName": "[Debug] MacOS", - "description": "This preset is used to build in debug mode on MacOS", - "configuration": "Debug" - }, - { - "name": "macos-relwithdebinfo", - "inherits": "default", - "configurePreset": "macos", - "displayName": "[RelWithDebInfo] MacOS", - "description": "This preset is used to build in release mode with debug info on MacOS", - "configuration": "RelWithDebInfo" - }, - { - "name": "macos-release", - "inherits": "default", - "configurePreset": "macos", - "displayName": "[Release] MacOS", - "description": "This preset is used to build in release mode on MacOS", - "configuration": "Release" - } - ], - "testPresets": [ - { - "name": "default", - "configurePreset": "default", - "execution": { - "jobs": 2 - }, - "output": { - "outputOnFailure": true - } - }, - { - "name": "windows-msvc-test", - "inherits": "default", - "configurePreset": "windows-msvc", - "hidden": true, - "filter": { - "exclude": { - "name": "((example)|(minigzip))+" - } - } - }, - { - "name": "windows-msvc-debug", - "inherits": "windows-msvc-test", - "configurePreset": "windows-msvc", - "displayName": "[Debug] Windows (MSVC)", - "description": "Runs all tests on a Windows configuration", - "configuration": "Debug" - }, - { - "name": "windows-msvc-relwithdebinfo", - "inherits": "windows-msvc-test", - "configurePreset": "windows-msvc", - "displayName": "[RelWithDebInfo] Windows (MSVC)", - "description": "Runs all tests on a Windows configuration", - "configuration": "RelWithDebInfo" - }, - { - "name": "windows-msvc-release", - "inherits": "windows-msvc-test", - "configurePreset": "windows-msvc", - "displayName": "[Release] Windows (MSVC)", - "description": "Runs all tests on a Windows configuration", - "configuration": "Release" - }, - { - "name": "linux-clang-debug", - "inherits": "default", - "configurePreset": "linux-clang-debug", - "displayName": "EXPERIMENTAL - [Debug] Linux (Clang)", - "description": "Runs all tests on a Linux Clang configuration", - "configuration": "Release" - }, - { - "name": "linux-clang-relwithdebinfo", - "inherits": "default", - "configurePreset": "linux-clang-relwithdebinfo", - "displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)", - "description": "Runs all tests on a Linux Clang configuration", - "configuration": "RelWithDebInfo" - }, - { - "name": "linux-clang-release", - "inherits": "default", - "configurePreset": "linux-clang-release", - "displayName": "EXPERIMENTAL - [Release] Linux (Clang)", - "description": "Runs all tests on a Linux Clang configuration", - "configuration": "Release" - }, - { - "name": "linux-gnu-debug", - "inherits": "default", - "configurePreset": "linux-gnu-debug", - "displayName": "[Debug] Linux (GNU)", - "description": "Runs all tests on a Linux GNU configuration", - "configuration": "Release" - }, - { - "name": "linux-gnu-relwithdebinfo", - "inherits": "default", - "configurePreset": "linux-gnu-relwithdebinfo", - "displayName": "[RelWithDebInfo] Linux (GNU)", - "description": "Runs all tests on a Linux GNU configuration", - "configuration": "RelWithDebInfo" - }, - { - "name": "linux-gnu-release", - "inherits": "default", - "configurePreset": "linux-gnu-release", - "displayName": "[Release] Linux (GNU)", - "description": "Runs all tests on a Linux GNU configuration", - "configuration": "Release" - }, - { - "name": "macos-debug", - "inherits": "default", - "configurePreset": "macos", - "displayName": "[Debug] MacOS", - "description": "Runs all tests on a MacOS configuration", - "configuration": "Debug" - }, - { - "name": "macos-relwithdebinfo", - "inherits": "default", - "configurePreset": "macos", - "displayName": "[RelWithDebInfo] MacOS", - "description": "Runs all tests on a MacOS configuration", - "configuration": "RelWithDebInfo" - }, - { - "name": "macos-release", - "inherits": "default", - "configurePreset": "macos", - "displayName": "[Release] MacOS", - "description": "Runs all tests on a MacOS configuration", - "configuration": "Release" - } - ], - "workflowPresets": [ - { - "name": "default", - "steps": [ - { - "type": "configure", - "name": "default" - }, - { - "type": "build", - "name": "default" - }, - { - "type": "test", - "name": "default" - } - ] - }, - { - "name": "windows-msvc-debug", - "displayName": "[Debug] Windows (MSVC)", - "description": "MSVC debug workflow preset for Windows", - "steps": [ - { - "type": "configure", - "name": "windows-msvc" - }, - { - "type": "build", - "name": "windows-msvc-debug" - }, - { - "type": "test", - "name": "windows-msvc-debug" - } - ] - }, - { - "name": "windows-msvc-relwithdebinfo", - "displayName": "[RelWithDebInfo] Windows (MSVC)", - "description": "MSVC release with debug info workflow preset for Windows", - "steps": [ - { - "type": "configure", - "name": "windows-msvc" - }, - { - "type": "build", - "name": "windows-msvc-relwithdebinfo" - }, - { - "type": "test", - "name": "windows-msvc-relwithdebinfo" - } - ] - }, - { - "name": "ci-windows-2022", - "displayName": "[Release] Windows (MSVC)", - "description": "CI workflow preset for Windows", - "steps": [ - { - "type": "configure", - "name": "windows-msvc" - }, - { - "type": "build", - "name": "windows-msvc-release" - }, - { - "type": "test", - "name": "windows-msvc-release" - } - ] - }, - { - "name": "linux-gnu-debug", - "displayName": "[Debug] Linux (GNU)", - "description": "GNU debug workflow preset for Linux", - "steps": [ - { - "type": "configure", - "name": "linux-gnu-debug" - }, - { - "type": "build", - "name": "linux-gnu-debug" - }, - { - "type": "test", - "name": "linux-gnu-debug" - } - ] - }, - { - "name": "linux-gnu-relwithdebinfo", - "displayName": "[RelWithDebInfo] Linux (GNU)", - "description": "GNU release with debug info workflow preset for Linux", - "steps": [ - { - "type": "configure", - "name": "linux-gnu-relwithdebinfo" - }, - { - "type": "build", - "name": "linux-gnu-relwithdebinfo" - }, - { - "type": "test", - "name": "linux-gnu-relwithdebinfo" - } - ] - }, - { - "name": "ci-ubuntu-22.04", - "displayName": "[Release] Linux (GNU)", - "description": "CI workflow preset for Ubuntu", - "steps": [ - { - "type": "configure", - "name": "linux-gnu-release" - }, - { - "type": "build", - "name": "linux-gnu-release" - }, - { - "type": "test", - "name": "linux-gnu-release" - } - ] - }, - { - "name": "linux-clang-debug", - "displayName": "EXPERIMENTAL - [Debug] Linux (Clang)", - "description": "Clang debug workflow preset for Linux", - "steps": [ - { - "type": "configure", - "name": "linux-clang-debug" - }, - { - "type": "build", - "name": "linux-clang-debug" - }, - { - "type": "test", - "name": "linux-clang-debug" - } - ] - }, - { - "name": "linux-clang-relwithdebinfo", - "displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)", - "description": "Clang release with debug info workflow preset for Linux", - "steps": [ - { - "type": "configure", - "name": "linux-clang-relwithdebinfo" - }, - { - "type": "build", - "name": "linux-clang-relwithdebinfo" - }, - { - "type": "test", - "name": "linux-clang-relwithdebinfo" - } - ] - }, - { - "name": "linux-clang-release", - "displayName": "EXPERIMENTAL - [Release] Linux (Clang)", - "description": "Clang release workflow preset for Linux", - "steps": [ - { - "type": "configure", - "name": "linux-clang-release" - }, - { - "type": "build", - "name": "linux-clang-release" - }, - { - "type": "test", - "name": "linux-clang-release" - } - ] - }, - { - "name": "macos-debug", - "displayName": "[Debug] MacOS", - "description": "Release workflow preset for MacOS", - "steps": [ - { - "type": "configure", - "name": "macos" - }, - { - "type": "build", - "name": "macos-debug" - }, - { - "type": "test", - "name": "macos-debug" - } - ] - }, - { - "name": "macos-relwithdebinfo", - "displayName": "[RelWithDebInfo] MacOS", - "description": "Release with debug info workflow preset for MacOS", - "steps": [ - { - "type": "configure", - "name": "macos" - }, - { - "type": "build", - "name": "macos-relwithdebinfo" - }, - { - "type": "test", - "name": "macos-relwithdebinfo" - } - ] - }, - { - "name": "ci-macos-13", - "displayName": "[Release] MacOS", - "description": "CI workflow preset for MacOS", - "steps": [ - { - "type": "configure", - "name": "macos" - }, - { - "type": "build", - "name": "macos-release" - }, - { - "type": "test", - "name": "macos-release" - } - ] - } - ] + "version": 6, + "cmakeMinimumRequired": { + "major": 3, + "minor": 25, + "patch": 0 + }, + "configurePresets": [ + { + "name": "default", + "displayName": "Default configure step", + "description": "Use 'build' dir and Unix makefiles"s, + "binaryDir": "${sourceDir}/build", + "environment": { + "DLU_CONFIG_DIR": "${sourceDir}/build" + }, + "generator": "Unix Makefiles" + }, + { + "name": "debug-config", + "hidden": true, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Debug" + } + }, + { + "name": "relwithdebinfo-config", + "hidden": true, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "RelWithDebInfo" + } + }, + { + "name": "release-config", + "hidden": true, + "cacheVariables": { + "CMAKE_BUILD_TYPE": "Release" + } + }, + { + "name": "clang-config", + "hidden": true, + "toolchainFile": "${sourceDir}/cmake/toolchains/linux-clang.cmake" + }, + { + "name": "gnu-config", + "hidden": true, + "toolchainFile": "${sourceDir}/cmake/toolchains/linux-gnu.cmake" + }, + { + "name": "windows-msvc", + "displayName": "[Multi] Windows (MSVC)", + "description": "Set architecture to 64-bit (b/c RakNet)", + "generator": "Visual Studio 17 2022", + "binaryDir": "${sourceDir}/build/msvc", + "architecture": { + "value": "x64" + }, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + } + }, + { + "name": "windows-default", + "inherits": "windows-msvc", + "displayName": "Windows only Configure Settings", + "description": "Sets build and install directories", + "generator": "Ninja", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Windows" + }, + "architecture": { + "value": "x64" + } + }, + { + "name": "linux-config", + "inherits": "default", + "hidden": true, + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Linux" + } + }, + { + "name": "linux-clang-debug", + "inherits": [ + "linux-config", + "clang-config", + "debug-config" + ], + "displayName": "EXPERIMENTAL - [Debug] Linux (Clang)", + "description": "Create a debug build using the Clang toolchain for Linux", + "binaryDir": "${sourceDir}/build/clang-debug" + }, + { + "name": "linux-clang-relwithdebinfo", + "inherits": [ + "linux-config", + "clang-config", + "relwithdebinfo-config" + ], + "displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)", + "description": "Create a release build with debug info using the Clang toolchain for Linux", + "binaryDir": "${sourceDir}/build/clang-relwithdebinfo" + }, + { + "name": "linux-clang-release", + "inherits": [ + "linux-config", + "clang-config", + "release-config" + ], + "displayName": "EXPERIMENTAL - [Release] Linux (Clang)", + "description": "Create a release build using the Clang toolchain for Linux", + "binaryDir": "${sourceDir}/build/clang-release" + }, + { + "name": "linux-gnu-debug", + "inherits": [ + "linux-config", + "gnu-config", + "debug-config" + ], + "displayName": "[Debug] Linux (GNU)", + "description": "Create a debug build using the GNU toolchain for Linux", + "binaryDir": "${sourceDir}/build/gnu-debug" + }, + { + "name": "linux-gnu-relwithdebinfo", + "inherits": [ + "linux-config", + "gnu-config", + "relwithdebinfo-config" + ], + "displayName": "[RelWithDebInfo] Linux (GNU)", + "description": "Create a release build with debug info using the GNU toolchain for Linux", + "binaryDir": "${sourceDir}/build/gnu-relwithdebinfo" + }, + { + "name": "linux-gnu-release", + "inherits": [ + "linux-config", + "gnu-config", + "release-config" + ], + "displayName": "[Release] Linux (GNU)", + "description": "Create a release build using the GNU toolchain for Linux", + "binaryDir": "${sourceDir}/build/gnu-release" + }, + { + "name": "macos", + "inherits": "default", + "displayName": "[Multi] MacOS", + "description": "Create a build for MacOS", + "condition": { + "type": "equals", + "lhs": "${hostSystemName}", + "rhs": "Darwin" + }, + "binaryDir": "${sourceDir}/build/macos" + } + ], + "buildPresets": [ + { + "name": "default", + "configurePreset": "default", + "displayName": "Default Build", + "description": "Default Build", + "jobs": 2 + }, + { + "name": "windows-msvc-debug", + "inherits": "default", + "configurePreset": "windows-msvc", + "displayName": "[Debug] Windows (MSVC)", + "description": "This preset is used to build in debug mode using the MSVC toolchain on Windows", + "configuration": "Debug" + }, + { + "name": "windows-msvc-relwithdebinfo", + "inherits": "default", + "configurePreset": "windows-msvc", + "displayName": "[RelWithDebInfo] Windows (MSVC)", + "description": "This preset is used to build in debug mode using the MSVC toolchain on Windows", + "configuration": "RelWithDebInfo" + }, + { + "name": "windows-msvc-release", + "inherits": "default", + "configurePreset": "windows-msvc", + "displayName": "[Release] Windows (MSVC)", + "description": "This preset is used to build in release mode using the MSVC toolchain on Windows", + "configuration": "Release" + }, + { + "name": "linux-clang-debug", + "inherits": "default", + "configurePreset": "linux-clang-debug", + "displayName": "EXPERIMENTAL - [Debug] Linux (Clang)", + "description": "This preset is used to build in debug mode using the Clang toolchain on Linux", + "configuration": "Debug" + }, + { + "name": "linux-clang-relwithdebinfo", + "inherits": "default", + "configurePreset": "linux-clang-relwithdebinfo", + "displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)", + "description": "This preset is used to build in release mode with debug info using the Clang toolchain on Linux", + "configuration": "RelWithDebInfo" + }, + { + "name": "linux-clang-release", + "inherits": "default", + "configurePreset": "linux-clang-release", + "displayName": "EXPERIMENTAL - [Release] Linux (Clang)", + "description": "This preset is used to build in release mode using the Clang toolchain on Linux", + "configuration": "Release" + }, + { + "name": "linux-gnu-debug", + "inherits": "default", + "configurePreset": "linux-gnu-debug", + "displayName": "[Debug] Linux (GNU)", + "description": "This preset is used to build in debug mode using the GNU toolchain on Linux", + "configuration": "Debug" + }, + { + "name": "linux-gnu-relwithdebinfo", + "inherits": "default", + "configurePreset": "linux-gnu-relwithdebinfo", + "displayName": "[RelWithDebInfo] Linux (GNU)", + "description": "This preset is used to build in release mode with debug info using the GNU toolchain on Linux", + "configuration": "RelWithDebInfo" + }, + { + "name": "linux-gnu-release", + "inherits": "default", + "configurePreset": "linux-gnu-release", + "displayName": "[Release] Linux (GNU)", + "description": "This preset is used to build in release mode using the GNU toolchain on Linux", + "configuration": "Release" + }, + { + "name": "macos-debug", + "inherits": "default", + "configurePreset": "macos", + "displayName": "[Debug] MacOS", + "description": "This preset is used to build in debug mode on MacOS", + "configuration": "Debug" + }, + { + "name": "macos-relwithdebinfo", + "inherits": "default", + "configurePreset": "macos", + "displayName": "[RelWithDebInfo] MacOS", + "description": "This preset is used to build in release mode with debug info on MacOS", + "configuration": "RelWithDebInfo" + }, + { + "name": "macos-release", + "inherits": "default", + "configurePreset": "macos", + "displayName": "[Release] MacOS", + "description": "This preset is used to build in release mode on MacOS", + "configuration": "Release" + } + ], + "testPresets": [ + { + "name": "default", + "configurePreset": "default", + "execution": { + "jobs": 2 + }, + "output": { + "outputOnFailure": true + } + }, + { + "name": "windows-msvc-test", + "inherits": "default", + "configurePreset": "windows-msvc", + "hidden": true, + "filter": { + "exclude": { + "name": "((example)|(minigzip))+" + } + } + }, + { + "name": "windows-msvc-debug", + "inherits": "windows-msvc-test", + "configurePreset": "windows-msvc", + "displayName": "[Debug] Windows (MSVC)", + "description": "Runs all tests on a Windows configuration", + "configuration": "Debug" + }, + { + "name": "windows-msvc-relwithdebinfo", + "inherits": "windows-msvc-test", + "configurePreset": "windows-msvc", + "displayName": "[RelWithDebInfo] Windows (MSVC)", + "description": "Runs all tests on a Windows configuration", + "configuration": "RelWithDebInfo" + }, + { + "name": "windows-msvc-release", + "inherits": "windows-msvc-test", + "configurePreset": "windows-msvc", + "displayName": "[Release] Windows (MSVC)", + "description": "Runs all tests on a Windows configuration", + "configuration": "Release" + }, + { + "name": "linux-clang-debug", + "inherits": "default", + "configurePreset": "linux-clang-debug", + "displayName": "EXPERIMENTAL - [Debug] Linux (Clang)", + "description": "Runs all tests on a Linux Clang configuration", + "configuration": "Release" + }, + { + "name": "linux-clang-relwithdebinfo", + "inherits": "default", + "configurePreset": "linux-clang-relwithdebinfo", + "displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)", + "description": "Runs all tests on a Linux Clang configuration", + "configuration": "RelWithDebInfo" + }, + { + "name": "linux-clang-release", + "inherits": "default", + "configurePreset": "linux-clang-release", + "displayName": "EXPERIMENTAL - [Release] Linux (Clang)", + "description": "Runs all tests on a Linux Clang configuration", + "configuration": "Release" + }, + { + "name": "linux-gnu-debug", + "inherits": "default", + "configurePreset": "linux-gnu-debug", + "displayName": "[Debug] Linux (GNU)", + "description": "Runs all tests on a Linux GNU configuration", + "configuration": "Release" + }, + { + "name": "linux-gnu-relwithdebinfo", + "inherits": "default", + "configurePreset": "linux-gnu-relwithdebinfo", + "displayName": "[RelWithDebInfo] Linux (GNU)", + "description": "Runs all tests on a Linux GNU configuration", + "configuration": "RelWithDebInfo" + }, + { + "name": "linux-gnu-release", + "inherits": "default", + "configurePreset": "linux-gnu-release", + "displayName": "[Release] Linux (GNU)", + "description": "Runs all tests on a Linux GNU configuration", + "configuration": "Release" + }, + { + "name": "macos-debug", + "inherits": "default", + "configurePreset": "macos", + "displayName": "[Debug] MacOS", + "description": "Runs all tests on a MacOS configuration", + "configuration": "Debug" + }, + { + "name": "macos-relwithdebinfo", + "inherits": "default", + "configurePreset": "macos", + "displayName": "[RelWithDebInfo] MacOS", + "description": "Runs all tests on a MacOS configuration", + "configuration": "RelWithDebInfo" + }, + { + "name": "macos-release", + "inherits": "default", + "configurePreset": "macos", + "displayName": "[Release] MacOS", + "description": "Runs all tests on a MacOS configuration", + "configuration": "Release" + } + ], + "workflowPresets": [ + { + "name": "default", + "steps": [ + { + "type": "configure", + "name": "default" + }, + { + "type": "build", + "name": "default" + }, + { + "type": "test", + "name": "default" + } + ] + }, + { + "name": "windows-msvc-debug", + "displayName": "[Debug] Windows (MSVC)", + "description": "MSVC debug workflow preset for Windows", + "steps": [ + { + "type": "configure", + "name": "windows-msvc" + }, + { + "type": "build", + "name": "windows-msvc-debug" + }, + { + "type": "test", + "name": "windows-msvc-debug" + } + ] + }, + { + "name": "windows-msvc-relwithdebinfo", + "displayName": "[RelWithDebInfo] Windows (MSVC)", + "description": "MSVC release with debug info workflow preset for Windows", + "steps": [ + { + "type": "configure", + "name": "windows-msvc" + }, + { + "type": "build", + "name": "windows-msvc-relwithdebinfo" + }, + { + "type": "test", + "name": "windows-msvc-relwithdebinfo" + } + ] + }, + { + "name": "ci-windows-2022", + "displayName": "[Release] Windows (MSVC)", + "description": "CI workflow preset for Windows", + "steps": [ + { + "type": "configure", + "name": "windows-msvc" + }, + { + "type": "build", + "name": "windows-msvc-release" + }, + { + "type": "test", + "name": "windows-msvc-release" + } + ] + }, + { + "name": "linux-gnu-debug", + "displayName": "[Debug] Linux (GNU)", + "description": "GNU debug workflow preset for Linux", + "steps": [ + { + "type": "configure", + "name": "linux-gnu-debug" + }, + { + "type": "build", + "name": "linux-gnu-debug" + }, + { + "type": "test", + "name": "linux-gnu-debug" + } + ] + }, + { + "name": "linux-gnu-relwithdebinfo", + "displayName": "[RelWithDebInfo] Linux (GNU)", + "description": "GNU release with debug info workflow preset for Linux", + "steps": [ + { + "type": "configure", + "name": "linux-gnu-relwithdebinfo" + }, + { + "type": "build", + "name": "linux-gnu-relwithdebinfo" + }, + { + "type": "test", + "name": "linux-gnu-relwithdebinfo" + } + ] + }, + { + "name": "ci-ubuntu-22.04", + "displayName": "[Release] Linux (GNU)", + "description": "CI workflow preset for Ubuntu", + "steps": [ + { + "type": "configure", + "name": "linux-gnu-release" + }, + { + "type": "build", + "name": "linux-gnu-release" + }, + { + "type": "test", + "name": "linux-gnu-release" + } + ] + }, + { + "name": "linux-clang-debug", + "displayName": "EXPERIMENTAL - [Debug] Linux (Clang)", + "description": "Clang debug workflow preset for Linux", + "steps": [ + { + "type": "configure", + "name": "linux-clang-debug" + }, + { + "type": "build", + "name": "linux-clang-debug" + }, + { + "type": "test", + "name": "linux-clang-debug" + } + ] + }, + { + "name": "linux-clang-relwithdebinfo", + "displayName": "EXPERIMENTAL - [RelWithDebInfo] Linux (Clang)", + "description": "Clang release with debug info workflow preset for Linux", + "steps": [ + { + "type": "configure", + "name": "linux-clang-relwithdebinfo" + }, + { + "type": "build", + "name": "linux-clang-relwithdebinfo" + }, + { + "type": "test", + "name": "linux-clang-relwithdebinfo" + } + ] + }, + { + "name": "linux-clang-release", + "displayName": "EXPERIMENTAL - [Release] Linux (Clang)", + "description": "Clang release workflow preset for Linux", + "steps": [ + { + "type": "configure", + "name": "linux-clang-release" + }, + { + "type": "build", + "name": "linux-clang-release" + }, + { + "type": "test", + "name": "linux-clang-release" + } + ] + }, + { + "name": "macos-debug", + "displayName": "[Debug] MacOS", + "description": "Release workflow preset for MacOS", + "steps": [ + { + "type": "configure", + "name": "macos" + }, + { + "type": "build", + "name": "macos-debug" + }, + { + "type": "test", + "name": "macos-debug" + } + ] + }, + { + "name": "macos-relwithdebinfo", + "displayName": "[RelWithDebInfo] MacOS", + "description": "Release with debug info workflow preset for MacOS", + "steps": [ + { + "type": "configure", + "name": "macos" + }, + { + "type": "build", + "name": "macos-relwithdebinfo" + }, + { + "type": "test", + "name": "macos-relwithdebinfo" + } + ] + }, + { + "name": "ci-macos-13", + "displayName": "[Release] MacOS", + "description": "CI workflow preset for MacOS", + "steps": [ + { + "type": "configure", + "name": "macos" + }, + { + "type": "build", + "name": "macos-release" + }, + { + "type": "test", + "name": "macos-release" + } + ] + } + ] } From f4311e593faa00381a50e4ca363e0b6753cadb1d Mon Sep 17 00:00:00 2001 From: jadebenn Date: Sat, 16 Nov 2024 22:16:50 -0600 Subject: [PATCH 74/74] temp fix for MSVC debug builds --- CMakeLists.txt | 7 +++++-- CMakePresets.json | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index e12c10918..0d9d394b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -90,10 +90,12 @@ elseif(WIN32) endif() # Our output dir -set(CMAKE_BINARY_DIR ${PROJECT_BINARY_DIR}) #set(CMAKE_INCLUDE_CURRENT_DIR_IN_INTERFACE ON) # unfortunately, forces all libraries to be built in series, which will slow down the build process # TODO make this not have to override the build type directories +set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}) +set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}) +set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_DEBUG ${CMAKE_BINARY_DIR}) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR}) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR}) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELWITHDEBINFO ${CMAKE_BINARY_DIR}) @@ -267,7 +269,8 @@ endif() # Set warning flags if(MSVC) - add_compile_options("/W4") + # add_compile_options("/W4") + # Want to enable warnings eventually, but WAY too much noise right now elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang|GNU") add_compile_options("-Wuninitialized" "-Wold-style-cast") else() diff --git a/CMakePresets.json b/CMakePresets.json index 37773c9f9..c4595ed51 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -9,7 +9,7 @@ { "name": "default", "displayName": "Default configure step", - "description": "Use 'build' dir and Unix makefiles"s, + "description": "Use 'build' dir and Unix makefiles", "binaryDir": "${sourceDir}/build", "environment": { "DLU_CONFIG_DIR": "${sourceDir}/build" @@ -49,6 +49,7 @@ }, { "name": "windows-msvc", + "inherits": "default", "displayName": "[Multi] Windows (MSVC)", "description": "Set architecture to 64-bit (b/c RakNet)", "generator": "Visual Studio 17 2022",