mirror of
https://github.com/SFML/SFML.git
synced 2024-11-28 22:31:09 +08:00
Hide doctest sources from compile commands database
This ensure that tools like run-clang-tidy don't try to analyze them and better mimmicks how Doctest would behave if we were depending on Doctest via find_package instead.
This commit is contained in:
parent
fc61f2469d
commit
3d02d490bd
@ -2,12 +2,16 @@ include(FetchContent)
|
|||||||
|
|
||||||
set(DOCTEST_NO_INSTALL ON)
|
set(DOCTEST_NO_INSTALL ON)
|
||||||
FetchContent_Declare(doctest
|
FetchContent_Declare(doctest
|
||||||
GIT_REPOSITORY "https://github.com/doctest/doctest.git"
|
GIT_REPOSITORY https://github.com/doctest/doctest.git
|
||||||
GIT_TAG v2.4.9
|
GIT_TAG v2.4.9
|
||||||
)
|
)
|
||||||
FetchContent_MakeAvailable(doctest)
|
FetchContent_MakeAvailable(doctest)
|
||||||
list(APPEND CMAKE_MODULE_PATH ${doctest_SOURCE_DIR}/scripts/cmake)
|
include(${doctest_SOURCE_DIR}/scripts/cmake/doctest.cmake)
|
||||||
include(doctest)
|
|
||||||
|
# Ensure that doctest sources and headers are not analyzed by any tools
|
||||||
|
set_target_properties(doctest_with_main PROPERTIES COMPILE_OPTIONS "" EXPORT_COMPILE_COMMANDS OFF)
|
||||||
|
get_target_property(DOCTEST_INCLUDE_DIRS doctest INTERFACE_INCLUDE_DIRECTORIES)
|
||||||
|
target_include_directories(doctest SYSTEM INTERFACE ${DOCTEST_INCLUDE_DIRS})
|
||||||
|
|
||||||
add_subdirectory(install)
|
add_subdirectory(install)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user