From e72da8ad5fd93f0d20f68a5399d6175b6ace0180 Mon Sep 17 00:00:00 2001 From: "[ ]" <[ ]> Date: Tue, 6 May 2025 23:52:24 +0900 Subject: [PATCH] build: Fix building for spice2x-20230929 > resolve third party libraries not building > force include stdint.h in place of cstdint missing from windows.h now > to be reverted after updates to spice2x master --- .idea/runConfigurations/Deploy_Debug_x64_.xml | 1 + .idea/runConfigurations/Deploy_Debug_x86_.xml | 1 + .../runConfigurations/Deploy_Release_x64_.xml | 1 + .../runConfigurations/Deploy_Release_x86_.xml | 1 + CMakeLists.txt | 18 ++++++++++++++++++ cmake.sh | 8 ++++++++ external/discord-rpc/.clang-format | 1 - external/rapidjson/document.h | 2 -- 8 files changed, 30 insertions(+), 3 deletions(-) diff --git a/.idea/runConfigurations/Deploy_Debug_x64_.xml b/.idea/runConfigurations/Deploy_Debug_x64_.xml index 5361f38..d477afb 100644 --- a/.idea/runConfigurations/Deploy_Debug_x64_.xml +++ b/.idea/runConfigurations/Deploy_Debug_x64_.xml @@ -16,6 +16,7 @@ + diff --git a/.idea/runConfigurations/Deploy_Debug_x86_.xml b/.idea/runConfigurations/Deploy_Debug_x86_.xml index 8ab86bf..1a2615c 100644 --- a/.idea/runConfigurations/Deploy_Debug_x86_.xml +++ b/.idea/runConfigurations/Deploy_Debug_x86_.xml @@ -16,6 +16,7 @@ + diff --git a/.idea/runConfigurations/Deploy_Release_x64_.xml b/.idea/runConfigurations/Deploy_Release_x64_.xml index 8403f84..8b46ee9 100644 --- a/.idea/runConfigurations/Deploy_Release_x64_.xml +++ b/.idea/runConfigurations/Deploy_Release_x64_.xml @@ -16,6 +16,7 @@ + diff --git a/.idea/runConfigurations/Deploy_Release_x86_.xml b/.idea/runConfigurations/Deploy_Release_x86_.xml index 186636f..372b7a7 100644 --- a/.idea/runConfigurations/Deploy_Release_x86_.xml +++ b/.idea/runConfigurations/Deploy_Release_x86_.xml @@ -16,6 +16,7 @@ + diff --git a/CMakeLists.txt b/CMakeLists.txt index 2946fcd..d089335 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -670,3 +670,21 @@ set_target_properties(spicetools_spice64 spicetools_stubs_kbt64 spicetools_stubs ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/archive64" LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/spicetools/64" RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/spicetools/64") + +# force include (temporary) +function(target_force_include _target) + cmake_parse_arguments(_IFORCE "" "" "QUOTE;REL_PATH;ABS_PATH" ${ARGN}) + get_target_property(_path_root ${_target} SOURCE_DIR) + list(TRANSFORM _IFORCE_QUOTE PREPEND "SHELL:-include ") + list(TRANSFORM _IFORCE_REL_PATH PREPEND "SHELL:-include ${_path_root}/") + list(TRANSFORM _IFORCE_ABS_PATH PREPEND "SHELL:-include ") + target_compile_options(${_target} PRIVATE + ${_IFORCE_QUOTE} ${_IFORCE_REL_PATH} ${_IFORCE_ABS_PATH}) +endfunction() +target_force_include(spicetools_spice QUOTE stdint.h) +target_force_include(spicetools_stubs_kbt QUOTE stdint.h) +target_force_include(spicetools_stubs_kld QUOTE stdint.h) +target_force_include(spicetools_spice64 QUOTE stdint.h) +target_force_include(spicetools_stubs_kbt64 QUOTE stdint.h) +target_force_include(spicetools_stubs_kld64 QUOTE stdint.h) +target_force_include(spicetools_cfg QUOTE stdint.h) diff --git a/cmake.sh b/cmake.sh index 0c7e540..b920b0d 100755 --- a/cmake.sh +++ b/cmake.sh @@ -45,6 +45,7 @@ run_deploy_all() { source <(head -n +20 ./build_all.sh) # Run deploy in build_all.sh + set +e source <(tail -n +150 ./build_all.sh | head -n -3 | sed 's~.*pushd ${OUTDIR}/.. > /dev/null*~\tpushd ${OUTDIR} > /dev/null~') } @@ -57,6 +58,13 @@ run_distribute_all() { source <(tail -n +150 ./build_all.sh | head -n -3 | sed 's~.*pushd ${OUTDIR}/.. > /dev/null*~\tpushd ${OUTDIR} > /dev/null~') } +run_clion_init() { + # Init cmake.sh only + source <(sed -n '/__BUILDALLINIT__/{:a;n;/__BUILDALLINIT__/q;p;$!ba}' "$0") + + # Clion specific first-time setup +} + # Sanity checks [ -d "external/cmake-various/toolchain" ] || { echo "Toolchain not found" ; exit 1; } [ "$(md5sum ./build_all.sh | cut -c -32)" = "9a89bba3fa2435983e5bce423d0f4a61" ] || { echo "Version mismatch for build_all.sh " ; exit 1; } diff --git a/external/discord-rpc/.clang-format b/external/discord-rpc/.clang-format index 1be8390..0cceb2e 100644 --- a/external/discord-rpc/.clang-format +++ b/external/discord-rpc/.clang-format @@ -45,7 +45,6 @@ IncludeCategories: - Regex: '.*' Priority: 3 IncludeIsMainRegex: '(_test|_win|_linux|_mac|_ios|_osx|_null)?$' -IndentCaseLabels: false IndentWidth: 4 IndentWrappedFunctionNames: false KeepEmptyLinesAtTheStartOfBlocks: false diff --git a/external/rapidjson/document.h b/external/rapidjson/document.h index 151f5de..3b0acbf 100644 --- a/external/rapidjson/document.h +++ b/external/rapidjson/document.h @@ -323,8 +323,6 @@ struct GenericStringRef { GenericStringRef(const GenericStringRef& rhs) : s(rhs.s), length(rhs.length) {} - GenericStringRef& operator=(const GenericStringRef& rhs) { s = rhs.s; length = rhs.length; } - //! implicit conversion to plain CharType pointer operator const Ch *() const { return s; }