<commit_before>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)
else()
    message(STATUS "hipify-clang will not be built. To build it please specify absolute path to LLVM 3.8 or higher using HIPIFY_CLANG_LLVM_DIR")
    return()
endif()

option(HIPIFY_CLANG_TESTS "Build the tests for hipify-clang, if lit is installed" ON)

# Disable the tests if `lit` is not installed.
find_program(LIT_COMMAND lit)
if (NOT LIT_COMMAND)
    set(HIPIFY_CLANG_TESTS OFF CACHE INTERNAL "")
    message(STATUS "hipify-clang's tests are not being built because `lit` is not installed.")
endif()

list(APPEND CMAKE_MODULE_PATH ${LLVM_CMAKE_DIR})
include(AddLLVM)

message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")

include_directories(${LLVM_INCLUDE_DIRS})
link_directories(${LLVM_LIBRARY_DIRS})
add_definitions(${LLVM_DEFINITIONS})
add_llvm_executable(hipify-clang src/Cuda2Hip.cpp)

set(CMAKE_CXX_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang++)
set(CMAKE_C_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang)
<commit_msg>[HIPIFY][fix] cmake: NO_DEFAULT_PATH is strongly needed in find_package for LLVM<commit_after>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()
    message(STATUS "hipify-clang will not be built. To build it please specify absolute path to LLVM 3.8 or higher using HIPIFY_CLANG_LLVM_DIR")
    return()
endif()

option(HIPIFY_CLANG_TESTS "Build the tests for hipify-clang, if lit is installed" ON)

# Disable the tests if `lit` is not installed.
find_program(LIT_COMMAND lit)
if (NOT LIT_COMMAND)
    set(HIPIFY_CLANG_TESTS OFF CACHE INTERNAL "")
    message(STATUS "hipify-clang's tests are not being built because `lit` is not installed.")
endif()

list(APPEND CMAKE_MODULE_PATH ${LLVM_CMAKE_DIR})
include(AddLLVM)

message(STATUS "Found LLVM ${LLVM_PACKAGE_VERSION}")

include_directories(${LLVM_INCLUDE_DIRS})
link_directories(${LLVM_LIBRARY_DIRS})
add_definitions(${LLVM_DEFINITIONS})
add_llvm_executable(hipify-clang src/Cuda2Hip.cpp)

set(CMAKE_CXX_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang++)
set(CMAKE_C_COMPILER ${LLVM_TOOLS_BINARY_DIR}/clang)

{'fraction_non_alphanumeric': 0.09630886720407297, 'fraction_numerical': 0.005939753924480272, 'mean_word_length': 7.103092783505154, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7431586', 'n_tokens_mistral': 926, 'n_tokens_neox': 890, 'n_words': 198}