From e395259ee4ba725ce513c16f281b878e0cec1970 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 31 Dec 2024 20:36:08 +0100 Subject: [PATCH 1/3] Added back plutovg as a submodule, added option to use system version --- .gitmodules | 3 +++ CMakeLists.txt | 15 ++++++--------- third_party/plutovg | 1 + 3 files changed, 10 insertions(+), 9 deletions(-) create mode 100644 .gitmodules create mode 160000 third_party/plutovg diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..d68254b --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "third_party/plutovg"] + path = third_party/plutovg + url = https://github.com/sammycage/plutovg.git diff --git a/CMakeLists.txt b/CMakeLists.txt index faa3e00..2bb913d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,15 +6,12 @@ set(LUNASVG_VERSION_MICRO 0) project(lunasvg LANGUAGES CXX VERSION ${LUNASVG_VERSION_MAJOR}.${LUNASVG_VERSION_MINOR}.${LUNASVG_VERSION_MICRO}) -include(FetchContent) -FetchContent_Declare(plutovg - GIT_REPOSITORY https://github.com/sammycage/plutovg.git - GIT_TAG main - GIT_SHALLOW ON - FIND_PACKAGE_ARGS 0.0.4 -) - -FetchContent_MakeAvailable(plutovg) +option(LUNASVG_USE_SYSTEM_PLUTOVG "Use installed version of plutovg instead of bundled submodule" OFF) +if (LUNASVG_USE_SYSTEM_PLUTOVG) + find_package(plutovg 0.0.4 REQUIRED) +else() + add_subdirectory(third_party/plutovg) +endif() set(lunasvg_sources source/lunasvg.cpp diff --git a/third_party/plutovg b/third_party/plutovg new file mode 160000 index 0000000..e026d0a --- /dev/null +++ b/third_party/plutovg @@ -0,0 +1 @@ +Subproject commit e026d0ac7ba29818cd0a73548b9903eef7da50c1 From 7a744f8029436106ea64b56cd7072bcd0b4efd0d Mon Sep 17 00:00:00 2001 From: WerWolv Date: Tue, 31 Dec 2024 20:39:49 +0100 Subject: [PATCH 2/3] Properly checkout submodule in CI --- .github/workflows/main.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4aeba94..50fe2cc 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -7,6 +7,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + submodules: true - name: Build with meson run: | pip install meson @@ -25,6 +27,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + submodules: true - name: Build with meson run: | pip install meson @@ -43,6 +47,8 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v4 + with: + submodules: true - name: Build with meson run: | pip install meson From 71c4d5a57cb4780af22d89d39c36c9ace1077fd8 Mon Sep 17 00:00:00 2001 From: WerWolv Date: Wed, 1 Jan 2025 12:03:45 +0100 Subject: [PATCH 3/3] Moved submodule to root, fall back to bundled plutovg automatically --- .gitmodules | 4 ++-- CMakeLists.txt | 8 +++----- third_party/plutovg => plutovg | 0 3 files changed, 5 insertions(+), 7 deletions(-) rename third_party/plutovg => plutovg (100%) diff --git a/.gitmodules b/.gitmodules index d68254b..d2939f5 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ -[submodule "third_party/plutovg"] - path = third_party/plutovg +[submodule "plutovg"] + path = plutovg url = https://github.com/sammycage/plutovg.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 2bb913d..19d9c28 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,11 +6,9 @@ set(LUNASVG_VERSION_MICRO 0) project(lunasvg LANGUAGES CXX VERSION ${LUNASVG_VERSION_MAJOR}.${LUNASVG_VERSION_MINOR}.${LUNASVG_VERSION_MICRO}) -option(LUNASVG_USE_SYSTEM_PLUTOVG "Use installed version of plutovg instead of bundled submodule" OFF) -if (LUNASVG_USE_SYSTEM_PLUTOVG) - find_package(plutovg 0.0.4 REQUIRED) -else() - add_subdirectory(third_party/plutovg) +find_package(plutovg 0.0.4 QUIET) +if(NOT plutovg_FOUND) + add_subdirectory(plutovg) endif() set(lunasvg_sources diff --git a/third_party/plutovg b/plutovg similarity index 100% rename from third_party/plutovg rename to plutovg