DarkflameServer/CMakeLists.txt

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

375 lines
12 KiB
CMake
Raw Normal View History

cmake_minimum_required(VERSION 3.25)
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
project(Darkflame
HOMEPAGE_URL "https://github.com/DarkflameUniverse/DarkflameServer"
LANGUAGES C CXX
)
# check if the path to the source directory contains a space
if("${CMAKE_SOURCE_DIR}" MATCHES " ")
message(FATAL_ERROR "The server cannot build in the path (" ${CMAKE_SOURCE_DIR} ") because it contains a space. Please move the server to a path without spaces.")
endif()
2022-01-03 15:00:21 +00:00
include(CTest)
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_STANDARD 20)
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
2024-03-27 05:10:39 +00:00
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
set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake")
2022-07-10 19:40:26 +00:00
# Read variables from file
FILE(READ "${CMAKE_SOURCE_DIR}/CMakeVariables.txt" variables)
string(REPLACE "\\\n" "" variables ${variables})
string(REPLACE "\n" ";" variables ${variables})
# Set the cmake variables, formatted as "VARIABLE #" in variables
foreach(variable ${variables})
# If the string contains a #, skip it
if(NOT "${variable}" MATCHES "#")
2022-07-18 09:01:43 +00:00
# Split the variable into name and value
string(REPLACE "=" ";" variable ${variable})
2022-07-18 09:01:43 +00:00
# Check that the length of the variable is 2 (name and value)
list(LENGTH variable length)
if(${length} EQUAL 2)
list(GET variable 0 variable_name)
list(GET variable 1 variable_value)
# Set the variable
set(${variable_name} ${variable_value})
message(STATUS "Variable: ${variable_name} = ${variable_value}")
endif()
endif()
endforeach()
# Set the version
set(PROJECT_VERSION "\"${PROJECT_VERSION_MAJOR}.${PROJECT_VERSION_MINOR}.${PROJECT_VERSION_PATCH}\"")
# Echo the version
message(STATUS "Version: ${PROJECT_VERSION}")
# Disable demo, tests and examples for recastNavigation. Turn these to ON if you want to use them
# This has to be done here to prevent a rare build error due to missing dependencies on the initial generations.
set(RECASTNAVIGATION_DEMO OFF CACHE BOOL "" FORCE)
set(RECASTNAVIGATION_TESTS OFF CACHE BOOL "" FORCE)
set(RECASTNAVIGATION_EXAMPLES OFF CACHE BOOL "" FORCE)
# Compiler flags:
# Disabled deprecated warnings as the MySQL includes have deprecated code in them.
# Disabled misleading indentation as DL_LinkedList from RakNet has a weird indent.
# Disabled no-register
# Disabled unknown pragmas because Linux doesn't understand Windows pragmas.
if(UNIX)
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
add_compile_options("-fPIC")
add_compile_definitions(_GLIBCXX_USE_CXX11_ABI=0 _GLIBCXX_USE_CXX17_ABI=0)
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
# For all except Clang and Apple Clang
if(NOT CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options("-static-libgcc" "-lstdc++fs")
endif()
if(${DYNAMIC} AND CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
add_compile_options("-rdynamic")
endif()
if(${GGDB})
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
add_compile_options("-ggdb")
endif()
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
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
add_compile_options("/wd4267" "/utf-8" "/volatile:iso" "/Zc:inline")
elseif(WIN32)
add_compile_definitions(_CRT_SECURE_NO_WARNINGS)
endif()
# Our output 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
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
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})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE ${CMAKE_BINARY_DIR})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR})
find_package(MariaDB)
2024-11-21 08:18:16 +00:00
# Fetch third party dependencies
include(FetchContent)
FetchContent_Declare(
backtrace
SYSTEM
GIT_REPOSITORY https://github.com/ianlancetaylor/libbacktrace.git
)
FetchContent_Declare(
magic_enum
SYSTEM
GIT_REPOSITORY https://github.com/Neargye/magic_enum.git
GIT_TAG v0.9.7
)
FetchContent_Declare(
tinyxml2
SYSTEM
GIT_REPOSITORY https://github.com/leethomason/tinyxml2.git
GIT_TAG 9.0.0
)
FetchContent_MakeAvailable(magic_enum tinyxml2)
include(CMakePrintHelpers)
cmake_print_properties(TARGETS magic_enum tinyxml2 PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES)
# Create a /resServer directory
make_directory(${CMAKE_BINARY_DIR}/resServer)
# Create a /logs directory
make_directory(${CMAKE_BINARY_DIR}/logs)
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
# 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}")
2022-07-18 09:01:43 +00:00
# Copy resource files on first build
2024-04-05 05:51:40 +00:00
set(RESOURCE_FILES "sharedconfig.ini" "authconfig.ini" "chatconfig.ini" "worldconfig.ini" "masterconfig.ini" "blocklist.dcf")
message(STATUS "Checking resource file integrity")
include(Utils)
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
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)
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
if(EXISTS ${DLU_CONFIG_DIR}/${resource_file})
file(SIZE ${DLU_CONFIG_DIR}/${resource_file} file_size)
endif()
if(${file_size} EQUAL 0)
configure_file(
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
${CMAKE_SOURCE_DIR}/resources/${resource_file} ${DLU_CONFIG_DIR}/${resource_file}
COPYONLY
)
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
message(STATUS "Moved " ${resource_file} " to DLU config directory")
elseif(resource_file MATCHES ".ini")
message(STATUS "Checking " ${resource_file} " for missing config options")
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
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 "")
# Remove comment lines so they do not interfere with the variable parsing
foreach(line ${current_file_contents})
string(FIND ${line} "#" is_comment)
if(NOT ${is_comment} EQUAL 0)
string(APPEND parsed_current_file_contents ${line})
endif()
endforeach()
file(READ ${CMAKE_SOURCE_DIR}/resources/${resource_file} depot_file_contents)
string(REPLACE "\\\n" "" depot_file_contents ${depot_file_contents})
string(REPLACE "\n" ";" depot_file_contents ${depot_file_contents})
set(line_to_add "")
foreach(line ${depot_file_contents})
string(FIND ${line} "#" is_comment)
if(NOT ${is_comment} EQUAL 0)
string(REPLACE "=" ";" line_split ${line})
list(GET line_split 0 variable_name)
if(NOT ${parsed_current_file_contents} MATCHES ${variable_name})
message(STATUS "Adding missing config option " ${variable_name} " to " ${resource_file})
set(line_to_add ${line_to_add} ${line})
foreach(line_to_append ${line_to_add})
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
file(APPEND ${DLU_CONFIG_DIR}/${resource_file} "\n" ${line_to_append})
endforeach()
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
file(APPEND ${DLU_CONFIG_DIR}/${resource_file} "\n")
endif()
set(line_to_add "")
else()
set(line_to_add ${line_to_add} ${line})
endif()
endforeach()
endif()
endforeach()
message(STATUS "Resource file integrity check complete")
# if navmeshes directory does not exist, create it
if(NOT EXISTS ${PROJECT_BINARY_DIR}/navmeshes)
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/navmeshes)
endif()
# Copy navmesh data on first build and extract it
configure_file(${CMAKE_SOURCE_DIR}/resources/navmeshes.zip ${PROJECT_BINARY_DIR}/navmeshes.zip COPYONLY)
file(ARCHIVE_EXTRACT INPUT ${PROJECT_BINARY_DIR}/navmeshes.zip DESTINATION ${PROJECT_BINARY_DIR}/navmeshes)
file(REMOVE ${PROJECT_BINARY_DIR}/navmeshes.zip)
# Copy vanity files on first build
set(VANITY_FILES "CREDITS.md" "INFO.md" "TESTAMENT.md" "root.xml" "dev-tribute.xml" "atm.xml" "demo.xml")
foreach(file ${VANITY_FILES})
configure_file("${CMAKE_SOURCE_DIR}/vanity/${file}" "${CMAKE_BINARY_DIR}/vanity/${file}" COPYONLY)
endforeach()
2022-07-10 19:40:26 +00:00
# Move our migrations for MasterServer to run
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/migrations/dlu/)
2022-07-10 19:40:26 +00:00
file(GLOB SQL_FILES ${CMAKE_SOURCE_DIR}/migrations/dlu/*.sql)
foreach(file ${SQL_FILES})
get_filename_component(file ${file} NAME)
configure_file(${CMAKE_SOURCE_DIR}/migrations/dlu/${file} ${PROJECT_BINARY_DIR}/migrations/dlu/${file})
endforeach()
file(MAKE_DIRECTORY ${PROJECT_BINARY_DIR}/migrations/cdserver/)
file(GLOB SQL_FILES ${CMAKE_SOURCE_DIR}/migrations/cdserver/*.sql)
foreach(file ${SQL_FILES})
get_filename_component(file ${file} NAME)
configure_file(${CMAKE_SOURCE_DIR}/migrations/cdserver/${file} ${PROJECT_BINARY_DIR}/migrations/cdserver/${file})
2022-07-10 19:40:26 +00:00
endforeach()
# Add system specfic includes for Apple, Windows and Other Unix OS' (including Linux)
if (APPLE)
include_directories("/usr/local/include/")
endif()
# Load all of our third party directories
add_subdirectory(thirdparty SYSTEM)
# Create our list of include directories
include_directories(
"dPhysics"
"dNavigation"
"dNet"
"tests"
"tests/dCommonTests"
"tests/dGameTests"
"tests/dGameTests/dComponentsTests"
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
SYSTEM
2024-11-21 08:18:16 +00:00
# "thirdparty/magic_enum/include/magic_enum"
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
"thirdparty/raknet/Source"
2024-11-21 08:18:16 +00:00
# "thirdparty/tinyxml2"
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
"thirdparty/recastnavigation"
"thirdparty/SQLite"
"thirdparty/cpplinq"
"thirdparty/cpp-httplib"
"thirdparty/MD5"
)
# Add system specfic includes for Apple, Windows and Other Unix OS' (including Linux)
# TODO: Should probably not do this.
if(APPLE)
include_directories("/usr/local/include/")
endif()
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
# Set warning flags
if(MSVC)
# 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()
message(WARNING "Unknown compiler: '${CMAKE_CXX_COMPILER_ID}' - No warning flags enabled.")
endif()
feat: Make use of CMake presets to enable easy switching between debug and release configurations on all platforms (#1439) * Add MSVC optimization flags * test moving flags to json * Update CMakePresets.json * testing * trying more variations on the flags * third test * testing if these even have any effect * ditto * final(?) try for now * ONE MORE TIME * trying 'init' flags instead * export the compile commands so I can see if they're having any effect * move out g++ O2 flag * add Linux debug preset * update CMake presets * edit macos presets * try adding build types back to mac * macos refuses to work :( * try using compiler flags for mac instead * fix typo in windows preset * build reorganization and experimental clang support * temporarily remove macos build for testing purposes * updated cmake workflows * unexclude toolchain dir * update .gitignore * fix build directory issue * edit build script * update cmake configs * attempted docker fix * try zero-initializinng this struct to solve docker issue * try fixing macos build * one last MacOS try for the night * try disabling an apple-specific build rule * more fiddling with mac test builds * try and narrow down the macos build failure cause * try stripping out all the custom macos test logic again * I'm really just throwing everything to the wall and seeing what sticks * more macos tinkering * implib * try manual link directory specification * save me * aaaaaaaaa * paths paths paths * Revert "paths paths paths" This reverts commit 9a7d86aa6c59e73de27fbcda2111f7a1472008f4. * Revert "aaaaaaaaa" This reverts commit 338279c396e7c4a78174929a0aaf5205f2c026e6. * Revert "save me" This reverts commit bd73aa21a9cd1625f7cf567ab5b56bde46c0af0e. * Revert "try manual link directory specification" This reverts commit 0c2d40632ee5df9c241532d8bf62de9969e47f51. * Revert "implib" This reverts commit d41349d6edada6a041c64971730eed1c51af14c5. * Revert "more macos tinkering" This reverts commit 829ec35b57983ad4444d90ab780fff95a8b47608. * Revert "I'm really just throwing everything to the wall and seeing what sticks" This reverts commit 1a05b027fe822a94e5a6b70e6c744623d6a98e61. * Revert "try stripping out all the custom macos test logic again" This reverts commit cc15a26ce80ff9cfec5f1a94b0c00c42e1832c55. * Revert "try and narrow down the macos build failure cause" This reverts commit 5fd86833fa6e421860496c3626415ab70c93a795. * Revert "more fiddling with mac test builds" This reverts commit 0f843c02c90b2aa5f0c211e19c47b00798c295c8. * Revert "try disabling an apple-specific build rule" This reverts commit 45ec66e97605e3ea5b0a76f6eed0ec6f955c1675. * back to debug messages * see if this re-breaks mac * are these messages actually somehow fixing the issue? * was not actually fixed * add debug messages (again) * debug try 2 * change runtime output dir * rename gcc to gnu * expand cmake presets * fix preset * change defaults * altered cmake configuration scripts * disable /WX on MSVC * update github actions * update build presets * change gnu and clang build directories to enable consistent artifact generation * add RelWithDebInfo presets and move -Werror flag into presets.json * use DLU_CONFIG_DIR envvar * CMakePresets indentation * temp fix for MSVC debug builds
2024-11-18 01:03:54 +00:00
# Add linking directories:
file(
GLOB HEADERS_DZONEMANAGER
LIST_DIRECTORIES false
${PROJECT_SOURCE_DIR}/dZoneManager/*.h
)
file(
GLOB HEADERS_DCOMMON
LIST_DIRECTORIES false
${PROJECT_SOURCE_DIR}/dCommon/*.h
)
file(
GLOB HEADERS_DGAME
LIST_DIRECTORIES false
${PROJECT_SOURCE_DIR}/dGame/Entity.h
${PROJECT_SOURCE_DIR}/dGame/dGameMessages/GameMessages.h
${PROJECT_SOURCE_DIR}/dGame/EntityManager.h
${PROJECT_SOURCE_DIR}/dScripts/CppScripts.h
)
# Add our library subdirectories for creation of the library object
add_subdirectory(dCommon)
add_subdirectory(dDatabase)
add_subdirectory(dChatFilter)
add_subdirectory(dNet)
add_subdirectory(dScripts) # Add for dGame to use
add_subdirectory(dGame)
add_subdirectory(dZoneManager)
add_subdirectory(dNavigation)
add_subdirectory(dPhysics)
add_subdirectory(dServer)
# Create a list of common libraries shared between all binaries
set(COMMON_LIBRARIES "dCommon" "dDatabase" "dNet" "raknet" "MariaDB::ConnCpp" "magic_enum")
# Add platform specific common libraries
if(UNIX)
set(COMMON_LIBRARIES ${COMMON_LIBRARIES} "dl" "pthread")
if(NOT APPLE AND ${INCLUDE_BACKTRACE})
set(COMMON_LIBRARIES ${COMMON_LIBRARIES} "backtrace")
endif()
endif()
# Include all of our binary directories
add_subdirectory(dWorldServer)
add_subdirectory(dAuthServer)
add_subdirectory(dChatServer)
add_subdirectory(dMasterServer) # Add MasterServer last so it can rely on the other binaries
target_precompile_headers(
dZoneManager PRIVATE
${HEADERS_DZONEMANAGER}
)
target_precompile_headers(
dCommon PRIVATE
${HEADERS_DCOMMON}
)
target_precompile_headers(
tinyxml2 PRIVATE
2024-11-21 08:18:16 +00:00
"$<$<COMPILE_LANGUAGE:CXX>:${tinyxml2_SOURCE_DIR}/tinyxml2.h>"
)
if(${ENABLE_TESTING})
add_subdirectory(tests)
endif()