[Offload] Add OFFLOAD_INCLUDE_TESTS (#143388)

This is a cmake variable which, if set to `OFF` will disable building of
tests. It defaults to the value of `LLVM_INCLUDE_TESTS`.
This commit is contained in:
Ross Brunton
2025-06-09 16:27:40 +01:00
committed by GitHub
parent a3c7d46145
commit 637df705e5

View File

@@ -41,6 +41,8 @@ endif()
set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
option(OFFLOAD_INCLUDE_TESTS "Generate and build offload tests." ${LLVM_INCLUDE_TESTS})
# Add path for custom modules
list(INSERT CMAKE_MODULE_PATH 0
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
@@ -376,6 +378,7 @@ add_subdirectory(libomptarget)
add_subdirectory(liboffload)
# Add tests.
if(OFFLOAD_INCLUDE_TESTS)
add_subdirectory(test)
# Add unit tests if GMock/GTest is present
@@ -388,3 +391,4 @@ endif()
if(TARGET llvm_gtest)
add_subdirectory(unittests)
endif()
endif()