2020-05-05 05:49:53 +08:00
|
|
|
set(LLVM_LINK_COMPONENTS
|
[flang][openacc] OpenACC 3.0 parser
Summary:
This patch introduce the parser for OpenACC 3.0 in Flang. It uses the same TableGen mechanism
than OpenMP.
Reviewers: nvdatian, sscalpone, tskeith, klausler, ichoyjx, jdoerfert, DavidTruby
Reviewed By: klausler
Subscribers: MaskRay, SouraVX, mgorny, hiraditya, jfb, sstefan1, llvm-commits
Tags: #llvm, #flang
Differential Revision: https://reviews.llvm.org/D83649
2020-07-15 02:28:34 +08:00
|
|
|
FrontendOpenACC
|
2020-07-10 02:08:41 +08:00
|
|
|
FrontendOpenMP
|
2020-05-05 05:49:53 +08:00
|
|
|
Support
|
|
|
|
)
|
2019-03-14 07:05:05 +08:00
|
|
|
|
2019-06-26 00:57:38 +08:00
|
|
|
set(MODULES
|
2020-12-08 06:46:24 +08:00
|
|
|
"__fortran_builtins"
|
|
|
|
"__fortran_type_info"
|
2019-06-26 00:57:38 +08:00
|
|
|
"ieee_arithmetic"
|
|
|
|
"ieee_exceptions"
|
|
|
|
"ieee_features"
|
|
|
|
"iso_c_binding"
|
|
|
|
"iso_fortran_env"
|
2019-08-27 00:57:06 +08:00
|
|
|
"omp_lib"
|
2020-01-01 06:08:12 +08:00
|
|
|
"__fortran_builtins"
|
2020-12-08 06:46:24 +08:00
|
|
|
"__fortran_type_info"
|
2019-06-26 00:57:38 +08:00
|
|
|
)
|
|
|
|
|
|
|
|
# Create module files directly from the top-level module source directory
|
|
|
|
foreach(filename ${MODULES})
|
2021-03-15 23:02:58 +08:00
|
|
|
set(base ${FLANG_INTRINSIC_MODULES_DIR}/${filename})
|
2020-12-08 06:46:24 +08:00
|
|
|
if(${filename} MATCHES "__fortran_type_info")
|
2020-01-01 06:08:12 +08:00
|
|
|
set(depends "")
|
2020-12-08 06:46:24 +08:00
|
|
|
elseif(${filename} MATCHES "__fortran_builtins")
|
2021-03-15 23:02:58 +08:00
|
|
|
set(depends ${FLANG_INTRINSIC_MODULES_DIR}/__fortran_type_info.mod)
|
2020-01-01 06:08:12 +08:00
|
|
|
else()
|
2021-03-15 23:02:58 +08:00
|
|
|
set(depends ${FLANG_INTRINSIC_MODULES_DIR}/__fortran_builtins.mod)
|
2020-01-01 06:08:12 +08:00
|
|
|
endif()
|
2021-03-15 23:02:58 +08:00
|
|
|
add_custom_command(OUTPUT ${base}.mod
|
2021-03-16 06:17:35 +08:00
|
|
|
COMMAND ${CMAKE_COMMAND} -E make_directory ${FLANG_INTRINSIC_MODULES_DIR}
|
2021-07-12 16:44:38 +08:00
|
|
|
COMMAND flang-new -fc1 -fsyntax-only -module-dir ${FLANG_INTRINSIC_MODULES_DIR}
|
2021-03-16 06:36:12 +08:00
|
|
|
${FLANG_SOURCE_DIR}/module/${filename}.f90
|
2021-07-12 16:44:38 +08:00
|
|
|
DEPENDS flang-new ${FLANG_SOURCE_DIR}/module/${filename}.f90 ${depends}
|
2019-08-13 12:40:03 +08:00
|
|
|
)
|
2021-03-15 23:02:58 +08:00
|
|
|
add_custom_command(OUTPUT ${base}.f18.mod
|
|
|
|
DEPENDS ${base}.mod
|
|
|
|
COMMAND ${CMAKE_COMMAND} -E copy ${base}.mod ${base}.f18.mod)
|
|
|
|
list(APPEND MODULE_FILES ${base}.mod ${base}.f18.mod)
|
|
|
|
install(FILES ${base}.mod ${base}.f18.mod DESTINATION include/flang)
|
2019-06-26 00:57:38 +08:00
|
|
|
endforeach()
|
|
|
|
|
|
|
|
add_custom_target(module_files ALL DEPENDS ${MODULE_FILES})
|
|
|
|
|
2020-08-02 03:53:27 +08:00
|
|
|
# This flang shell script will only work in a POSIX shell.
|
|
|
|
if (NOT WIN32)
|
2021-07-12 16:44:38 +08:00
|
|
|
file(COPY ${CMAKE_CURRENT_SOURCE_DIR}/flang
|
|
|
|
DESTINATION ${CMAKE_BINARY_DIR}/bin
|
|
|
|
FILE_PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE)
|
2020-12-18 11:08:15 +08:00
|
|
|
install(PROGRAMS ${CMAKE_BINARY_DIR}/bin/flang DESTINATION bin)
|
2020-08-02 03:53:27 +08:00
|
|
|
endif()
|