[OpenMP] Disable libomptarget profiling by default if built via the "runtimes" setup

In the "runtimes" setup, the runtime (e.g. OpenMP) can be built for
a target entirely different from the current host build (where LLVM
and Clang are built). If profiling is enabled, libomptarget links
against LLVMSupport (which only has been built for the host).

Thus, don't enable profiling by default in this setup.

This should allow relanding D113253.

Differential Revision: https://reviews.llvm.org/D114083
This commit is contained in:
Martin Storsjö 2021-11-17 15:06:15 +02:00
parent 6116ff297f
commit db32c4f456

View file

@ -61,10 +61,15 @@ if (APPLE OR WIN32 OR NOT OPENMP_HAVE_STD_CPP14_FLAG)
set(ENABLE_LIBOMPTARGET OFF)
endif()
set(ENABLE_LIBOMPTARGET_PROFILING OFF)
if (ENABLE_LIBOMPTARGET AND NOT LLVM_RUNTIMES_BUILD)
set(ENABLE_LIBOMPTARGET_PROFILING ON)
endif()
option(OPENMP_ENABLE_LIBOMPTARGET "Enable building libomptarget for offloading."
${ENABLE_LIBOMPTARGET})
option(OPENMP_ENABLE_LIBOMPTARGET_PROFILING "Enable time profiling for libomptarget."
${ENABLE_LIBOMPTARGET})
${ENABLE_LIBOMPTARGET_PROFILING})
option(OPENMP_ENABLE_LIBOMP_PROFILING "Enable time profiling for libomp." OFF)
# Build host runtime library, after LIBOMPTARGET variables are set since they are needed