Skip to content

Commit

Permalink
Install debug build binaries to a separate folder (#39)
Browse files Browse the repository at this point in the history
* Install debug build binaries to a separate folder

This will mirror the directory structure used by vcpkg:
* Debug binaries will get installed to a subdirectory debug/lib for
  ARCHIVE and LIBRARY artifacts and debug/bin for RUNTIME artifacts
* All other configurations install binaries directly to lib and bin
  respectively
* Other artifacts go to the same include/share/... directories for all
  configurations, including Debug

* Build both debug and release configurations on CI
  • Loading branch information
ComicSansMS authored Oct 2, 2024
1 parent b8d4b06 commit 0ac15db
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 6 deletions.
11 changes: 7 additions & 4 deletions .ci/docker/ubuntu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,13 @@ ARG cmake_args=
RUN sysctl vm.mmap_rnd_bits=28

# Build.
ENV CC="$cc" CXX="$cxx" CMAKE_GENERATOR="Ninja" CMAKE_EXPORT_COMPILE_COMMANDS=on
ENV CC="$cc" CXX="$cxx" CMAKE_GENERATOR="Ninja Multi-Config" CMAKE_EXPORT_COMPILE_COMMANDS=on
RUN ls -lR src
RUN cmake -B build -S . "$cmake_args"
RUN cmake --build build --verbose
RUN cmake --build build --target all_verify_interface_header_sets
RUN cmake --install build --prefix /opt/beman.exemplar
RUN cmake --build build --config Release --verbose
RUN cmake --build build --config Release --target all_verify_interface_header_sets
RUN cmake --install build --config Release --prefix /opt/beman.exemplar
RUN cmake --build build --config Debug --verbose
RUN cmake --build build --config Debug --target all_verify_interface_header_sets
RUN cmake --install build --config Debug --prefix /opt/beman.exemplar
RUN find /opt/beman.exemplar -type f
3 changes: 2 additions & 1 deletion .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,4 +67,5 @@ jobs:
cache-to: type=gha,mode=max
- name: Run tests
run: |
docker run ${{ matrix.cfg.id }} ctest --test-dir build
docker run ${{ matrix.cfg.id }} ctest --test-dir build -C Release
docker run ${{ matrix.cfg.id }} ctest --test-dir build -C Debug
5 changes: 4 additions & 1 deletion src/beman/exemplar/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,11 @@ set_target_properties(beman.exemplar PROPERTIES VERIFY_INTERFACE_HEADER_SETS ON)
install(
TARGETS beman.exemplar
EXPORT beman.exemplar
DESTINATION $<$<CONFIG:Debug>:debug/>${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION $<$<CONFIG:Debug>:debug/>${CMAKE_INSTALL_BINDIR}
FILE_SET HEADERS
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR})
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
)

if(BUILD_TESTING)
include(GoogleTest)
Expand Down

0 comments on commit 0ac15db

Please sign in to comment.