Skip to content
This repository has been archived by the owner on May 14, 2024. It is now read-only.

Commit

Permalink
Allow the user to turn off tests with -DBUILD_TESTING=OFF
Browse files Browse the repository at this point in the history
Change-Id: I562e05c0cc24c0596d2f5249451156ae67976a9f
  • Loading branch information
haampie authored and slinder1 committed Dec 15, 2020
1 parent 569bd61 commit 5b684e5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions lib/comgr/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -295,12 +295,14 @@ if (NOT UNIX)
PRIVATE version)
endif()

enable_testing()
add_custom_target(check-comgr COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS amd_comgr)
if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set_property(GLOBAL APPEND PROPERTY LLVM_ADDITIONAL_TEST_TARGETS check-comgr)
include(CTest)
if(BUILD_TESTING)
add_custom_target(check-comgr COMMAND ${CMAKE_CTEST_COMMAND} DEPENDS amd_comgr)
if (NOT CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
set_property(GLOBAL APPEND PROPERTY LLVM_ADDITIONAL_TEST_TARGETS check-comgr)
endif()
add_subdirectory(test)
endif()
add_subdirectory(test)

if(CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
# Add packaging directives for amd_comgr
Expand Down

0 comments on commit 5b684e5

Please sign in to comment.