Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,26 @@ include_directories (
)

add_subdirectory(backward_vendor/backward-cpp)

if (TARGET Backward::Interface)
get_target_property(_inc Backward::Interface INTERFACE_INCLUDE_DIRECTORIES)
get_target_property(_aliased Backward::Interface ALIASED_TARGET)
if (_aliased)
set(_target_name "${_aliased}")
else()
set(_target_name "Backward::Interface")
endif()
if (_inc)
target_include_directories(${_target_name} INTERFACE SYSTEM ${_inc})
endif()
else()
if (DEFINED BACKWARD_INCLUDE_DIRS)
add_library(BackwardInterfaceLocal INTERFACE)
target_include_directories(BackwardInterfaceLocal INTERFACE SYSTEM ${BACKWARD_INCLUDE_DIRS})
add_library(Backward::Interface ALIAS BackwardInterfaceLocal)
endif()
endif()

add_subdirectory(gtest_vendor)
add_subdirectory(benchmark)
add_subdirectory(integration)
Expand Down
12 changes: 11 additions & 1 deletion test/backward_vendor/backward-cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ endif()
add_library(backward_interface INTERFACE)
set_target_properties(backward_interface PROPERTIES EXPORT_NAME Interface)
target_compile_definitions(backward_interface INTERFACE ${BACKWARD_DEFINITIONS})
target_include_directories(backward_interface INTERFACE ${BACKWARD_INCLUDE_DIRS})
target_include_directories(backward_interface INTERFACE SYSTEM ${BACKWARD_INCLUDE_DIRS})
if(BACKWARD_HAS_EXTERNAL_LIBRARIES)
target_link_libraries(backward_interface INTERFACE ${BACKWARD_LIBRARIES})
endif()
Expand All @@ -100,6 +100,12 @@ set_target_properties(backward_object PROPERTIES EXPORT_NAME Object)
target_link_libraries(backward_object PUBLIC Backward::Interface)
add_library(Backward::Object ALIAS backward_object)

if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(backward_object PRIVATE -Wno-switch-default)
else()

endif()

###############################################################################
# BACKWARD LIBRARY (Includes backward.cpp)
# (Note that the linker will not include unused objects from a static library,
Expand All @@ -115,6 +121,10 @@ set_target_properties(backward PROPERTIES EXPORT_NAME Backward)
target_link_libraries(backward PUBLIC Backward::Interface)
add_library(Backward::Backward ALIAS backward)

if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
target_compile_options(backward PRIVATE -Wno-switch-default)
endif()

# check if Backward is being used as a top-level project or included as a subproject
if(CMAKE_SOURCE_DIR STREQUAL PROJECT_SOURCE_DIR)
install(
Expand Down
Loading