1 cmake_minimum_required(VERSION 3.20.0)
2 set(LLVM_SUBPROJECT_TITLE "Flang")
4 if(NOT DEFINED LLVM_COMMON_CMAKE_UTILS)
5 set(LLVM_COMMON_CMAKE_UTILS ${CMAKE_CURRENT_SOURCE_DIR}/../cmake)
7 include(${LLVM_COMMON_CMAKE_UTILS}/Modules/CMakePolicy.cmake
10 set(CMAKE_BUILD_WITH_INSTALL_NAME_DIR ON)
12 # Flang requires C++17.
13 set(CMAKE_CXX_STANDARD 17)
14 set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
15 set(CMAKE_CXX_EXTENSIONS OFF)
18 # To match with the flang guidelines we currently disable
19 # building with exception support in core LLVM.
20 message(FATAL_ERROR "Flang does not currently support building with \
21 LLVM exceptions enabled. Please disable LLVM_ENABLE_EH when building \
25 set(FLANG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
27 if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE)
28 message(FATAL_ERROR "In-source builds are not allowed. \
29 Please create a directory and run cmake from there,\
30 passing the path to this source directory as the last argument.\
31 This process created the file `CMakeCache.txt' and the directory\
32 `CMakeFiles'. Please delete them.")
35 option(FLANG_ENABLE_WERROR "Fail and stop building flang if a warning is triggered." OFF)
37 # The out of tree builds of the compiler and the Fortran runtime
38 # must use the same setting of FLANG_RUNTIME_F128_MATH_LIB
39 # to be composable. Failure to synchronize this setting may result
40 # in linking errors or fatal failures in F128 runtime functions.
41 set(FLANG_RUNTIME_F128_MATH_LIB "" CACHE STRING
42 "Specifies the target library used for implementing IEEE-754 128-bit float \
43 math in F18 runtime, e.g. it might be libquadmath for targets where \
44 REAL(16) is mapped to __float128, or libm for targets where REAL(16) \
45 is mapped to long double, etc."
48 # Check for a standalone build and configure as appropriate from
50 if (CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR)
51 message("Building Flang as a standalone project.")
53 set(FLANG_STANDALONE_BUILD ON)
55 set(FLANG_STANDALONE_BUILD OFF)
58 # Must go below project(..)
59 include(GNUInstallDirs)
61 # MSVC + clang-cl build requires clang_rt.builtin.${target} library
62 if (MSVC AND CMAKE_CXX_COMPILER_ID MATCHES Clang)
63 include(HandleCompilerRT)
64 find_compiler_rt_library(builtins CLANG_RT_BUILTINS_LIBRARY)
65 get_filename_component(LIBDIR "${CLANG_RT_BUILTINS_LIBRARY}" DIRECTORY)
66 if (IS_DIRECTORY "${LIBDIR}")
67 link_libraries(${CLANG_RT_BUILTINS_LIBRARY})
71 if(CMAKE_SIZEOF_VOID_P EQUAL 4)
72 message(FATAL_ERROR "flang isn't supported on 32 bit CPUs")
75 if (FLANG_STANDALONE_BUILD)
76 set(FLANG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
77 set(CMAKE_INCLUDE_CURRENT_DIR ON)
79 set(LLVM_ENABLE_ASSERTIONS ${ENABLE_ASSERTIONS}
80 CACHE BOOL "Enable assertions")
81 # Assertions follow llvm's configuration.
82 mark_as_advanced(LLVM_ENABLE_ASSERTIONS)
85 # If the user specifies a relative path to LLVM_DIR, the calls to include
86 # LLVM modules fail. Append the absolute path to LLVM_DIR instead.
87 get_filename_component(LLVM_DIR_ABSOLUTE ${LLVM_DIR}
88 REALPATH BASE_DIR ${CMAKE_CURRENT_BINARY_DIR})
89 list(APPEND CMAKE_MODULE_PATH ${LLVM_DIR_ABSOLUTE})
90 # We need a pre-built/installed version of LLVM.
91 find_package(LLVM REQUIRED HINTS "${LLVM_DIR_ABSOLUTE}")
93 # Users might specify a path to CLANG_DIR that's:
95 # * a path relative to the path of this script.
96 # Append the absolute path to CLANG_DIR so that find_package works in both
98 get_filename_component(
102 BASE_DIR ${CMAKE_CURRENT_BINARY_DIR})
103 list(APPEND CMAKE_MODULE_PATH ${CLANG_DIR_ABSOLUTE})
105 # TODO: Remove when libclangDriver is lifted out of Clang
106 find_package(Clang REQUIRED PATHS "${CLANG_DIR_ABSOLUTE}" NO_DEFAULT_PATH)
108 message(FATAL_ERROR "Failed to find Clang")
111 # If LLVM links to zlib we need the imported targets so we can too.
113 find_package(ZLIB REQUIRED)
115 option(LLVM_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
116 if(CMAKE_COMPILER_IS_GNUCXX)
117 set(USE_NO_MAYBE_UNINITIALIZED 1)
120 include(CMakeParseArguments)
122 include(HandleLLVMOptions)
123 include(VersionFromVCS)
124 include(GetErrcMessages)
129 # If the user specifies a relative path to MLIR_DIR, the calls to include
130 # MLIR modules fail. Append the absolute path to MLIR_DIR instead.
131 get_filename_component(MLIR_DIR_ABSOLUTE ${MLIR_DIR}
132 REALPATH BASE_DIR ${CMAKE_CURRENT_BINARY_DIR})
133 list(APPEND CMAKE_MODULE_PATH ${MLIR_DIR_ABSOLUTE})
134 find_package(MLIR REQUIRED CONFIG HINTS ${MLIR_DIR_ABSOLUTE})
135 # Use SYSTEM for the same reasons as for LLVM includes
136 include_directories(SYSTEM ${MLIR_INCLUDE_DIRS})
138 find_program(MLIR_TABLEGEN_EXE "mlir-tblgen" ${LLVM_TOOLS_BINARY_DIR}
141 option(LLVM_INSTALL_TOOLCHAIN_ONLY
142 "Only include toolchain files in the 'install' target." OFF)
143 option(LLVM_FORCE_USE_OLD_TOOLCHAIN
144 "Set to ON to force using an old, unsupported host toolchain." OFF)
147 # Add LLVM include files as if they were SYSTEM because there are complex unused
148 # parameter issues that may or may not appear depending on the environments and
149 # compilers (ifdefs are involved). This allows warnings from LLVM headers to be
150 # ignored while keeping -Wunused-parameter a fatal error inside f18 code base.
151 # This may have to be fine-tuned if flang headers are consider part of this
152 # LLVM_INCLUDE_DIRS when merging in the monorepo (Warning from flang headers
153 # should not be suppressed).
154 include_directories(SYSTEM ${LLVM_INCLUDE_DIRS})
155 add_definitions(${LLVM_DEFINITIONS})
157 # LLVM's cmake configuration files currently sneak in a c++11 flag.
158 # We look for it here and remove it from Flang's compile flags to
159 # avoid some mixed compilation flangs (e.g. -std=c++11 ... -std=c++17).
160 if (DEFINED LLVM_CXX_STD)
161 message("LLVM configuration set a C++ standard: ${LLVM_CXX_STD}")
162 if (NOT LLVM_CXX_STD EQUAL "c++17")
163 message("Flang: Overriding LLVM's 'cxx_std' setting...")
164 message(" removing '-std=${LLVM_CXX_STD}'")
165 message(" CMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'")
166 string(REPLACE " -std=${LLVM_CXX_STD}" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
167 message(" [NEW] CMAKE_CXX_FLAGS='${CMAKE_CXX_FLAGS}'")
171 link_directories("${LLVM_LIBRARY_DIR}")
173 set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
174 set(CMAKE_LIBRARY_OUTPUT_DIRECTORY
175 ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})
176 set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY
177 ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})
179 set(LLVM_EXTERNAL_LIT "${LLVM_TOOLS_BINARY_DIR}/llvm-lit" CACHE STRING "Command used to spawn lit")
181 option(FLANG_INCLUDE_TESTS
182 "Generate build targets for the Flang unit tests."
185 get_errc_messages(LLVM_LIT_ERRC_MESSAGES)
187 #Handle unittests when out-of-tree
188 set(FLANG_GTEST_AVAIL 0)
189 if (FLANG_INCLUDE_TESTS)
190 set(UNITTEST_DIR ${LLVM_THIRD_PARTY_DIR}/unittest)
191 if(EXISTS ${UNITTEST_DIR}/googletest/include/gtest/gtest.h)
192 if (NOT TARGET llvm_gtest)
193 add_subdirectory(${UNITTEST_DIR} third-party/unittest)
195 set(FLANG_GTEST_AVAIL 1)
198 "Unit-tests will be skipped as LLVM install does not include google-test related headers and libraries.")
199 set(FLANG_GTEST_AVAIL 0)
202 if (FLANG_GTEST_AVAIL)
203 add_custom_target(check-all DEPENDS check-flang FlangUnitTests)
205 add_custom_target(check-all DEPENDS check-flang )
208 add_custom_target(doxygen ALL)
212 option(FLANG_INCLUDE_TESTS
213 "Generate build targets for the Flang unit tests."
214 ${LLVM_INCLUDE_TESTS})
215 set(FLANG_GTEST_AVAIL 1)
217 if(FLANG_STANDALONE_BUILD)
218 set(FLANG_BINARY_DIR ${CMAKE_BINARY_DIR}/tools/flang)
220 set(FLANG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
223 set(MLIR_MAIN_SRC_DIR ${LLVM_MAIN_SRC_DIR}/../mlir ) # --src-root
224 set(MLIR_INCLUDE_DIR ${MLIR_MAIN_SRC_DIR}/include ) # --includedir
225 set(MLIR_TABLEGEN_OUTPUT_DIR ${CMAKE_BINARY_DIR}/tools/mlir/include)
226 include_directories(SYSTEM ${MLIR_INCLUDE_DIR})
227 include_directories(SYSTEM ${MLIR_TABLEGEN_OUTPUT_DIR})
230 set(FLANG_TOOLS_INSTALL_DIR "${CMAKE_INSTALL_BINDIR}" CACHE PATH
231 "Path for binary subdirectory (defaults to '${CMAKE_INSTALL_BINDIR}')")
232 mark_as_advanced(FLANG_TOOLS_INSTALL_DIR)
234 set(FLANG_INTRINSIC_MODULES_DIR ${CMAKE_BINARY_DIR}/include/flang)
235 set(FLANG_INCLUDE_DIR ${FLANG_BINARY_DIR}/include)
237 # TODO: Remove when libclangDriver is lifted out of Clang
238 if(FLANG_STANDALONE_BUILD)
239 set(CLANG_INCLUDE_DIR ${CLANG_INCLUDE_DIRS} )
240 # No need to specify TableGen output dir as that's embedded in CLANG_DIR
242 set(CLANG_INCLUDE_DIR ${LLVM_MAIN_SRC_DIR}/../clang/include )
243 # Specify TableGen output dir for things like DiagnosticCommonKinds.inc,
244 # DiagnosticDriverKinds.inc (required for reporting diagnostics)
245 set(CLANG_TABLEGEN_OUTPUT_DIR ${CMAKE_BINARY_DIR}/tools/clang/include)
246 include_directories(SYSTEM ${CLANG_TABLEGEN_OUTPUT_DIR})
248 include_directories(SYSTEM ${CLANG_INCLUDE_DIR})
250 # tco tool and FIR lib output directories
251 if(FLANG_STANDALONE_BUILD)
252 set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/bin)
253 set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/lib)
255 # Always build tco tool
256 set(LLVM_BUILD_TOOLS ON)
258 include_directories(BEFORE
259 ${FLANG_BINARY_DIR}/include
260 ${FLANG_SOURCE_DIR}/include)
262 # Add Flang-centric modules to cmake path.
263 list(INSERT CMAKE_MODULE_PATH 0
264 "${FLANG_SOURCE_DIR}/cmake/modules"
265 "${LLVM_COMMON_CMAKE_UTILS}/Modules"
269 if (NOT DEFAULT_SYSROOT)
270 set(DEFAULT_SYSROOT "" CACHE PATH
271 "The <path> to use for the system root for all compiler invocations (--sysroot=<path>).")
274 if (NOT ENABLE_LINKER_BUILD_ID)
275 set(ENABLE_LINKER_BUILD_ID OFF CACHE BOOL "pass --build-id to ld")
278 set(FLANG_DEFAULT_LINKER "" CACHE STRING
279 "Default linker to use (linker name or absolute path, empty for platform default)")
281 set(FLANG_DEFAULT_RTLIB "" CACHE STRING
282 "Default Fortran runtime library to use (\"libFortranRuntime\"), leave empty for platform default.")
284 if (NOT(FLANG_DEFAULT_RTLIB STREQUAL ""))
285 message(WARNING "Resetting Flang's default runtime library to use platform default.")
286 set(FLANG_DEFAULT_RTLIB "" CACHE STRING
287 "Default runtime library to use (empty for platform default)" FORCE)
292 set(PACKAGE_VERSION "${LLVM_PACKAGE_VERSION}")
293 if (NOT PACKAGE_VERSION)
294 set(PACKAGE_VERSION ${LLVM_VERSION_MAJOR})
298 if (NOT DEFINED FLANG_VERSION_MAJOR)
299 set(FLANG_VERSION_MAJOR ${LLVM_VERSION_MAJOR})
302 if (NOT DEFINED FLANG_VERSION_MINOR)
303 set(FLANG_VERSION_MINOR ${LLVM_VERSION_MINOR})
306 if (NOT DEFINED FLANG_VERSION_PATCHLEVEL)
307 set(FLANG_VERSION_PATCHLEVEL ${LLVM_VERSION_PATCH})
310 # Unlike PACKAGE_VERSION, FLANG_VERSION does not include LLVM_VERSION_SUFFIX.
311 set(FLANG_VERSION "${FLANG_VERSION_MAJOR}.${FLANG_VERSION_MINOR}.${FLANG_VERSION_PATCHLEVEL}")
312 message(STATUS "Flang version: ${FLANG_VERSION}")
313 # Flang executable version information
314 set(FLANG_EXECUTABLE_VERSION
315 "${FLANG_VERSION_MAJOR}" CACHE STRING
316 "Major version number to appended to the flang executable name.")
317 set(LIBFLANG_LIBRARY_VERSION
318 "${FLANG_VERSION_MAJOR}" CACHE STRING
319 "Major version number to appended to the libflang library.")
321 mark_as_advanced(FLANG_EXECUTABLE_VERSION LIBFLANG_LIBRARY_VERSION)
323 set(FLANG_VENDOR ${PACKAGE_VENDOR} CACHE STRING
324 "Vendor-specific Flang version information.")
325 set(FLANG_VENDOR_UTI "org.llvm.flang" CACHE STRING
326 "Vendor-specific uti.")
329 add_definitions(-DFLANG_VENDOR="${FLANG_VENDOR} ")
332 set(FLANG_REPOSITORY_STRING "" CACHE STRING
333 "Vendor-specific text for showing the repository the source is taken from.")
334 if (FLANG_REPOSITORY_STRING)
335 add_definitions(-DFLANG_REPOSITORY_STRING="${FLANG_REPOSITORY_STRING}")
338 if (FLANG_RUNTIME_F128_MATH_LIB)
339 add_compile_definitions(
340 FLANG_RUNTIME_F128_MATH_LIB="${FLANG_RUNTIME_F128_MATH_LIB}"
344 include(TestBigEndian)
345 test_big_endian(IS_BIGENDIAN)
347 add_compile_definitions(FLANG_BIG_ENDIAN=1)
349 add_compile_definitions(FLANG_LITTLE_ENDIAN=1)
352 # Configure Flang's Version.inc file.
354 ${CMAKE_CURRENT_SOURCE_DIR}/include/flang/Version.inc.in
355 ${CMAKE_CURRENT_BINARY_DIR}/include/flang/Version.inc)
356 # Configure Flang's version info header file.
358 ${FLANG_SOURCE_DIR}/include/flang/Config/config.h.cmake
359 ${FLANG_BINARY_DIR}/include/flang/Config/config.h)
361 if (FLANG_ENABLE_WERROR)
362 # The following is taken from llvm/cmake/modules/HandleLLVMOptions.cmake
363 # Keep this up-to-date with that file
365 append("/WX" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
367 if ( LLVM_COMPILER_IS_GCC_COMPATIBLE )
368 append("-Werror" CMAKE_C_FLAGS CMAKE_CXX_FLAGS)
369 append("-Wno-error" CMAKE_REQUIRED_FLAGS)
370 endif( LLVM_COMPILER_IS_GCC_COMPATIBLE )
373 # Builtin check_cxx_compiler_flag doesn't seem to work correctly
374 macro(check_compiler_flag flag resultVar)
375 unset(${resultVar} CACHE)
376 check_cxx_compiler_flag("${flag}" ${resultVar})
379 check_compiler_flag("-Werror -Wno-deprecated-copy" CXX_SUPPORTS_NO_DEPRECATED_COPY_FLAG)
380 if (CXX_SUPPORTS_NO_DEPRECATED_COPY_FLAG)
381 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-copy")
383 check_compiler_flag("-Wstring-conversion" CXX_SUPPORTS_NO_STRING_CONVERSION_FLAG)
384 if (CXX_SUPPORTS_NO_STRING_CONVERSION_FLAG)
385 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-string-conversion")
387 check_compiler_flag("-Wno-ctad-maybe-unsupported" CXX_SUPPORTS_NO_CTAD_MAYBE_UNSUPPORTED_FLAG)
388 if (CXX_SUPPORTS_NO_CTAD_MAYBE_UNSUPPORTED_FLAG)
389 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-ctad-maybe-unsupported")
392 # Add appropriate flags for GCC
393 if (LLVM_COMPILER_IS_GCC_COMPATIBLE)
395 if (NOT "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
396 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-strict-aliasing -fno-semantic-interposition")
398 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-command-line-argument -Wstring-conversion \
399 -Wcovered-switch-default")
402 check_cxx_compiler_flag("-Werror -Wnested-anon-types" CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG)
403 if (CXX_SUPPORTS_NO_NESTED_ANON_TYPES_FLAG)
404 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-nested-anon-types")
407 # Add to build type flags.
408 set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DDEBUGF18")
409 set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -DCHECK=\"(void)\"")
411 # Building shared libraries is bad for performance with GCC by default
412 # due to the need to preserve the right to override external entry points
413 if (BUILD_SHARED_LIBS AND NOT (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
414 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fno-semantic-interposition")
419 # Clang on Darwin enables non-POSIX extensions by default, which allows the
420 # macro HUGE to leak out of <math.h> even when it is never directly included,
421 # conflicting with Flang's HUGE symbols.
422 # Set _POSIX_C_SOURCE to avoid including these extensions.
424 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_POSIX_C_SOURCE=200809")
427 list(REMOVE_DUPLICATES CMAKE_CXX_FLAGS)
429 # Determine HOST_LINK_VERSION on Darwin.
430 set(HOST_LINK_VERSION)
434 COMMAND sh -c "${CMAKE_LINKER} -v 2>&1 | head -1"
435 RESULT_VARIABLE HAD_ERROR
436 OUTPUT_VARIABLE LD_V_OUTPUT)
438 if ("${LD_V_OUTPUT}" MATCHES ".*ld64-([0-9.]+).*")
439 string(REGEX REPLACE ".*ld64-([0-9.]+).*" "\\1" HOST_LINK_VERSION ${LD_V_OUTPUT})
440 elseif ("${LD_V_OUTPUT}" MATCHES "[^0-9]*([0-9.]+).*")
441 string(REGEX REPLACE "[^0-9]*([0-9.]+).*" "\\1" HOST_LINK_VERSION ${LD_V_OUTPUT})
444 message(FATAL_ERROR "${CMAKE_LINKER} failed with status ${HAD_ERROR}")
448 include(CMakeParseArguments)
451 if (FLANG_INCLUDE_TESTS)
452 add_compile_definitions(FLANG_INCLUDE_TESTS=1)
455 add_subdirectory(include)
456 add_subdirectory(lib)
457 add_subdirectory(cmake/modules)
459 option(FLANG_BUILD_TOOLS
460 "Build the Flang tools. If OFF, just generate build targets." ON)
461 if (FLANG_BUILD_TOOLS)
462 add_subdirectory(tools)
465 option(FLANG_CUF_RUNTIME
466 "Compile CUDA Fortran runtime sources" OFF)
467 if (FLANG_CUF_RUNTIME)
468 find_package(CUDAToolkit REQUIRED)
471 add_subdirectory(runtime)
473 if (LLVM_INCLUDE_EXAMPLES)
474 add_subdirectory(examples)
477 if (FLANG_INCLUDE_TESTS)
478 add_subdirectory(test)
479 if (FLANG_GTEST_AVAIL)
480 add_subdirectory(unittests)
484 option(FLANG_INCLUDE_DOCS "Generate build targets for the Flang docs."
485 ${LLVM_INCLUDE_DOCS})
486 if (FLANG_INCLUDE_DOCS)
487 add_subdirectory(docs)
490 # Custom target to install Flang libraries.
491 add_custom_target(flang-libraries)
492 set_target_properties(flang-libraries PROPERTIES FOLDER "Flang/Meta")
494 if (NOT LLVM_ENABLE_IDE)
495 add_llvm_install_targets(install-flang-libraries
496 DEPENDS flang-libraries
497 COMPONENT flang-libraries)
500 get_property(FLANG_LIBS GLOBAL PROPERTY FLANG_LIBS)
502 list(REMOVE_DUPLICATES FLANG_LIBS)
503 foreach(lib ${FLANG_LIBS})
504 add_dependencies(flang-libraries ${lib})
505 if (NOT LLVM_ENABLE_IDE)
506 add_dependencies(install-flang-libraries install-${lib})
511 if (NOT LLVM_INSTALL_TOOLCHAIN_ONLY)
512 add_llvm_install_targets(install-flang-headers
513 COMPONENT flang-headers)
515 install(DIRECTORY include/flang
516 DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
517 COMPONENT flang-headers
523 PATTERN "config.h" EXCLUDE
524 PATTERN ".git" EXCLUDE
525 PATTERN "CMakeFiles" EXCLUDE)
527 install(DIRECTORY ${FLANG_INCLUDE_DIR}/flang
528 DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
529 COMPONENT flang-headers
535 # Put ISO_Fortran_binding.h into the include files of the build area now
536 # so that we can run tests before installing
537 include(GetClangResourceDir)
538 get_clang_resource_dir(HEADER_BINARY_DIR PREFIX ${LLVM_LIBRARY_OUTPUT_INTDIR}/.. SUBDIR include)
540 ${FLANG_SOURCE_DIR}/include/flang/ISO_Fortran_binding.h
541 ${HEADER_BINARY_DIR}/ISO_Fortran_binding.h)
543 # And also install it into the install area
544 get_clang_resource_dir(HEADER_INSTALL_DIR SUBDIR include)
546 FILES include/flang/ISO_Fortran_binding.h
547 DESTINATION ${HEADER_INSTALL_DIR} )