ags/ags-use-system-libraries.patch
Dominik 'Rathann' Mierzejewski fb80656b28 build tools and run tests
2025-10-08 16:13:02 +02:00

124 lines
5.1 KiB
Diff

diff -up ags-3.6.2.13/CMake/FindLocalOpenAL.cmake.orig ags-3.6.2.13/CMake/FindLocalOpenAL.cmake
--- ags-3.6.2.13/CMake/FindLocalOpenAL.cmake.orig 2025-09-04 10:13:12.000000000 +0200
+++ ags-3.6.2.13/CMake/FindLocalOpenAL.cmake 2025-10-08 14:38:31.897433814 +0200
@@ -1,6 +1,6 @@
# Grab system openAL or use embedded mojoAL
-if(WIN32 OR LINUX OR MACOS OR FREEBSD)
+if(WIN32 OR MACOS OR FREEBSD)
set(AGS_USE_MOJO_AL TRUE)
endif()
diff -up ags-3.6.2.13/CMakeLists.txt.orig ags-3.6.2.13/CMakeLists.txt
--- ags-3.6.2.13/CMakeLists.txt.orig 2025-09-04 10:13:12.000000000 +0200
+++ ags-3.6.2.13/CMakeLists.txt 2025-10-08 14:38:31.897433814 +0200
@@ -18,9 +18,13 @@ set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PAT
option(AGS_USE_LOCAL_ALL_LIBRARIES "Use a locally installed libraries" OFF)
option(AGS_USE_LOCAL_SDL2 "Use a locally installed SDL2" ${AGS_USE_LOCAL_ALL_LIBRARIES})
option(AGS_USE_LOCAL_SDL2_SOUND "Use a locally installed SDL2 Sound" ${AGS_USE_LOCAL_ALL_LIBRARIES})
+option(AGS_USE_LOCAL_GLM "Use a locally installed GLM" ${AGS_USE_LOCAL_ALL_LIBRARIES})
+option(AGS_USE_LOCAL_MINIZ "Use a locally installed Miniz" ${AGS_USE_LOCAL_ALL_LIBRARIES})
+option(AGS_USE_LOCAL_TINYXML2 "Use a locally installed TinyXML2" ${AGS_USE_LOCAL_ALL_LIBRARIES})
option(AGS_USE_LOCAL_OGG "Use a locally installed OGG" ${AGS_USE_LOCAL_ALL_LIBRARIES})
option(AGS_USE_LOCAL_THEORA "Use a locally installed Theora" ${AGS_USE_LOCAL_ALL_LIBRARIES})
option(AGS_USE_LOCAL_VORBIS "Use a locally installed Vorbis" ${AGS_USE_LOCAL_ALL_LIBRARIES})
+option(AGS_USE_LOCAL_GTEST "Use a locally installed GTest" ${AGS_USE_LOCAL_ALL_LIBRARIES})
option(AGS_TESTS "Build tests" OFF)
option(AGS_BUILD_ENGINE "Build Engine" ON)
@@ -37,9 +41,13 @@ message("------- AGS dependencies option
message(" AGS_USE_LOCAL_ALL_LIBRARIES: ${AGS_USE_LOCAL_ALL_LIBRARIES}")
message(" AGS_USE_LOCAL_SDL2: ${AGS_USE_LOCAL_SDL2}")
message(" AGS_USE_LOCAL_SDL2_SOUND: ${AGS_USE_LOCAL_SDL2_SOUND}")
+message(" AGS_USE_LOCAL_GLM: ${AGS_USE_LOCAL_GLM}")
+message(" AGS_USE_LOCAL_MINIZ: ${AGS_USE_LOCAL_MINIZ}")
+message(" AGS_USE_LOCAL_TINYXML2: ${AGS_USE_LOCAL_TINYXML2}")
message(" AGS_USE_LOCAL_OGG: ${AGS_USE_LOCAL_OGG}")
message(" AGS_USE_LOCAL_THEORA: ${AGS_USE_LOCAL_THEORA}")
message(" AGS_USE_LOCAL_VORBIS: ${AGS_USE_LOCAL_VORBIS}")
+message(" AGS_USE_LOCAL_GTEST: ${AGS_USE_LOCAL_GTEST}")
message("------ AGS selected CMake options ------")
message(" AGS_TESTS: ${AGS_TESTS}")
message(" AGS_BUILD_ENGINE: ${AGS_BUILD_ENGINE}")
@@ -265,7 +273,11 @@ find_package(PkgConfig)
find_package(Threads)
if(AGS_TESTS)
+ if(NOT AGS_USE_LOCAL_GTEST)
include(FetchGoogleTest)
+ else()
+ find_package(GTest REQUIRED)
+ endif()
enable_testing()
endif()
@@ -313,9 +325,23 @@ endif()
include(FindLocalOpenAL)
include(FindLocalAllegro)
+if (NOT AGS_USE_LOCAL_GLM)
add_subdirectory(libsrc/glm EXCLUDE_FROM_ALL)
+else()
+ find_package(glm REQUIRED)
+endif()
+if (NOT AGS_USE_LOCAL_TINYXML2)
add_subdirectory(libsrc/tinyxml2 EXCLUDE_FROM_ALL)
+else()
+ find_package(tinyxml2 REQUIRED)
+ add_library(TinyXML2::TinyXML2 ALIAS tinyxml2::tinyxml2)
+endif()
+if (NOT AGS_USE_LOCAL_MINIZ)
add_subdirectory(libsrc/miniz EXCLUDE_FROM_ALL)
+else()
+ find_package(miniz REQUIRED)
+ add_library(MiniZ::MiniZ ALIAS miniz::miniz)
+endif()
add_subdirectory(Common/libsrc/aastr-0.1.1 EXCLUDE_FROM_ALL)
diff -up ags-3.6.2.13/CMAKE.md.orig ags-3.6.2.13/CMAKE.md
--- ags-3.6.2.13/CMAKE.md.orig 2025-09-04 10:13:12.000000000 +0200
+++ ags-3.6.2.13/CMAKE.md 2025-10-08 14:38:31.898433823 +0200
@@ -97,6 +97,9 @@ The available flags are:
- `AGS_USE_LOCAL_SDL2` : Find SDL2 locally
- `AGS_USE_LOCAL_SDL2_SOUND` : Find SDL sound locally
+- `AGS_USE_LOCAL_GLM` : Find GLM locally
+- `AGS_USE_LOCAL_MINIZ` : Find Miniz locally
+- `AGS_USE_LOCAL_TINYXML` : Find TinyXML locally
- `AGS_USE_LOCAL_OGG` : Find OGG locally
- `AGS_USE_LOCAL_THEORA` : Find Theora locally
- `AGS_USE_LOCAL_VORBIS` : Find Vorbis locally
diff -up ags-3.6.2.13/Common/CMakeLists.txt.orig ags-3.6.2.13/Common/CMakeLists.txt
--- ags-3.6.2.13/Common/CMakeLists.txt.orig 2025-09-04 10:13:12.000000000 +0200
+++ ags-3.6.2.13/Common/CMakeLists.txt 2025-10-08 14:38:31.900433840 +0200
@@ -250,6 +250,7 @@ if(AGS_TESTS)
target_link_libraries(common_test
common
gtest_main
+ gtest
)
include(GoogleTest)
diff -up ags-3.6.2.13/Compiler/CMakeLists.txt.orig ags-3.6.2.13/Compiler/CMakeLists.txt
--- ags-3.6.2.13/Compiler/CMakeLists.txt.orig 2025-10-08 14:38:31.900433840 +0200
+++ ags-3.6.2.13/Compiler/CMakeLists.txt 2025-10-08 15:00:07.456886639 +0200
@@ -102,6 +102,7 @@ if(AGS_TESTS)
compiler_test
compiler
gtest_main
+ gtest
)
include(GoogleTest)
diff -up ags-3.6.2.13/Engine/CMakeLists.txt.orig ags-3.6.2.13/Engine/CMakeLists.txt
--- ags-3.6.2.13/Engine/CMakeLists.txt.orig 2025-10-08 14:38:31.901433848 +0200
+++ ags-3.6.2.13/Engine/CMakeLists.txt 2025-10-08 15:01:10.681457075 +0200
@@ -660,6 +660,7 @@ if(AGS_TESTS)
engine
common
gtest_main
+ gtest
)
include(GoogleTest)