Skip to content
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
14 changes: 13 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
fail-fast: false
matrix:
include:
- toolset: gcc-14
- toolset: gcc-14 # Do not remove! It is the only toolset that tests CMake tests down below
cxxstd: "11,14,17,2a"
os: ubuntu-24.04
# UBSAN complains on vtables and fails. No ',undefined -fno-sanitize-recover=undefined' flags!
Expand Down Expand Up @@ -92,6 +92,18 @@ jobs:
./b2 -d0 headers
./b2 -j4 variant=debug tools/inspect

- name: Run CMake tests
if: ${{matrix.toolset == 'gcc-14'}}
run: |
cd ../boost-root/
mkdir __build
cd __build
cmake -DBUILD_TESTING=1 -DBOOST_INCLUDE_LIBRARIES=dll -DCMAKE_CXX_COMPILER=g++-14 -DCMAKE_C_COMPILER=gcc-14 ..
cmake --build . --target tests
ctest --output-on-failure --no-tests=error
cd ..
rm -rf __build

- name: Run tests
run: |
cd ../boost-root
Expand Down
34 changes: 25 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@ project(boost_dll VERSION "${BOOST_SUPERPROJECT_VERSION}" LANGUAGES CXX)

option(BOOST_DLL_USE_STD_FS "Use std::filesystem instead of Boost.Filesystem" OFF)

add_library(boost_dll INTERFACE)
add_library(Boost::dll ALIAS boost_dll)

target_include_directories(boost_dll INTERFACE include)

target_link_libraries(boost_dll
add_library(boost_dll_base INTERFACE)
target_include_directories(boost_dll_base INTERFACE include)
target_link_libraries(boost_dll_base
INTERFACE
Boost::assert
Boost::config
Expand All @@ -28,13 +25,32 @@ target_link_libraries(boost_dll
${CMAKE_DL_LIBS}
)


add_library(boost_dll_std_fs INTERFACE)
target_link_libraries(boost_dll_std_fs
INTERFACE
boost_dll_base
)
target_compile_definitions(boost_dll_std_fs INTERFACE BOOST_DLL_USE_STD_FS)
target_compile_features(boost_dll_std_fs INTERFACE cxx_std_17)

add_library(boost_dll_boost_fs INTERFACE)
target_link_libraries(boost_dll_boost_fs
INTERFACE
boost_dll_base
Boost::filesystem
)


add_library(boost_dll INTERFACE)
if(BOOST_DLL_USE_STD_FS)
target_compile_definitions(boost_dll INTERFACE BOOST_DLL_USE_STD_FS)
target_compile_features(boost_dll INTERFACE cxx_std_17)
target_link_libraries(boost_dll INTERFACE boost_dll_std_fs)
else()
target_link_libraries(boost_dll INTERFACE Boost::filesystem)
target_link_libraries(boost_dll INTERFACE boost_dll_boost_fs)
endif()

add_library(Boost::dll ALIAS boost_dll)

if(BUILD_TESTING AND EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/test/CMakeLists.txt")

add_subdirectory(test)
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Boost.DLL is a part of the [Boost C++ Libraries](https://github.com/boostorg). I

Branches | Build | Tests coverage | More info
----------------|-------------- | -------------- |-----------
Develop: | [![CI](https://github.com/apolukhin/Boost.DLL/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/apolukhin/Boost.DLL/actions/workflows/ci.yml) [![Build status](https://ci.appveyor.com/api/projects/status/t6q6yhcabtk5b99l/branch/develop?svg=true)](https://ci.appveyor.com/project/apolukhin/boost-dll/branch/develop) | [![Coverage Status](https://coveralls.io/repos/apolukhin/Boost.DLL/badge.png?branch=develop)](https://coveralls.io/r/apolukhin/Boost.DLL?branch=develop) | [details...](https://www.boost.org/development/tests/develop/developer/dll.html)
Master: | [![CI](https://github.com/apolukhin/Boost.DLL/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/apolukhin/Boost.DLL/actions/workflows/ci.yml) [![Build status](https://ci.appveyor.com/api/projects/status/t6q6yhcabtk5b99l/branch/master?svg=true)](https://ci.appveyor.com/project/apolukhin/boost-dll/branch/master) | [![Coverage Status](https://coveralls.io/repos/apolukhin/Boost.DLL/badge.png?branch=master)](https://coveralls.io/r/apolukhin/Boost.DLL?branch=master) | [details...](https://www.boost.org/development/tests/master/developer/dll.html)
Develop: | [![CI](https://github.com/apolukhin/Boost.DLL/actions/workflows/ci.yml/badge.svg?branch=develop)](https://github.com/apolukhin/Boost.DLL/actions/workflows/ci.yml) [![Build status](https://ci.appveyor.com/api/projects/status/t6q6yhcabtk5b99l/branch/develop?svg=true)](https://ci.appveyor.com/project/apolukhin/boost-dll/branch/develop) | [![Coverage Status](https://coveralls.io/repos/apolukhin/Boost.DLL/badge.png?branch=develop)](https://coveralls.io/r/apolukhin/Boost.DLL?branch=develop) | [details...](https://regression.boost.io/develop/developer/dll.html)
Master: | [![CI](https://github.com/apolukhin/Boost.DLL/actions/workflows/ci.yml/badge.svg?branch=master)](https://github.com/apolukhin/Boost.DLL/actions/workflows/ci.yml) [![Build status](https://ci.appveyor.com/api/projects/status/t6q6yhcabtk5b99l/branch/master?svg=true)](https://ci.appveyor.com/project/apolukhin/boost-dll/branch/master) | [![Coverage Status](https://coveralls.io/repos/apolukhin/Boost.DLL/badge.png?branch=master)](https://coveralls.io/r/apolukhin/Boost.DLL?branch=master) | [details...](https://regression.boost.io/master/developer/dll.html)

[Latest developer documentation](https://www.boost.org/doc/libs/develop/doc/html/boost_dll.html)

Expand Down
13 changes: 13 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Copyright (c) 2016-2025 Antony Polukhin
# Distributed under the Boost Software License, Version 1.0.
# See accompanying file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt

if(NOT TARGET tests)
add_custom_target(tests)
endif()

add_executable(dll_tests_cpp_mangling "cpp_mangling.cpp")
target_link_libraries(dll_tests_cpp_mangling Boost::dll)
add_test(NAME dll_tests_cpp_mangling COMMAND dll_tests_cpp_mangling)
add_dependencies(tests dll_tests_cpp_mangling)