mirror of
https://gitee.com/openharmony/third_party_opencl-headers
synced 2024-11-26 16:50:30 +00:00
option to disable tests when subproject (#195)
This commit is contained in:
parent
80c10b1f65
commit
dcd5bede68
@ -11,6 +11,8 @@ project(OpenCLHeaders
|
||||
# https://stackoverflow.com/questions/43379311/why-does-project-affect-cmakes-opinion-on-cmake-sizeof-void-p
|
||||
)
|
||||
|
||||
option(OPENCL_HEADERS_BUILD_TESTING "Enable support for OpenCL C headers testing." OFF)
|
||||
|
||||
include(GNUInstallDirs)
|
||||
|
||||
add_library(Headers INTERFACE)
|
||||
@ -83,7 +85,9 @@ install(
|
||||
DESTINATION ${config_package_location}
|
||||
)
|
||||
|
||||
if(BUILD_TESTING)
|
||||
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR OPENCL_HEADERS_BUILD_TESTING)
|
||||
include(CTest)
|
||||
endif()
|
||||
if((CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME OR OPENCL_HEADERS_BUILD_TESTING) AND BUILD_TESTING)
|
||||
add_subdirectory(tests)
|
||||
endif()
|
||||
|
Loading…
Reference in New Issue
Block a user