diff --git a/CMakeLists.txt b/CMakeLists.txt index 4c89c93668..1304e9f7d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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") diff --git a/hipify-clang/CMakeLists.txt b/hipify-clang/CMakeLists.txt index cb8354157b..7b43f2beb7 100644 --- a/hipify-clang/CMakeLists.txt +++ b/hipify-clang/CMakeLists.txt @@ -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 "")