Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include a third-party license attribution in the binary C++ packages #7302

Merged
merged 1 commit into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So that didn't work before?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It produced the files, but they weren’t included in the package. Now they’re placed in the bin dir and packaged via the cmake change. The only place where this worked is slint_tool_binary.yaml :)

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,12 @@ jobs:
container: ghcr.io/slint-ui/slint/${{ matrix.rust_target }}-cpp
steps:
- uses: actions/checkout@v4
- uses: baptiste0928/cargo-install@v3
with:
crate: cargo-about
- 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
Loading