diff options
author | GeckoEidechse <gecko.eidechse+git@pm.me> | 2024-01-03 23:21:07 +0100 |
---|---|---|
committer | GeckoEidechse <gecko.eidechse+git@pm.me> | 2024-01-03 23:21:07 +0100 |
commit | 877443b67b9f4c0d1a28bb1b882b4ad8727b0413 (patch) | |
tree | 4d4481ba463c4a4df2e76f6b30bbaf4552d6ffb3 | |
parent | 8abe43adae2aca339f530ad0ba2230ffab726391 (diff) | |
download | NorthstarLauncher-877443b67b9f4c0d1a28bb1b882b4ad8727b0413.tar.gz NorthstarLauncher-877443b67b9f4c0d1a28bb1b882b4ad8727b0413.zip |
temp: Commit formatting changes for testing CI
-rw-r--r-- | CMakeLists.txt | 27 | ||||
-rw-r--r-- | primedev/Launcher.cmake | 48 | ||||
-rw-r--r-- | primedev/Northstar.cmake | 347 | ||||
-rw-r--r-- | primedev/WSockProxy.cmake | 74 | ||||
-rw-r--r-- | primedev/cmake/Findlibcurl.cmake | 48 | ||||
-rw-r--r-- | primedev/cmake/Findminhook.cmake | 7 | ||||
-rw-r--r-- | primedev/cmake/Findminizip.cmake | 38 | ||||
-rw-r--r-- | primedev/cmake/Findspdlog.cmake | 7 | ||||
-rw-r--r-- | primedev/cmake/utils.cmake | 33 |
9 files changed, 337 insertions, 292 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 9bea0ce8..0516d098 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,10 +1,16 @@ cmake_minimum_required(VERSION 3.15) -project(Northstar CXX ASM_MASM) +project( + Northstar + CXX + ASM_MASM) if(NOT CMAKE_BUILD_TYPE) - set(CMAKE_BUILD_TYPE "Release" CACHE STRING - "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." FORCE) + set(CMAKE_BUILD_TYPE + "Release" + CACHE STRING + "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." + FORCE) endif() # Language specs @@ -15,16 +21,17 @@ set(CMAKE_VS_PLATFORM_TOOLSET v143) # This determines the real binary root directory set(NS_BINARY_DIR ${CMAKE_BINARY_DIR}/game) -# NOTE [Fifty]: Visual studio deems Build root with the value "${projectDir}" -# in CMakeSettings.json as invalid and defaults to using a temporary dir -# somewhere in %USER%/CMakeBuilds. To combat this we set it to "${projectDir}/build" -# and then link binaries in ${CMAKE_BINARY_DIR}/game. This means you can copy your -# game into ${CMAKE_BINARY_DIR}/game without it being cluttered up by cmake files. +# NOTE [Fifty]: Visual studio deems Build root with the value "${projectDir}" in CMakeSettings.json as invalid and +# defaults to using a temporary dir somewhere in %USER%/CMakeBuilds. To combat this we set it to "${projectDir}/build" +# and then link binaries in ${CMAKE_BINARY_DIR}/game. This means you can copy your game into ${CMAKE_BINARY_DIR}/game +# without it being cluttered up by cmake files. message(STATUS "NS: Building to ${NS_BINARY_DIR}") - -list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/primedev/cmake") +list( + APPEND + CMAKE_MODULE_PATH + "${CMAKE_CURRENT_SOURCE_DIR}/primedev/cmake") include(utils) include_directories(primedev) diff --git a/primedev/Launcher.cmake b/primedev/Launcher.cmake index 9edcf0e5..659d4791 100644 --- a/primedev/Launcher.cmake +++ b/primedev/Launcher.cmake @@ -1,33 +1,25 @@ # NorthstarLauncher -add_executable(NorthstarLauncher - "primelauncher/main.cpp" - "primelauncher/resources.rc" -) +add_executable(NorthstarLauncher "primelauncher/main.cpp" "primelauncher/resources.rc") -target_compile_definitions(NorthstarLauncher PRIVATE - UNICODE - _UNICODE -) +target_compile_definitions(NorthstarLauncher PRIVATE UNICODE _UNICODE) -target_link_libraries(NorthstarLauncher PRIVATE - shlwapi.lib - kernel32.lib - user32.lib - gdi32.lib - winspool.lib - comdlg32.lib - advapi32.lib - shell32.lib - ole32.lib - oleaut32.lib - uuid.lib - odbc32.lib - odbccp32.lib - WS2_32.lib -) +target_link_libraries( + NorthstarLauncher + PRIVATE shlwapi.lib + kernel32.lib + user32.lib + gdi32.lib + winspool.lib + comdlg32.lib + advapi32.lib + shell32.lib + ole32.lib + oleaut32.lib + uuid.lib + odbc32.lib + odbccp32.lib + WS2_32.lib) -set_target_properties(NorthstarLauncher PROPERTIES - RUNTIME_OUTPUT_DIRECTORY ${NS_BINARY_DIR} - LINK_FLAGS "/MANIFEST:NO /DEBUG /STACK:8000000" -) +set_target_properties(NorthstarLauncher PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${NS_BINARY_DIR} + LINK_FLAGS "/MANIFEST:NO /DEBUG /STACK:8000000") diff --git a/primedev/Northstar.cmake b/primedev/Northstar.cmake index 69db3d4e..39e2aa28 100644 --- a/primedev/Northstar.cmake +++ b/primedev/Northstar.cmake @@ -4,179 +4,182 @@ find_package(minhook REQUIRED) find_package(libcurl REQUIRED) find_package(minizip REQUIRED) -add_library(NorthstarDLL SHARED - "resources.rc" - "client/audio.cpp" - "client/audio.h" - "client/chatcommand.cpp" - "client/clientauthhooks.cpp" - "client/clientruihooks.cpp" - "client/clientvideooverrides.cpp" - "client/debugoverlay.cpp" - "client/demofixes.cpp" - "client/diskvmtfixes.cpp" - "client/languagehooks.cpp" - "client/latencyflex.cpp" - "client/localchatwriter.cpp" - "client/localchatwriter.h" - "client/modlocalisation.cpp" - "client/r2client.cpp" - "client/r2client.h" - "client/rejectconnectionfixes.cpp" - "config/profile.cpp" - "config/profile.h" - "core/convar/concommand.cpp" - "core/convar/concommand.h" - "core/convar/convar.cpp" - "core/convar/convar.h" - "core/convar/cvar.cpp" - "core/convar/cvar.h" - "core/filesystem/filesystem.cpp" - "core/filesystem/filesystem.h" - "core/filesystem/rpakfilesystem.cpp" - "core/filesystem/rpakfilesystem.h" - "core/math/bitbuf.h" - "core/math/bits.cpp" - "core/math/bits.h" - "core/math/color.cpp" - "core/math/color.h" - "core/math/vector.h" - "core/hooks.cpp" - "core/hooks.h" - "core/macros.h" - "core/memalloc.cpp" - "core/memalloc.h" - "core/memory.cpp" - "core/memory.h" - "core/sourceinterface.cpp" - "core/sourceinterface.h" - "core/structs.h" - "core/tier0.cpp" - "core/tier0.h" - "dedicated/dedicated.cpp" - "dedicated/dedicated.h" - "dedicated/dedicatedlogtoclient.cpp" - "dedicated/dedicatedlogtoclient.h" - "dedicated/dedicatedmaterialsystem.cpp" - "engine/host.cpp" - "engine/hoststate.cpp" - "engine/hoststate.h" - "engine/r2engine.cpp" - "engine/r2engine.h" - "engine/runframe.cpp" - "logging/crashhandler.cpp" - "logging/crashhandler.h" - "logging/logging.cpp" - "logging/logging.h" - "logging/loghooks.cpp" - "logging/loghooks.h" - "logging/sourceconsole.cpp" - "logging/sourceconsole.h" - "masterserver/masterserver.cpp" - "masterserver/masterserver.h" - "mods/autodownload/moddownloader.h" - "mods/autodownload/moddownloader.cpp" - "mods/compiled/kb_act.cpp" - "mods/compiled/modkeyvalues.cpp" - "mods/compiled/modpdef.cpp" - "mods/compiled/modscriptsrson.cpp" - "mods/modmanager.cpp" - "mods/modmanager.h" - "mods/modsavefiles.cpp" - "mods/modsavefiles.h" - "plugins/plugin_abi.h" - "plugins/pluginbackend.cpp" - "plugins/pluginbackend.h" - "plugins/plugins.cpp" - "plugins/plugins.h" - "scripts/client/clientchathooks.cpp" - "scripts/client/cursorposition.cpp" - "scripts/client/scriptbrowserhooks.cpp" - "scripts/client/scriptmainmenupromos.cpp" - "scripts/client/scriptmodmenu.cpp" - "scripts/client/scriptoriginauth.cpp" - "scripts/client/scriptserverbrowser.cpp" - "scripts/client/scriptservertoclientstringcommand.cpp" - "scripts/server/miscserverfixes.cpp" - "scripts/server/miscserverscript.cpp" - "scripts/server/scriptuserinfo.cpp" - "scripts/scriptdatatables.cpp" - "scripts/scripthttprequesthandler.cpp" - "scripts/scripthttprequesthandler.h" - "scripts/scriptjson.cpp" - "scripts/scriptjson.h" - "scripts/scriptutility.cpp" - "server/auth/bansystem.cpp" - "server/auth/bansystem.h" - "server/auth/serverauthentication.cpp" - "server/auth/serverauthentication.h" - "server/alltalk.cpp" - "server/buildainfile.cpp" - "server/r2server.cpp" - "server/r2server.h" - "server/serverchathooks.cpp" - "server/serverchathooks.h" - "server/servernethooks.cpp" - "server/serverpresence.cpp" - "server/serverpresence.h" - "shared/exploit_fixes/exploitfixes.cpp" - "shared/exploit_fixes/exploitfixes_lzss.cpp" - "shared/exploit_fixes/exploitfixes_utf8parser.cpp" - "shared/exploit_fixes/ns_limits.cpp" - "shared/exploit_fixes/ns_limits.h" - "shared/keyvalues.cpp" - "shared/keyvalues.h" - "shared/maxplayers.cpp" - "shared/maxplayers.h" - "shared/misccommands.cpp" - "shared/misccommands.h" - "shared/playlist.cpp" - "shared/playlist.h" - "squirrel/squirrel.cpp" - "squirrel/squirrel.h" - "squirrel/squirrelautobind.cpp" - "squirrel/squirrelautobind.h" - "squirrel/squirrelclasstypes.h" - "squirrel/squirreldatatypes.h" - "util/printcommands.cpp" - "util/printcommands.h" - "util/printmaps.cpp" - "util/printmaps.h" - "util/utils.cpp" - "util/utils.h" - "util/version.cpp" - "util/version.h" - "util/wininfo.cpp" - "util/wininfo.h" - "dllmain.cpp" - "dllmain.h" - "ns_version.h" -) +add_library( + NorthstarDLL SHARED + "resources.rc" + "client/audio.cpp" + "client/audio.h" + "client/chatcommand.cpp" + "client/clientauthhooks.cpp" + "client/clientruihooks.cpp" + "client/clientvideooverrides.cpp" + "client/debugoverlay.cpp" + "client/demofixes.cpp" + "client/diskvmtfixes.cpp" + "client/languagehooks.cpp" + "client/latencyflex.cpp" + "client/localchatwriter.cpp" + "client/localchatwriter.h" + "client/modlocalisation.cpp" + "client/r2client.cpp" + "client/r2client.h" + "client/rejectconnectionfixes.cpp" + "config/profile.cpp" + "config/profile.h" + "core/convar/concommand.cpp" + "core/convar/concommand.h" + "core/convar/convar.cpp" + "core/convar/convar.h" + "core/convar/cvar.cpp" + "core/convar/cvar.h" + "core/filesystem/filesystem.cpp" + "core/filesystem/filesystem.h" + "core/filesystem/rpakfilesystem.cpp" + "core/filesystem/rpakfilesystem.h" + "core/math/bitbuf.h" + "core/math/bits.cpp" + "core/math/bits.h" + "core/math/color.cpp" + "core/math/color.h" + "core/math/vector.h" + "core/hooks.cpp" + "core/hooks.h" + "core/macros.h" + "core/memalloc.cpp" + "core/memalloc.h" + "core/memory.cpp" + "core/memory.h" + "core/sourceinterface.cpp" + "core/sourceinterface.h" + "core/structs.h" + "core/tier0.cpp" + "core/tier0.h" + "dedicated/dedicated.cpp" + "dedicated/dedicated.h" + "dedicated/dedicatedlogtoclient.cpp" + "dedicated/dedicatedlogtoclient.h" + "dedicated/dedicatedmaterialsystem.cpp" + "engine/host.cpp" + "engine/hoststate.cpp" + "engine/hoststate.h" + "engine/r2engine.cpp" + "engine/r2engine.h" + "engine/runframe.cpp" + "logging/crashhandler.cpp" + "logging/crashhandler.h" + "logging/logging.cpp" + "logging/logging.h" + "logging/loghooks.cpp" + "logging/loghooks.h" + "logging/sourceconsole.cpp" + "logging/sourceconsole.h" + "masterserver/masterserver.cpp" + "masterserver/masterserver.h" + "mods/autodownload/moddownloader.h" + "mods/autodownload/moddownloader.cpp" + "mods/compiled/kb_act.cpp" + "mods/compiled/modkeyvalues.cpp" + "mods/compiled/modpdef.cpp" + "mods/compiled/modscriptsrson.cpp" + "mods/modmanager.cpp" + "mods/modmanager.h" + "mods/modsavefiles.cpp" + "mods/modsavefiles.h" + "plugins/plugin_abi.h" + "plugins/pluginbackend.cpp" + "plugins/pluginbackend.h" + "plugins/plugins.cpp" + "plugins/plugins.h" + "scripts/client/clientchathooks.cpp" + "scripts/client/cursorposition.cpp" + "scripts/client/scriptbrowserhooks.cpp" + "scripts/client/scriptmainmenupromos.cpp" + "scripts/client/scriptmodmenu.cpp" + "scripts/client/scriptoriginauth.cpp" + "scripts/client/scriptserverbrowser.cpp" + "scripts/client/scriptservertoclientstringcommand.cpp" + "scripts/server/miscserverfixes.cpp" + "scripts/server/miscserverscript.cpp" + "scripts/server/scriptuserinfo.cpp" + "scripts/scriptdatatables.cpp" + "scripts/scripthttprequesthandler.cpp" + "scripts/scripthttprequesthandler.h" + "scripts/scriptjson.cpp" + "scripts/scriptjson.h" + "scripts/scriptutility.cpp" + "server/auth/bansystem.cpp" + "server/auth/bansystem.h" + "server/auth/serverauthentication.cpp" + "server/auth/serverauthentication.h" + "server/alltalk.cpp" + "server/buildainfile.cpp" + "server/r2server.cpp" + "server/r2server.h" + "server/serverchathooks.cpp" + "server/serverchathooks.h" + "server/servernethooks.cpp" + "server/serverpresence.cpp" + "server/serverpresence.h" + "shared/exploit_fixes/exploitfixes.cpp" + "shared/exploit_fixes/exploitfixes_lzss.cpp" + "shared/exploit_fixes/exploitfixes_utf8parser.cpp" + "shared/exploit_fixes/ns_limits.cpp" + "shared/exploit_fixes/ns_limits.h" + "shared/keyvalues.cpp" + "shared/keyvalues.h" + "shared/maxplayers.cpp" + "shared/maxplayers.h" + "shared/misccommands.cpp" + "shared/misccommands.h" + "shared/playlist.cpp" + "shared/playlist.h" + "squirrel/squirrel.cpp" + "squirrel/squirrel.h" + "squirrel/squirrelautobind.cpp" + "squirrel/squirrelautobind.h" + "squirrel/squirrelclasstypes.h" + "squirrel/squirreldatatypes.h" + "util/printcommands.cpp" + "util/printcommands.h" + "util/printmaps.cpp" + "util/printmaps.h" + "util/utils.cpp" + "util/utils.h" + "util/version.cpp" + "util/version.h" + "util/wininfo.cpp" + "util/wininfo.h" + "dllmain.cpp" + "dllmain.h" + "ns_version.h") -target_link_libraries(NorthstarDLL PRIVATE - minhook - libcurl - minizip - WS2_32.lib - Crypt32.lib - Cryptui.lib - dbghelp.lib - Wldap32.lib - Normaliz.lib - Bcrypt.lib - version.lib -) +target_link_libraries( + NorthstarDLL + PRIVATE minhook + libcurl + minizip + WS2_32.lib + Crypt32.lib + Cryptui.lib + dbghelp.lib + Wldap32.lib + Normaliz.lib + Bcrypt.lib + version.lib) -target_precompile_headers(NorthstarDLL PRIVATE pch.h) +target_precompile_headers( + NorthstarDLL + PRIVATE + pch.h) -target_compile_definitions(NorthstarDLL PRIVATE - UNICODE - _UNICODE - CURL_STATICLIB -) +target_compile_definitions( + NorthstarDLL + PRIVATE UNICODE + _UNICODE + CURL_STATICLIB) -set_target_properties(NorthstarDLL PROPERTIES - RUNTIME_OUTPUT_DIRECTORY ${NS_BINARY_DIR} - OUTPUT_NAME Northstar - LINK_FLAGS "/MANIFEST:NO /DEBUG" -) +set_target_properties( + NorthstarDLL + PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${NS_BINARY_DIR} + OUTPUT_NAME Northstar + LINK_FLAGS "/MANIFEST:NO /DEBUG") diff --git a/primedev/WSockProxy.cmake b/primedev/WSockProxy.cmake index 84338bc7..0629adb2 100644 --- a/primedev/WSockProxy.cmake +++ b/primedev/WSockProxy.cmake @@ -2,44 +2,44 @@ find_package(minhook REQUIRED) -add_library(loader_wsock32_proxy SHARED - "wsockproxy/dllmain.cpp" - "wsockproxy/loader.cpp" - "wsockproxy/loader.h" - "wsockproxy/wsock32.asm" - "wsockproxy/wsock32.def" -) +add_library( + loader_wsock32_proxy SHARED + "wsockproxy/dllmain.cpp" + "wsockproxy/loader.cpp" + "wsockproxy/loader.h" + "wsockproxy/wsock32.asm" + "wsockproxy/wsock32.def") -target_link_libraries(loader_wsock32_proxy PRIVATE - minhook - mswsock.lib - ws2_32.lib - ShLwApi.lib - imagehlp.lib - dbghelp.lib - kernel32.lib - user32.lib - gdi32.lib - winspool.lib - comdlg32.lib - advapi32.lib - shell32.lib - ole32.lib - oleaut32.lib - uuid.lib - odbc32.lib - odbccp32.lib -) +target_link_libraries( + loader_wsock32_proxy + PRIVATE minhook + mswsock.lib + ws2_32.lib + ShLwApi.lib + imagehlp.lib + dbghelp.lib + kernel32.lib + user32.lib + gdi32.lib + winspool.lib + comdlg32.lib + advapi32.lib + shell32.lib + ole32.lib + oleaut32.lib + uuid.lib + odbc32.lib + odbccp32.lib) -target_precompile_headers(loader_wsock32_proxy PRIVATE wsockproxy/pch.h) +target_precompile_headers( + loader_wsock32_proxy + PRIVATE + wsockproxy/pch.h) -target_compile_definitions(loader_wsock32_proxy PRIVATE - UNICODE - _UNICODE -) +target_compile_definitions(loader_wsock32_proxy PRIVATE UNICODE _UNICODE) -set_target_properties(loader_wsock32_proxy PROPERTIES - RUNTIME_OUTPUT_DIRECTORY ${NS_BINARY_DIR}/bin/x64_retail - OUTPUT_NAME wsock32 - LINK_FLAGS "/MANIFEST:NO /DEBUG" -) +set_target_properties( + loader_wsock32_proxy + PROPERTIES RUNTIME_OUTPUT_DIRECTORY ${NS_BINARY_DIR}/bin/x64_retail + OUTPUT_NAME wsock32 + LINK_FLAGS "/MANIFEST:NO /DEBUG") diff --git a/primedev/cmake/Findlibcurl.cmake b/primedev/cmake/Findlibcurl.cmake index 6e158b95..346cd2b1 100644 --- a/primedev/cmake/Findlibcurl.cmake +++ b/primedev/cmake/Findlibcurl.cmake @@ -1,18 +1,36 @@ +if(NOT libcurl_FOUND) + check_init_submodule(${PROJECT_SOURCE_DIR}/primedev/thirdparty/libcurl) + set(BUILD_SHARED_LIBS + OFF + CACHE BOOL "Build shared libraries") + set(BUILD_CURL_EXE + OFF + CACHE BOOL "Build curl EXE") + set(HTTP_ONLY + ON + CACHE BOOL "Only build HTTP and HTTPS") + set(CURL_ENABLE_SSL + ON + CACHE BOOL "Enable SSL support") + set(CURL_USE_OPENSSL + OFF + CACHE BOOL "Disable OpenSSL") + set(CURL_USE_LIBSSH2 + OFF + CACHE BOOL "Disable libSSH2") + set(CURL_USE_SCHANNEL + ON + CACHE BOOL "Enable Secure Channel") + set(CURL_CA_BUNDLE + "none" + CACHE STRING "Disable CA Bundle") + set(CURL_CA_PATH + "none" + CACHE STRING "Disable CA Path") -if (NOT libcurl_FOUND) - check_init_submodule(${PROJECT_SOURCE_DIR}/primedev/thirdparty/libcurl) - - set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libraries") - set(BUILD_CURL_EXE OFF CACHE BOOL "Build curl EXE") - set(HTTP_ONLY ON CACHE BOOL "Only build HTTP and HTTPS") - set(CURL_ENABLE_SSL ON CACHE BOOL "Enable SSL support") - set(CURL_USE_OPENSSL OFF CACHE BOOL "Disable OpenSSL") - set(CURL_USE_LIBSSH2 OFF CACHE BOOL "Disable libSSH2") - set(CURL_USE_SCHANNEL ON CACHE BOOL "Enable Secure Channel") - set(CURL_CA_BUNDLE "none" CACHE STRING "Disable CA Bundle") - set(CURL_CA_PATH "none" CACHE STRING "Disable CA Path") - - add_subdirectory(${PROJECT_SOURCE_DIR}/primedev/thirdparty/libcurl libcurl) - set(libcurl_FOUND 1 PARENT_SCOPE) + add_subdirectory(${PROJECT_SOURCE_DIR}/primedev/thirdparty/libcurl libcurl) + set(libcurl_FOUND + 1 + PARENT_SCOPE) endif() diff --git a/primedev/cmake/Findminhook.cmake b/primedev/cmake/Findminhook.cmake index aaf66c92..155232a0 100644 --- a/primedev/cmake/Findminhook.cmake +++ b/primedev/cmake/Findminhook.cmake @@ -1,7 +1,6 @@ - if(NOT minhook_FOUND) - check_init_submodule(${PROJECT_SOURCE_DIR}/primedev/thirdparty/minhook) + check_init_submodule(${PROJECT_SOURCE_DIR}/primedev/thirdparty/minhook) - add_subdirectory(${PROJECT_SOURCE_DIR}/primedev/thirdparty/minhook minhook) - set(minhook_FOUND 1) + add_subdirectory(${PROJECT_SOURCE_DIR}/primedev/thirdparty/minhook minhook) + set(minhook_FOUND 1) endif() diff --git a/primedev/cmake/Findminizip.cmake b/primedev/cmake/Findminizip.cmake index ab48656a..5bb96224 100644 --- a/primedev/cmake/Findminizip.cmake +++ b/primedev/cmake/Findminizip.cmake @@ -1,16 +1,30 @@ - if(NOT minizip_FOUND) - check_init_submodule(${PROJECT_SOURCE_DIR}/primedev/thirdparty/minizip) + check_init_submodule(${PROJECT_SOURCE_DIR}/primedev/thirdparty/minizip) - set(MZ_ZLIB ON CACHE BOOL "Enable ZLIB compression, needed for DEFLATE") - set(MZ_BZIP2 OFF CACHE BOOL "Disable BZIP2 compression") - set(MZ_LZMA OFF CACHE BOOL "Disable LZMA & XZ compression") - set(MZ_PKCRYPT OFF CACHE BOOL "Disable PKWARE traditional encryption") - set(MZ_WZAES OFF CACHE BOOL "Disable WinZIP AES encryption") - set(MZ_ZSTD OFF CACHE BOOL "Disable ZSTD compression") - set(MZ_SIGNING OFF CACHE BOOL "Disable zip signing support") + set(MZ_ZLIB + ON + CACHE BOOL "Enable ZLIB compression, needed for DEFLATE") + set(MZ_BZIP2 + OFF + CACHE BOOL "Disable BZIP2 compression") + set(MZ_LZMA + OFF + CACHE BOOL "Disable LZMA & XZ compression") + set(MZ_PKCRYPT + OFF + CACHE BOOL "Disable PKWARE traditional encryption") + set(MZ_WZAES + OFF + CACHE BOOL "Disable WinZIP AES encryption") + set(MZ_ZSTD + OFF + CACHE BOOL "Disable ZSTD compression") + set(MZ_SIGNING + OFF + CACHE BOOL "Disable zip signing support") - add_subdirectory(${PROJECT_SOURCE_DIR}/primedev/thirdparty/minizip minizip) - set(minizip_FOUND 1 PARENT_SCOPE) + add_subdirectory(${PROJECT_SOURCE_DIR}/primedev/thirdparty/minizip minizip) + set(minizip_FOUND + 1 + PARENT_SCOPE) endif() - diff --git a/primedev/cmake/Findspdlog.cmake b/primedev/cmake/Findspdlog.cmake index 81596762..660e1950 100644 --- a/primedev/cmake/Findspdlog.cmake +++ b/primedev/cmake/Findspdlog.cmake @@ -1,7 +1,6 @@ - if(NOT spdlog_FOUND) - check_init_submodule(${PROJECT_SOURCE_DIR}/primedev/thirdparty/spdlog) + check_init_submodule(${PROJECT_SOURCE_DIR}/primedev/thirdparty/spdlog) - add_subdirectory(${PROJECT_SOURCE_DIR}/primedev/thirdparty/spdlog spdlog) - set(spdlog_FOUND 1) + add_subdirectory(${PROJECT_SOURCE_DIR}/primedev/thirdparty/spdlog spdlog) + set(spdlog_FOUND 1) endif() diff --git a/primedev/cmake/utils.cmake b/primedev/cmake/utils.cmake index d8450551..0255569f 100644 --- a/primedev/cmake/utils.cmake +++ b/primedev/cmake/utils.cmake @@ -1,24 +1,37 @@ - # Check if a dependency exist before trying to init git submodules function(check_init_submodule path) - file(GLOB DIR_CONTENT "${path}/*") - list(LENGTH DIR_CONTENT CONTENT_COUNT) - if (CONTENT_COUNT EQUAL 0) - if (NOT EXISTS "${PROJECT_SOURCE_DIR}/.git") + file( + GLOB + DIR_CONTENT + "${path}/*") + list( + LENGTH + DIR_CONTENT + CONTENT_COUNT) + if(CONTENT_COUNT + EQUAL + 0) + if(NOT + EXISTS + "${PROJECT_SOURCE_DIR}/.git") message(FATAL_ERROR "Failed to find third party dependency in '${path}'") endif() find_package(Git QUIET) - if (NOT Git_FOUND) + if(NOT Git_FOUND) message(FATAL_ERROR "Failed to find Git, third party dependency could not be setup at `${path}") endif() message(STATUS "Setting up dependencies as git submodules") - execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - RESULT_VARIABLE GIT_SUBMOD_RESULT) + execute_process( + COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive + WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} + RESULT_VARIABLE GIT_SUBMOD_RESULT) - if(NOT GIT_SUBMOD_RESULT EQUAL "0") + if(NOT + GIT_SUBMOD_RESULT + EQUAL + "0") message(FATAL_ERROR "Initializing Git submodules failed with ${GIT_SUBMOD_RESULT}") endif() endif() |