[Flang] Fix libquadmath in non-LLVM_ENABLE_RUNTIMES build.

The LLVM_ENABLE_RUNTIMES build introduced a new configure-time header
quadmath_wrapper.h. Also create the header in non-LLVM_ENABLE_RUNTIMES
builds.
This commit is contained in:
Michael Kruse 2025-03-12 14:51:39 +01:00
parent 5da9044c40
commit cbeae3e117

View File

@ -132,6 +132,12 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES "XL")
set(NO_RTTI_FLAGS "-qnoeh -qnortti")
endif ()
# When compiling LLVM_ENABLE_RUNTIMES=flang-rt, the build system looks for the
# full path of quadmath.h. In this non-runtimes build, preserve the old behavior
# of just including <quadmath.h>.
set(FLANG_RT_INCLUDE_QUADMATH_H "<quadmath.h>")
configure_file("${FLANG_RT_SOURCE_DIR}/cmake/quadmath_wrapper.h.in" "quadmath_wrapper.h")
configure_file("${FLANG_RT_SOURCE_DIR}/cmake/config.h.cmake.in" config.h)
# include_directories is used here instead of target_include_directories
# because add_flang_library creates multiple objects (STATIC/SHARED, OBJECT)