From 37a57d00113bece5e74ffd613865ad75c1e5e719 Mon Sep 17 00:00:00 2001 From: David Carlier Date: Sat, 26 Mar 2022 15:05:08 +0000 Subject: [PATCH] Fix build for Haiku and a handful of other oses with the spirv-tools dependency. --- CMakeLists.txt | 4 ++++ lib/shaderc/third_party/spirv-tools/CMakeLists.txt | 6 ++++++ src/utils/mem_utils.hpp | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c42476411..81c51dd40 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -722,6 +722,10 @@ if (${CMAKE_SYSTEM_NAME} MATCHES "SunOS") target_link_libraries(supertuxkart nsl socket vorbisfile) endif() +if (${CMAKE_SYSTEM_NAME} MATCHES "Haiku") + target_link_libraries(supertuxkart vorbisfile) +endif() + if (USE_DNS_C) target_link_libraries(supertuxkart dnsc) else() diff --git a/lib/shaderc/third_party/spirv-tools/CMakeLists.txt b/lib/shaderc/third_party/spirv-tools/CMakeLists.txt index 8fbfb92b8..57f3ec65a 100644 --- a/lib/shaderc/third_party/spirv-tools/CMakeLists.txt +++ b/lib/shaderc/third_party/spirv-tools/CMakeLists.txt @@ -59,8 +59,14 @@ elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Android") set(SPIRV_TIMER_ENABLED ${SPIRV_ALLOW_TIMERS}) elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "FreeBSD") add_definitions(-DSPIRV_FREEBSD) +elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "OpenBSD") + add_definitions(-DSPIRV_OPENBSD) +elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "NetBSD") + add_definitions(-DSPIRV_NETBSD) elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Fuchsia") add_definitions(-DSPIRV_FUCHSIA) +elseif("${CMAKE_SYSTEM_NAME}" STREQUAL "Haiku") + add_definitions(-DSPIRV_HAIKU) else() message(FATAL_ERROR "Your platform '${CMAKE_SYSTEM_NAME}' is not supported!") endif() diff --git a/src/utils/mem_utils.hpp b/src/utils/mem_utils.hpp index 4aadca7e4..162aa8950 100644 --- a/src/utils/mem_utils.hpp +++ b/src/utils/mem_utils.hpp @@ -24,7 +24,7 @@ namespace MemUtils { callback cb; bool chg; public: - deref(callback _c) : cb(std::move(_c)) {} + deref(callback _c) : cb(std::move(_c)), chg(true) {} deref(const deref &) = delete; deref& operator=(const deref &) = delete; deref(deref &&other) :