Skip to content

Commit

Permalink
Use link_options instead of link_libraries for options
Browse files Browse the repository at this point in the history
  • Loading branch information
jp-dark committed Oct 10, 2024
1 parent fe7fcfe commit 2366932
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
10 changes: 5 additions & 5 deletions libtiledbsoma/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -248,11 +248,11 @@ else()
# See https://www.reddit.com/r/cmake/comments/17d70h6/why_arent_generator_expressions_evaluated_for/
# for this placeholder solution.
set(TILEDBSOMA_SANITIZER_FLAG "")
list(APPEND TILEDBSOMA_SANITIZER_FLAG "\$<GENEX_EVAL:$<$<CONFIG:ASAN>: -fsanitize=address>>")
list(APPEND TILEDBSOMA_SANITIZER_FLAG "\$<GENEX_EVAL:$<$<CONFIG:LSAN>: -fsanitize=leak>>")
list(APPEND TILEDBSOMA_SANITIZER_FLAG "\$<GENEX_EVAL:$<$<CONFIG:TSAN>: -fsanitize=thread>>")
list(APPEND TILEDBSOMA_SANITIZER_FLAG "\$<GENEX_EVAL:$<$<CONFIG:UBSAN>: -fsanitize=undefined>>")
list(APPEND TILEDBSOMA_SANITIZER_FLAG "\$<GENEX_EVAL:$<$<CONFIG:MSAN>: -fsanitize=memory>>")
list(APPEND TILEDBSOMA_SANITIZER_FLAG "\$<GENEX_EVAL:$<$<CONFIG:ASAN>:-fsanitize=address>>")
list(APPEND TILEDBSOMA_SANITIZER_FLAG "\$<GENEX_EVAL:$<$<CONFIG:LSAN>:-fsanitize=leak>>")
list(APPEND TILEDBSOMA_SANITIZER_FLAG "\$<GENEX_EVAL:$<$<CONFIG:TSAN>:-fsanitize=thread>>")
list(APPEND TILEDBSOMA_SANITIZER_FLAG "\$<GENEX_EVAL:$<$<CONFIG:UBSAN>:-fsanitize=undefined>>")
list(APPEND TILEDBSOMA_SANITIZER_FLAG "\$<GENEX_EVAL:$<$<CONFIG:MSAN>:-fsanitize=memory>>")


# Compiler specific additions:
Expand Down
8 changes: 6 additions & 2 deletions libtiledbsoma/src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ set_source_files_properties(
add_library(TILEDBSOMA_NANOARROW_OBJECT OBJECT
${CMAKE_CURRENT_SOURCE_DIR}/external/src/nanoarrow/nanoarrow.c
)
target_link_libraries(TILEDBSOMA_NANOARROW_OBJECT
target_link_options(TILEDBSOMA_NANOARROW_OBJECT
PRIVATE
${TILEDBSOMA_SANITIZER_FLAG}
)
Expand Down Expand Up @@ -65,7 +65,7 @@ target_compile_options(TILEDB_SOMA_OBJECTS
${TILEDBSOMA_WERROR_OPTION}
${TILEDBSOMA_SANITIZER_FLAG}
)
target_link_libraries(TILEDB_SOMA_OBJECTS
target_link_options(TILEDB_SOMA_OBJECTS
PRIVATE
${TILEDBSOMA_SANITIZER_FLAG}
)
Expand Down Expand Up @@ -121,6 +121,8 @@ else()
PUBLIC
TileDB::tiledb_shared
spdlog::spdlog
)
target_link_options(tiledbsoma
PRIVATE
${TILEDBSOMA_SANITIZER_FLAG}
)
Expand Down Expand Up @@ -257,6 +259,8 @@ if(TILEDBSOMA_BUILD_CLI)
# spdlog::spdlog
tiledbsoma
TileDB::tiledb_shared
)
target_link_options(tiledbsoma-cli
PRIVATE
${TILEDBSOMA_SANITIZER_FLAG}
)
Expand Down
5 changes: 4 additions & 1 deletion libtiledbsoma/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,13 @@ add_executable(unit_soma

target_link_libraries(unit_soma
PRIVATE
${TILEDBSOMA_SANITIZER_FLAG}
Catch2::Catch2WithMain
TileDB::tiledb_shared
)
target_link_options(unit_soma
PRIVATE
${TILEDBSOMA_SANITIZER_FLAG}
)

target_include_directories(unit_soma
PRIVATE
Expand Down

0 comments on commit 2366932

Please sign in to comment.