diff --git a/CMakeLists.txt b/CMakeLists.txt index d63758e..c596caf 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,6 @@ cmake_minimum_required(VERSION 3.29) cmake_policy(SET CMP0067 NEW) -cmake_policy(SET CMP0155 OLD) project(ChatNotifier) diff --git a/cmake/0004-Fix-openal-cmake.patch b/cmake/0004-Fix-openal-cmake.patch new file mode 100644 index 0000000..6a02f0a --- /dev/null +++ b/cmake/0004-Fix-openal-cmake.patch @@ -0,0 +1,39 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index 12a2416d..97ad20a9 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -188,33 +188,10 @@ set(LIB_VERSION_NUM ${LIB_MAJOR_VERSION},${LIB_MINOR_VERSION},${LIB_REVISION},0) + + set(EXPORT_DECL "") + +- +-# Some systems erroneously require the __STDC_FORMAT_MACROS macro to be defined +-# to get the fixed-width integer type formatter macros. +-check_cxx_source_compiles("#include +-#include +-int main() +-{ +- int64_t i64{}; +- std::printf(\"%\" PRId64, i64); +-}" +-HAVE_STDC_FORMAT_MACROS) +-if(NOT HAVE_STDC_FORMAT_MACROS) +- set(CPP_DEFS ${CPP_DEFS} __STDC_FORMAT_MACROS) +-endif() +- + # Some systems may need libatomic for atomic functions to work + set(OLD_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES}) + set(CMAKE_REQUIRED_LIBRARIES ${OLD_REQUIRED_LIBRARIES} atomic) +-check_cxx_source_compiles("#include +-std::atomic foo{0}; +-int main() { return foo.fetch_add(2); }" +-HAVE_LIBATOMIC) +-if(NOT HAVE_LIBATOMIC) +- set(CMAKE_REQUIRED_LIBRARIES "${OLD_REQUIRED_LIBRARIES}") +-else() +- set(EXTRA_LIBS atomic ${EXTRA_LIBS}) +-endif() ++set(EXTRA_LIBS atomic ${EXTRA_LIBS}) + unset(OLD_REQUIRED_LIBRARIES) + + if(ANDROID) diff --git a/cmake/modules/FetchDeps.cmake b/cmake/modules/FetchDeps.cmake index 2e72198..057a3d0 100644 --- a/cmake/modules/FetchDeps.cmake +++ b/cmake/modules/FetchDeps.cmake @@ -69,10 +69,13 @@ set(ENABLE_CPACK OFF CACHE BOOL "" FORCE) # Fetch openal-soft message(STATUS "Fetching openal-soft") +set(ALSOFT_PATCH git apply "${PROJECT_SOURCE_DIR}/cmake/0004-Fix-openal-cmake.patch") FetchContent_Declare( openal-soft GIT_REPOSITORY "https://github.com/kcat/openal-soft.git" GIT_COMMIT "e39038317623c6282c3fd5685fcceaf3cc3137c7" + PATCH_COMMAND ${ALSOFT_PATCH} + UPDATE_DISCONNECTED 1 FIND_PACKAGE_ARGS ) # We don't care about the examples