From 90ff4bf5752e0a6114459219bbad0d5b0bc3b415 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 --- CMakeLists.txt | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index b0fedca3a4..283d256584 100644 --- a/CMakeLists.txt +++ b/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()