Skip to content

Commit

Permalink
Fix cmake utility target names
Browse files Browse the repository at this point in the history
  • Loading branch information
tobiashienzsch committed May 11, 2024
1 parent aa9553e commit a622b73
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 24 deletions.
10 changes: 5 additions & 5 deletions cmake/CodeCoverage.cmake
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Code Coverage Configuration
add_library(mc_coverage INTERFACE)
add_library(ra::coverage ALIAS mc_coverage)
add_library(ra_coverage INTERFACE)
add_library(ra::coverage ALIAS ra_coverage)

if(MC_BUILD_COVERAGE AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(mc_coverage INTERFACE -O0 -g --coverage)
target_link_libraries(mc_coverage INTERFACE --coverage)
target_link_options(mc_coverage INTERFACE --coverage)
target_compile_options(ra_coverage INTERFACE -O0 -g --coverage)
target_link_libraries(ra_coverage INTERFACE --coverage)
target_link_options(ra_coverage INTERFACE --coverage)
endif()
22 changes: 11 additions & 11 deletions cmake/CompilerOptions.cmake
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
add_library(mc_compiler_options INTERFACE)
add_library(ra::compiler_options ALIAS mc_compiler_options)
add_library(ra_compiler_options INTERFACE)
add_library(ra::compiler_options ALIAS ra_compiler_options)

if (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC")
target_compile_options(mc_compiler_options INTERFACE "/permissive-")
target_compile_options(ra_compiler_options INTERFACE "/permissive-")
endif()

if(MC_BUILD_ASAN AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(mc_compiler_options INTERFACE -fsanitize=address -fsanitize-address-use-after-scope -O1 -g -fno-omit-frame-pointer)
target_link_libraries(mc_compiler_options INTERFACE -fsanitize=address -fsanitize-address-use-after-scope -O1 -g -fno-omit-frame-pointer)
target_compile_options(ra_compiler_options INTERFACE -fsanitize=address -fsanitize-address-use-after-scope -O1 -g -fno-omit-frame-pointer)
target_link_libraries(ra_compiler_options INTERFACE -fsanitize=address -fsanitize-address-use-after-scope -O1 -g -fno-omit-frame-pointer)
endif()

if(MC_BUILD_UBSAN AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(mc_compiler_options INTERFACE -fsanitize=undefined -O1 -g -fno-omit-frame-pointer)
target_link_libraries(mc_compiler_options INTERFACE -fsanitize=undefined -O1 -g -fno-omit-frame-pointer)
target_compile_options(ra_compiler_options INTERFACE -fsanitize=undefined -O1 -g -fno-omit-frame-pointer)
target_link_libraries(ra_compiler_options INTERFACE -fsanitize=undefined -O1 -g -fno-omit-frame-pointer)
endif()

if(MC_BUILD_MSAN AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(mc_compiler_options INTERFACE -fsanitize=memory -O1 -g -fno-omit-frame-pointer)
target_link_libraries(mc_compiler_options INTERFACE -fsanitize=memory -O1 -g -fno-omit-frame-pointer)
target_compile_options(ra_compiler_options INTERFACE -fsanitize=memory -O1 -g -fno-omit-frame-pointer)
target_link_libraries(ra_compiler_options INTERFACE -fsanitize=memory -O1 -g -fno-omit-frame-pointer)
endif()

if(MC_BUILD_TSAN AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(mc_compiler_options INTERFACE -fsanitize=thread -O1 -g -fno-omit-frame-pointer)
target_link_libraries(mc_compiler_options INTERFACE -fsanitize=thread -O1 -g -fno-omit-frame-pointer)
target_compile_options(ra_compiler_options INTERFACE -fsanitize=thread -O1 -g -fno-omit-frame-pointer)
target_link_libraries(ra_compiler_options INTERFACE -fsanitize=thread -O1 -g -fno-omit-frame-pointer)
endif()
12 changes: 6 additions & 6 deletions cmake/CompilerWarnings.cmake
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
add_library(mc_compiler_warnings INTERFACE)
add_library(ra::compiler_warnings ALIAS mc_compiler_warnings)
add_library(ra_compiler_warnings INTERFACE)
add_library(ra::compiler_warnings ALIAS ra_compiler_warnings)

if((CMAKE_CXX_COMPILER_ID STREQUAL "MSVC") OR (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC"))
target_compile_options(mc_compiler_warnings INTERFACE /W3)
target_compile_options(ra_compiler_warnings INTERFACE /W3)
if (MC_BUILD_WERROR)
target_compile_options(mc_compiler_warnings INTERFACE /WX)
target_compile_options(ra_compiler_warnings INTERFACE /WX)
endif (MC_BUILD_WERROR)
else ()
target_compile_options(mc_compiler_warnings
target_compile_options(ra_compiler_warnings
INTERFACE
-Wall
-Wcast-align
Expand Down Expand Up @@ -51,6 +51,6 @@ else ()
>
)
if (MC_BUILD_WERROR)
target_compile_options(mc_compiler_warnings INTERFACE -Werror)
target_compile_options(ra_compiler_warnings INTERFACE -Werror)
endif (MC_BUILD_WERROR)
endif ()
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
project(mc_acoustics)
project(ra_acoustics)

find_package(mp-units REQUIRED)

add_library(${PROJECT_NAME} STATIC)
add_library(ra_acoustics STATIC)
add_library(ra::acoustics ALIAS ${PROJECT_NAME})
target_include_directories(${PROJECT_NAME}
PUBLIC
Expand Down

0 comments on commit a622b73

Please sign in to comment.