mirror of
https://github.com/ScrelliCopter/tmx2gba.git
synced 2025-02-21 03:29:25 +11:00
revamp pugixml find behaviour
This commit is contained in:
4
.github/workflows/cmake.yml
vendored
4
.github/workflows/cmake.yml
vendored
@@ -23,7 +23,7 @@ jobs:
|
||||
- { name: "Windows MSVC x86", os: windows-latest, artifact: windows-x86, arch: x86 }
|
||||
- { name: "Windows MSVC x64", os: windows-latest, artifact: windows-x64 }
|
||||
- { name: "Windows MSVC ARM64", os: windows-latest, artifact: windows-arm64, arch: amd64_arm64 }
|
||||
- { name: "Ubuntu", artifact: "linux", os: ubuntu-latest, extra: "-DUSE_BUNDLED_ZSTD:BOOL=OFF" }
|
||||
- { name: "Ubuntu", artifact: "linux", os: ubuntu-latest, extra: "-DUSE_BUNDLED_ZSTD:BOOL=OFF -DUSE_BUNDLED_PUGIXML:BOOL=OFF" }
|
||||
runs-on: ${{matrix.config.os}}
|
||||
|
||||
steps:
|
||||
@@ -38,7 +38,7 @@ jobs:
|
||||
- uses: awalsh128/cache-apt-pkgs-action@latest
|
||||
if: ${{matrix.config.artifact == 'linux'}}
|
||||
with:
|
||||
packages: libzstd-dev
|
||||
packages: libzstd-dev libpugixml-dev
|
||||
version: 1.0
|
||||
|
||||
- name: Configure CMake
|
||||
|
||||
@@ -25,7 +25,7 @@ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules")
|
||||
if (USE_BUNDLED_PUGIXML)
|
||||
add_subdirectory(ext/pugixml)
|
||||
else()
|
||||
find_package(PUGIXML REQUIRED)
|
||||
find_package(pugixml REQUIRED CONFIG)
|
||||
endif()
|
||||
|
||||
if (USE_ZLIB)
|
||||
@@ -42,11 +42,7 @@ endif()
|
||||
|
||||
add_subdirectory(ext/base64)
|
||||
|
||||
if (USE_BUNDLED_TMXLITE)
|
||||
add_subdirectory(ext/tmxlite)
|
||||
else()
|
||||
find_package(TMXLITE REQUIRED)
|
||||
endif()
|
||||
|
||||
# Main tmx2gba sources
|
||||
add_subdirectory(src)
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
find_path(PUGIXML_INCLUDE_DIR NAMES pugixml.hpp)
|
||||
find_library(PUGIXML_LIBRARY NAMES pugixml)
|
||||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
find_package_handle_standard_args(PUGIXML DEFAULT_MSG
|
||||
PUGIXML_LIBRARY PUGIXML_INCLUDE_DIR)
|
||||
|
||||
mark_as_advanced(PUGIXML_INCLUDE_DIR
|
||||
PUGIXML_LIBRARY)
|
||||
|
||||
@@ -1,10 +0,0 @@
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
# Search for the header file
|
||||
find_path(TMXLITE_INCLUDE_DIR NAMES tmxlite/Config.hpp PATH_SUFFIXES include)
|
||||
|
||||
# Search for the library
|
||||
find_library(TMXLITE_LIBRARIES NAMES tmxlite PATH_SUFFIXES lib)
|
||||
|
||||
# Did we find everything we need?
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(tmxlite DEFAULT_MSG TMXLITE_LIBRARIES TMXLITE_INCLUDE_DIR)
|
||||
@@ -27,14 +27,8 @@ if (MSVC)
|
||||
target_compile_definitions(tmxlite PRIVATE _CRT_SECURE_NO_WARNINGS)
|
||||
endif()
|
||||
|
||||
target_link_libraries(tmxlite base64::base64)
|
||||
|
||||
if (USE_BUNDLED_PUGIXML)
|
||||
target_link_libraries(tmxlite pugixml::static)
|
||||
else()
|
||||
target_include_directories(tmxlite PRIVATE ${PUGIXML_INCLUDE_DIR})
|
||||
target_link_libraries(tmxlite ZLIB::ZLIB ${PUGIXML_LIBRARY})
|
||||
endif()
|
||||
target_compile_definitions(tmxlite PRIVATE USE_ZSTD)
|
||||
target_link_libraries(tmxlite base64::base64 pugixml Zstd::Zstd)
|
||||
|
||||
if (USE_ZLIB)
|
||||
target_compile_definitions(tmxlite PRIVATE USE_ZLIB)
|
||||
@@ -43,7 +37,4 @@ else()
|
||||
target_link_libraries(tmxlite miniz::miniz)
|
||||
endif()
|
||||
|
||||
target_compile_definitions(tmxlite PRIVATE USE_ZSTD)
|
||||
target_link_libraries(tmxlite Zstd::Zstd)
|
||||
|
||||
target_include_directories(tmxlite PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include)
|
||||
|
||||
Reference in New Issue
Block a user