Skip to content

Commit

Permalink
Merge pull request #34 from ClausKlein/develop
Browse files Browse the repository at this point in the history
Cleanup the cmake files
  • Loading branch information
camio authored Jan 10, 2025
2 parents a4e2837 + 6884b2b commit 81ded2c
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 33 deletions.
31 changes: 13 additions & 18 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# cmake-format: on

cmake_minimum_required(VERSION 3.27)
cmake_minimum_required(VERSION 3.27...3.31)

project(
beman.iterator_interface
Expand All @@ -23,15 +23,19 @@ beman_iterator_check_deducing_this(COMPILER_SUPPORTS_DEDUCING_THIS)

set(TARGETS_EXPORT_NAME ${CMAKE_PROJECT_NAME}Targets)

option(BEMAN_ITERATOR_INTERFACE_USE_DEDUCING_THIS
option(
BEMAN_ITERATOR_INTERFACE_USE_DEDUCING_THIS
"Make use of C++23 \"deducing this\" feature (P0847R7). Turn this off for non-conforming compilers."
${COMPILER_SUPPORTS_DEDUCING_THIS})

option(BEMAN_ITERATOR_INTERFACE_BUILD_TESTS
"Enable building tests and test infrastructure. Default: ON. Values: {ON, OFF}." ${PROJECT_IS_TOP_LEVEL})
option(
BEMAN_ITERATOR_INTERFACE_BUILD_TESTS
"Enable building tests and test infrastructure. Default: ON. Values: {ON, OFF}."
${PROJECT_IS_TOP_LEVEL})

option(BEMAN_ITERATOR_INTERFACE_BUILD_EXAMPLES
"Enable building examples. Default: ON. Values: {ON, OFF}." ${PROJECT_IS_TOP_LEVEL})
"Enable building examples. Default: ON. Values: {ON, OFF}."
${PROJECT_IS_TOP_LEVEL})

if(BEMAN_ITERATOR_INTERFACE_USE_DEDUCING_THIS
AND NOT COMPILER_SUPPORTS_DEDUCING_THIS)
Expand Down Expand Up @@ -67,16 +71,10 @@ target_sources(
TYPE
HEADERS
BASE_DIRS
src
include)

target_include_directories(
beman.iterator_interface
PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${PROJECT_BINARY_DIR}/include>
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_LOWER_PROJECT_NAME}>
)
${PROJECT_BINARY_DIR}/include
${PROJECT_SOURCE_DIR}/include
FILES
${PROJECT_BINARY_DIR}/include/beman/iterator_interface/config.hpp)

add_subdirectory(src/beman/iterator_interface)
add_subdirectory(include/beman/iterator_interface)
Expand All @@ -99,6 +97,3 @@ add_custom_target(
COMMENT "Running gcovr to process coverage results"
COMMAND mkdir -p coverage
COMMAND gcovr --config gcovr.cfg .)

install(FILES ${PROJECT_BINARY_DIR}/include/beman/iterator_interface/config.hpp
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/beman/iterator_interface)
6 changes: 2 additions & 4 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,16 +14,14 @@
"name": "_debug-base",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "Debug",
"CMAKE_CXX_FLAGS": "-fsanitize=address -fsanitize=pointer-compare -fsanitize=pointer-subtract -fsanitize=leak -fsanitize=undefined"
"CMAKE_BUILD_TYPE": "Debug"
}
},
{
"name": "_release-base",
"hidden": true,
"cacheVariables": {
"CMAKE_BUILD_TYPE": "RelWithDebInfo",
"CMAKE_CXX_FLAGS": "-O3"
"CMAKE_BUILD_TYPE": "RelWithDebInfo"
}
},
{
Expand Down
Empty file modified Makefile
100755 → 100644
Empty file.
24 changes: 14 additions & 10 deletions include/beman/iterator_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@

target_sources(
beman.iterator_interface
PUBLIC FILE_SET
beman_iterator_interface_headers
TYPE
HEADERS
FILES
iterator_interface.hpp
iterator_interface_access.hpp
detail/stl_interfaces/config.hpp
detail/stl_interfaces/fwd.hpp
detail/stl_interfaces/iterator_interface.hpp)
PUBLIC
FILE_SET
beman_iterator_interface_headers
TYPE
HEADERS
BASE_DIRS
${PROJECT_BINARY_DIR}/include
${PROJECT_SOURCE_DIR}/include
FILES
iterator_interface.hpp
iterator_interface_access.hpp
detail/stl_interfaces/config.hpp
detail/stl_interfaces/fwd.hpp
detail/stl_interfaces/iterator_interface.hpp)
3 changes: 2 additions & 1 deletion tests/beman/iterator_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ target_link_libraries(
beman.iterator_interface.tests PRIVATE beman::iterator_interface GTest::gtest
GTest::gtest_main)

# [Issue #18](https://github.com/bemanproject/iterator_interface/issues/18): Re-enable ASAN run CI/clang-19.
# [Issue #18](https://github.com/bemanproject/iterator_interface/issues/18):
# Re-enable ASAN run CI/clang-19.
#
# Note: clang-19 + gtest_discover_tests + Asan setup causes errors on some
# platforms. Temporary switch to gtest_add_tests and skip some Asan checks.
Expand Down

0 comments on commit 81ded2c

Please sign in to comment.