Skip to content

Instantly share code, notes, and snippets.

@naromero77
Created January 5, 2024 03:11
Show Gist options
  • Save naromero77/660c1543655fb054ff30b875d20a00c4 to your computer and use it in GitHub Desktop.
Save naromero77/660c1543655fb054ff30b875d20a00c4 to your computer and use it in GitHub Desktop.
LLVM CMake Cache file with OpenMP runtime
# MyCache.cmake
set(CMAKE_BUILD_TYPE Release CACHE STRING "")
set(LLVM_TARGETS_TO_BUILD X86;AArch64 CACHE STRING "")
set(LLVM_ENABLE_PROJECTS "clang;lld" CACHE STRING "")
set(LLVM_ENABLE_RUNTIMES "compiler-rt;libcxx;libcxxabi;libunwind;openmp" CACHE STRING "")
set(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR ON CACHE BOOL "")
set(LLVM_BUILTIN_TARGETS "x86_64-linux-gnu;aarch64-linux-gnu" CACHE STRING "")
foreach(target ${LLVM_BUILTIN_TARGETS})
message("target = " ${target})
set(BUILTINS_${target}_CMAKE_SYSTEM_NAME "Linux" CACHE STRING "")
set(BUILTINS_${target}_CMAKE_C_FLAGS "--target=${target}" CACHE STRING "")
set(BUILTINS_${target}_CMAKE_CXX_FLAGS "--target=${target}" CACHE STRING "")
set(BUILTINS_${target}_CMAKE_ASM_FLAGS "--target=${target}" CACHE STRING "")
set(BUILTINS_${target}_CMAKE_SYSROOT ${LINUX_${target}_SYSROOT} CACHE STRING "")
set(BUILTINS_${target}_CMAKE_SHARED_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
set(BUILTINS_${target}_CMAKE_MODULE_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
set(BUILTINS_${target}_CMAKE_EXE_LINKER_FLAG "-fuse-ld=lld" CACHE STRING "")
endforeach()
set(LLVM_RUNTIME_TARGETS "x86_64-linux-gnu;aarch64-linux-gnu" CACHE STRING "")
foreach(target ${LLVM_RUNTIME_TARGETS})
message("target = " ${target})
set(RUNTIMES_${target}_CMAKE_SYSTEM_NAME "Linux" CACHE STRING "")
set(RUNTIMES_${target}_CMAKE_C_FLAGS "--target=${target}" CACHE STRING "")
set(RUNTIMES_${target}_CMAKE_CXX_FLAGS "--target=${target}" CACHE STRING "")
set(RUNTIMES_${target}_CMAKE_ASM_FLAGS "--target=${target}" CACHE STRING "")
set(RUNTIMES_${target}_CMAKE_SYSROOT ${LINUX_${target}_SYSROOT} CACHE STRING "")
set(RUNTIMES_${target}_CMAKE_SHARED_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
set(RUNTIMES_${target}_CMAKE_MODULE_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
set(RUNTIMES_${target}_CMAKE_EXE_LINKER_FLAGS "-fuse-ld=lld" CACHE STRING "")
set(RUNTIMES_${target}_CMAKE_BUILD_WITH_INSTALL_RPATH ON CACHE BOOL "")
set(RUNTIMES_${target}_LIBUNWIND_ENABLE_SHARED OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXXABI_ENABLE_SHARED OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBCXX_ENABLE_SHARED OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBOMP_ARCH "${target}" CACHE STRING "")
set(RUNTIMES_${target}_LIBOMP_ENABLE_SHARED OFF CACHE BOOL "")
set(RUNTIMES_${target}_OPENMP_ENABLE_LIBOMPTARGET OFF CACHE BOOL "")
set(RUNTIMES_${target}_OPENMP_ENABLE_OMPT_TOOLS OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBOMP_OMPD_GDB_SUPPORT OFF CACHE BOOL "")
set(RUNTIMES_${target}_LIBOMP_OMPT_SUPPORT OFF CACHE BOOL "")
endforeach()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment