From 148439190bc2a2f951a120ea7a621eca5806121d Mon Sep 17 00:00:00 2001 From: Karl W Schulz Date: Mon, 3 Jun 2024 11:36:01 -0500 Subject: [PATCH] wrap up test compilation with an ENABLE_TESTS option Signed-off-by: Karl W Schulz [ROCm/rocprofiler-compute commit: 90ff4bf5752e0a6114459219bbad0d5b0bc3b415] --- projects/rocprofiler-compute/CMakeLists.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/projects/rocprofiler-compute/CMakeLists.txt b/projects/rocprofiler-compute/CMakeLists.txt index b0fedca3a4..283d256584 100644 --- a/projects/rocprofiler-compute/CMakeLists.txt +++ b/projects/rocprofiler-compute/CMakeLists.txt @@ -27,12 +27,10 @@ string(REGEX REPLACE "([0-9]+)\.([0-9]+)\.([0-9]+)(.*)" "\\1.\\2.\\3" OMNIPERF_V project( omniperf VERSION ${OMNIPERF_VERSION} - LANGUAGES HIP + LANGUAGES C DESCRIPTION "OmniPerf" HOMEPAGE_URL "https://github.com/ROCm/omniperf") -set(CMAKE_HIP_FLAGS_RELEASE "-O2") - include(ExternalProject) include(GNUInstallDirs) @@ -158,7 +156,14 @@ if(${GIT_CLONE}) endif() # Setup testing collateral -add_subdirectory(tests) + +option(ENABLE_TESTS "Enable compilation of testing collateral" OFF) +if(${ENABLE_TESTS}) + enable_language("C" "HIP") + add_subdirectory(tests) + set(CMAKE_HIP_FLAGS_RELEASE "-O2") +endif() +message(STATUS "Enable tests compilation: ${ENABLE_TESTS}") enable_testing()