Skip to content

Commit

Permalink
Apply the Beman Standard: CMAKE.TARGET_NAMES
Browse files Browse the repository at this point in the history
  • Loading branch information
neatudarius committed Nov 10, 2024
1 parent fb6f50c commit d655126
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 14 deletions.
12 changes: 7 additions & 5 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,19 @@ set(EXAMPLES sample)

foreach(example ${EXAMPLES})
# Add example executable.
add_executable(${example} "")
add_executable(beman.iterator_interface.examples.${example} "")

# Add example source file.
target_sources(${example} PRIVATE ${example}.cpp)
target_sources(beman.iterator_interface.examples.${example}
PRIVATE ${example}.cpp)

# Link example with the library.
target_link_libraries(${example} beman::iterator_interface)
target_link_libraries(beman.iterator_interface.examples.${example}
beman::iterator_interface)

# Install.
install(
TARGETS ${example}
COMPONENT beman_iterator_interface_examples
TARGETS beman.iterator_interface.examples.${example}
COMPONENT beman.iterator_interface.examples
DESTINATION ${CMAKE_INSTALL_BINDIR})
endforeach()
15 changes: 7 additions & 8 deletions tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,27 +1,26 @@
# cmake-format: off
# src/beman/iterator_interface/tests/CMakeLists.txt -*-makefile-*-
# tests/CMakeLists.txt -*-makefile-*-
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
# cmake-format: on

include(GoogleTest)

# Tests
add_executable(beman_iterator_interface_test)
add_executable(beman.iterator_interface.tests)

target_sources(beman_iterator_interface_test
target_sources(beman.iterator_interface.tests
PRIVATE iterator_interface.test.cpp)

target_sources(
beman_iterator_interface_test
beman.iterator_interface.tests
PRIVATE FILE_SET beman_iterator_interface_test_headers TYPE HEADERS)

target_link_libraries(
beman_iterator_interface_test PRIVATE beman::iterator_interface GTest::gtest
GTest::gtest_main)
beman.iterator_interface.tests PRIVATE beman::iterator_interface GTest::gtest
GTest::gtest_main)

# Issue #32: 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.
# Change also applied for CI flows.
gtest_add_tests(TARGET beman_iterator_interface_test "" AUTO)
gtest_add_tests(TARGET beman.iterator_interface.tests "" AUTO)
2 changes: 1 addition & 1 deletion tests/iterator_interface.test.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// src/beman/iterator_interface/iterator_interface.y.cpp -*-C++-*-
// tests/iterator_interfaces.test.cpp -*-C++-*-
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception

#include <beman/iterator_interface/iterator_interface.hpp>
Expand Down

0 comments on commit d655126

Please sign in to comment.