diff --git a/clang/runtime/CMakeLists.txt b/clang/runtime/CMakeLists.txt --- a/clang/runtime/CMakeLists.txt +++ b/clang/runtime/CMakeLists.txt @@ -22,6 +22,8 @@ endif() endfunction() +option(COMPILER_RT_INCLUDE_TESTS "Generate build targets for compiler-rt tests." ${LLVM_INCLUDE_TESTS}) + set(COMPILER_RT_SRC_ROOT ${LLVM_MAIN_SRC_DIR}/projects/compiler-rt) # Fallback to the external path, if the other one isn't available. # This is the same behavior (try "internal", then check the LLVM_EXTERNAL_... @@ -62,7 +64,7 @@ if(TARGET cxx-headers) list(APPEND compiler_rt_configure_deps "cxx-headers") endif() - if(LLVM_INCLUDE_TESTS) + if(COMPILER_RT_INCLUDE_TESTS) list(APPEND compiler_rt_configure_deps LLVMTestingSupport) endif() @@ -85,7 +87,6 @@ -DCOMPILER_RT_OUTPUT_DIR=${LLVM_LIBRARY_OUTPUT_INTDIR}/clang/${CLANG_VERSION} -DCOMPILER_RT_EXEC_OUTPUT_DIR=${LLVM_RUNTIME_OUTPUT_INTDIR} -DCOMPILER_RT_INSTALL_PATH:PATH=lib${LLVM_LIBDIR_SUFFIX}/clang/${CLANG_VERSION} - -DCOMPILER_RT_INCLUDE_TESTS=${LLVM_INCLUDE_TESTS} -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX} -DLLVM_LIBDIR_SUFFIX=${LLVM_LIBDIR_SUFFIX} -DLLVM_RUNTIME_OUTPUT_INTDIR=${LLVM_RUNTIME_OUTPUT_INTDIR} @@ -129,7 +130,7 @@ VERBATIM USES_TERMINAL) endforeach() - if(LLVM_INCLUDE_TESTS) + if(COMPILER_RT_INCLUDE_TESTS) # Add binaries that compiler-rt tests depend on. set(COMPILER_RT_TEST_DEPENDENCIES FileCheck count not llvm-nm llvm-objdump llvm-symbolizer llvm-jitlink)