Skip to content

Commit

Permalink
revamp pugixml find behaviour
Browse files Browse the repository at this point in the history
  • Loading branch information
ScrelliCopter committed Mar 28, 2024
1 parent 320bc19 commit b06ad7c
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 39 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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
Expand Down
8 changes: 2 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -42,11 +42,7 @@ endif()

add_subdirectory(ext/base64)

if (USE_BUNDLED_TMXLITE)
add_subdirectory(ext/tmxlite)
else()
find_package(TMXLITE REQUIRED)
endif()
add_subdirectory(ext/tmxlite)

# Main tmx2gba sources
add_subdirectory(src)
Expand Down
10 changes: 0 additions & 10 deletions cmake/modules/FindPUGIXML.cmake

This file was deleted.

10 changes: 0 additions & 10 deletions cmake/modules/FindTMXLITE.cmake

This file was deleted.

13 changes: 2 additions & 11 deletions ext/tmxlite/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)

0 comments on commit b06ad7c

Please sign in to comment.