Make BUILD_HIPIFY_CLANG a cmake option
Instead of deciding whether to build hipify-clang based on the presence of an LLVM path on the command line, have an explicit option. Do we want this default-on or default-off? I've defaulted it to on for now, but maybe we want the opposite?
This commit is contained in:
+8
-1
@@ -1,6 +1,11 @@
|
||||
cmake_minimum_required(VERSION 2.8.3)
|
||||
project(hip)
|
||||
|
||||
#############################
|
||||
# Options
|
||||
#############################
|
||||
option(BUILD_HIPIFY_CLANG "Enable building the CUDA->HIP converter" OFF)
|
||||
|
||||
#############################
|
||||
# Setup config generation
|
||||
#############################
|
||||
@@ -142,7 +147,9 @@ add_to_config(_buildInfo COMPILE_HIP_ATP_MARKER)
|
||||
# Build steps
|
||||
#############################
|
||||
# Build clang hipify if enabled
|
||||
add_subdirectory(hipify-clang)
|
||||
if (BUILD_HIPIFY_CLANG)
|
||||
add_subdirectory(hipify-clang)
|
||||
endif()
|
||||
|
||||
# Build hip_hcc if platform is hcc
|
||||
if(HIP_PLATFORM STREQUAL "hcc")
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
cmake_minimum_required(VERSION 2.8.8)
|
||||
project(hipify-clang)
|
||||
|
||||
set(BUILD_HIPIFY_CLANG 0 CACHE INTERNAL "")
|
||||
|
||||
if (HIPIFY_CLANG_LLVM_DIR)
|
||||
find_package(LLVM PATHS ${HIPIFY_CLANG_LLVM_DIR} REQUIRED NO_DEFAULT_PATH)
|
||||
else()
|
||||
@@ -10,7 +8,7 @@ else()
|
||||
return()
|
||||
endif()
|
||||
|
||||
option(HIPIFY_CLANG_TESTS "Build the tests for hipify-clang, if lit is installed" ON)
|
||||
option(HIPIFY_CLANG_TESTS "Build the tests for hipify-clang, if lit is installed" OFF)
|
||||
|
||||
# Disable the tests if `lit` or `FileCheck` is not installed.
|
||||
find_program(LIT_COMMAND lit)
|
||||
@@ -102,5 +100,3 @@ if (HIPIFY_CLANG_TESTS)
|
||||
add_dependencies(test-hipify-clang test-hipify)
|
||||
set_target_properties(test-hipify-clang PROPERTIES FOLDER "Tests")
|
||||
endif()
|
||||
|
||||
set(BUILD_HIPIFY_CLANG 1 CACHE INTERNAL "")
|
||||
|
||||
Reference in New Issue
Block a user