Skip to content

Commit

Permalink
Respect review comment
Browse files Browse the repository at this point in the history
Cleanup and format
  • Loading branch information
ClausKlein committed Jan 6, 2025
1 parent 276fe08 commit 6884b2b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 34 deletions.
29 changes: 10 additions & 19 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,20 +71,10 @@ target_sources(
TYPE
HEADERS
BASE_DIRS
# XXX src
${PROJECT_BINARY_DIR}/include
${PROJECT_SOURCE_DIR}/include
FILES
${PROJECT_BINARY_DIR}/include/beman/iterator_interface/config.hpp
)

# 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/beman/iterator_interface/config.hpp)

add_subdirectory(src/beman/iterator_interface)
add_subdirectory(include/beman/iterator_interface)
Expand All @@ -103,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)
Empty file modified Makefile
100755 → 100644
Empty file.
27 changes: 14 additions & 13 deletions include/beman/iterator_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,17 @@

target_sources(
beman.iterator_interface
PUBLIC FILE_SET
beman_iterator_interface_headers
TYPE
HEADERS
BASE_DIRS
${PROJECT_BINARY_DIR}/include
${PROJECT_SOURCE_DIR}/include
FILES
${CMAKE_CURRENT_SOURCE_DIR}/iterator_interface.hpp
${CMAKE_CURRENT_SOURCE_DIR}/iterator_interface_access.hpp
${CMAKE_CURRENT_SOURCE_DIR}/detail/stl_interfaces/config.hpp
${CMAKE_CURRENT_SOURCE_DIR}/detail/stl_interfaces/fwd.hpp
${CMAKE_CURRENT_SOURCE_DIR}/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)
5 changes: 3 additions & 2 deletions tests/beman/iterator_interface/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,11 @@ target_sources(
PRIVATE FILE_SET beman_iterator_interface_tests_headers TYPE HEADERS)

target_link_libraries(
beman.iterator_interface.tests PRIVATE beman::iterator_interface # XXX GTest::gtest
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 6884b2b

Please sign in to comment.