Skip to content

Commit

Permalink
Include a third-party license attribution in the binary C++ packages
Browse files Browse the repository at this point in the history
Generate a top-level licenses/ folder and include it in the CPack archive.
  • Loading branch information
tronical committed Jan 8, 2025
1 parent 0248790 commit dcd3729
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/cpp_package.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ jobs:
with:
crate: cargo-about
- name: Prepare licenses
run: bash -x ../../scripts/prepare_binary_package.sh ../..
run: bash -x ../../scripts/prepare_binary_package.sh ${{ runner.workspace }}/cppbuild
working-directory: api/cpp/
# Pin Python version until https://github.com/slint-ui/slint/issues/6615 is fixed.
- uses: actions/setup-python@v5
Expand Down Expand Up @@ -109,7 +109,7 @@ jobs:
with:
crate: cargo-about
- name: Prepare licenses
run: bash -x ../../scripts/prepare_binary_package.sh ../..
run: bash -x ../../scripts/prepare_binary_package.sh ${{ runner.workspace }}/cppbuild
working-directory: api/cpp/
- name: C++ Build
uses: lukka/run-cmake@v3.4
Expand Down Expand Up @@ -165,7 +165,7 @@ jobs:
with:
crate: cargo-about
- name: Prepare licenses
run: bash -x ../../scripts/prepare_binary_package.sh ../..
run: bash -x ../../scripts/prepare_binary_package.sh ${{ runner.workspace }}/cppbuild
working-directory: api/cpp/
- name: C++ Build
uses: lukka/run-cmake@v3.4
Expand Down Expand Up @@ -205,6 +205,9 @@ jobs:
container: ghcr.io/slint-ui/slint/${{ matrix.rust_target }}-cpp
steps:
- uses: actions/checkout@v4
- name: Prepare licenses
run: bash -x ../../scripts/prepare_binary_package.sh ../../build
working-directory: api/cpp/
- name: CMake configure
run: cmake -B build -S . -GNinja -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_SYSTEM_NAME=Linux -DCMAKE_SYSTEM_PROCESSOR=${{ matrix.cmake_system_processor }} -DRust_CARGO_TARGET=${{ matrix.rust_target}} -DCMAKE_C_COMPILER=${{ matrix.gcc_target }}-gcc -DCMAKE_CXX_COMPILER=${{ matrix.gcc_target }}-g++ -DSLINT_COMPILER=download ${{ env.SLINT_BINARY_FEATURES }} ${{ inputs.extra_cmake_flags }}
- name: CMake build
Expand Down
5 changes: 5 additions & 0 deletions api/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,11 @@ set(CPACK_RESOURCE_FILE_README "${CMAKE_CURRENT_LIST_DIR}/README.md")
set(CPACK_STRIP_FILES ON)
set(CPACK_NSIS_DEFINES "ManifestDPIAware true")

# Include a third-party license attribution folder, if generated by the CI.
if(EXISTS "${CMAKE_BINARY_DIR}/licenses")
list(APPEND CPACK_INSTALLED_DIRECTORIES "${CMAKE_BINARY_DIR}/licenses" licenses)
endif()

if(WIN32)
if(MSVC)
set(compiler_suffix "-MSVC")
Expand Down

0 comments on commit dcd3729

Please sign in to comment.