From fdfedbd60fac6cd3815a850c55aa816a07b8a778 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Mon, 4 Apr 2016 13:53:24 +0530 Subject: [PATCH] Enable directed tests to build HIP locally via cmake option --- hipamd/tests/src/CMakeLists.txt | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/hipamd/tests/src/CMakeLists.txt b/hipamd/tests/src/CMakeLists.txt index 8d5dae6328..a0413eaad8 100644 --- a/hipamd/tests/src/CMakeLists.txt +++ b/hipamd/tests/src/CMakeLists.txt @@ -8,7 +8,13 @@ include_directories( ${PROJECT_SOURCE_DIR}/include ) set (HIP_Unit_Test_VERSION_MAJOR 1) set (HIP_Unit_Test_VERSION_MINOR 0) -set (HIP_BUILD_LOCAL 0) +if(NOT DEFINED HIP_BUILD_LOCAL) + if(NOT DEFINED ENV{HIP_BUILD_LOCAL}) + set(HIP_BUILD_LOCAL 0 CACHE BOOL "Build HIP in local folder") + else() + set(HIP_BUILD_LOCAL $ENV{HIP_BUILD_LOCAL} CACHE BOOL "Build HIP in local folder") + endif() +endif() set(HIP_PATH $ENV{HIP_PATH}) if (NOT DEFINED HIP_PATH) @@ -75,9 +81,12 @@ add_library(test_common OBJECT test_common.cpp ) # usage : make_hip_executable (exe_name CPP_FILES) macro (make_hip_executable exe cpp) if (${HIP_PLATFORM} STREQUAL "hcc") - add_executable (${exe} ${cpp} ${ARGN} $ ) + #add_executable (${exe} ${cpp} ${ARGN} $ ) if (${HIP_BUILD_LOCAL}) - target_link_libraries(${exe} hip_hcc) + #target_link_libraries(${exe} hip_hcc) + add_executable (${exe} ${cpp} ${ARGN} $ $ ) + else() + add_executable (${exe} ${cpp} ${ARGN} $ ) endif() else() add_executable (${exe} ${cpp} ${ARGN} $ )