File tree Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Expand file tree Collapse file tree 2 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 3
3
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4
4
# cmake-format: on
5
5
6
- set(TARGET_LIBRARY "beman_optional26 ")
6
+ add_library(beman_optional26 STATIC " ")
7
7
8
- add_library("${TARGET_LIBRARY}" STATIC "")
9
-
10
- target_sources("${TARGET_LIBRARY}" PRIVATE optional.cpp detail/iterator.cpp)
8
+ target_sources(beman_optional26 PRIVATE optional.cpp detail/iterator.cpp)
11
9
12
10
include (GNUInstallDirs)
13
11
include_directories(${CMAKE_CURRENT_SOURCE_DIR})
14
12
15
13
target_include_directories(
16
- "${TARGET_LIBRARY}"
14
+ beman_optional26
17
15
PUBLIC
18
16
$< BUILD_INTERFACE :${CMAKE_CURRENT_SOURCE_DIR}/../../../include>
19
17
$< INSTALL_INTERFACE :${CMAKE_INSTALL_INCLUDEDIR}/${CMAKE_LOWER_PROJECT_NAME}> # <prefix>/include/scratch
20
18
)
21
19
22
20
install(
23
- TARGETS "${TARGET_LIBRARY}"
21
+ TARGETS beman_optional26
24
22
EXPORT ${TARGETS_EXPORT_NAME}1
25
23
DESTINATION ${CMAKE_INSTALL_LIBDIR})
26
24
@@ -32,7 +30,7 @@ install(
32
30
FILES_MATCHING
33
31
PATTERN "*.hpp")
34
32
35
- target_link_libraries("${TARGET_LIBRARY}" )
33
+ target_link_libraries(beman_optional26 )
36
34
37
35
# Tests
38
36
if(BUILD_TESTING)
Original file line number Diff line number Diff line change @@ -15,7 +15,7 @@ add_executable(optional_test
15
15
detail/iterator.t.cpp
16
16
)
17
17
18
- target_link_libraries(optional_test "${TARGET_LIBRARY}" GTest ::gtest GTest::gtest_main)
18
+ target_link_libraries(optional_test beman_optional26 GTest ::gtest GTest::gtest_main)
19
19
20
20
# Note: clang-19 + gtest_discover_tests + Asan setup causes errors on some platforms.
21
21
# Temporary switch to gtest_add_tests and skip some Asan checks.
You can’t perform that action at this time.
0 commit comments