[flang] Do not create .f18.mod files for each compiled module (#85249)
The default CMake scripts had a copy operation to copy a compiled `.mod` file to also be available with suffix `.f18.mod`. This seems no longer needed. Also updated ModFiles.md to point to `-module-suffix`. --------- Co-authored-by: Kiran Chandramohan <kiranchandramohan@gmail.com>
This commit is contained in:
parent
053750c3b4
commit
a1cd5e6954
@ -27,7 +27,9 @@ often use `rm *.mod` to clean up.
|
||||
The disadvantage of using the same name as other compilers is that it is not
|
||||
clear which compiler created a `.mod` file and files from multiple compilers
|
||||
cannot be in the same directory. This could be solved by adding something
|
||||
between the module name and extension, e.g. `<modulename>-f18.mod`.
|
||||
between the module name and extension, e.g. `<modulename>-f18.mod`. If this
|
||||
is needed, Flang's fc1 accepts the option `-module-suffix` to alter the suffix
|
||||
used for the module file.
|
||||
|
||||
## Format
|
||||
|
||||
|
@ -62,11 +62,8 @@ if (NOT CMAKE_CROSSCOMPILING)
|
||||
${FLANG_SOURCE_DIR}/module/${filename}.f90
|
||||
DEPENDS flang-new ${FLANG_SOURCE_DIR}/module/${filename}.f90 ${FLANG_SOURCE_DIR}/module/__fortran_builtins.f90 ${depends}
|
||||
)
|
||||
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 "${CMAKE_INSTALL_INCLUDEDIR}/flang")
|
||||
list(APPEND MODULE_FILES ${base}.mod)
|
||||
install(FILES ${base}.mod DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/flang")
|
||||
endforeach()
|
||||
|
||||
# Special case for omp_lib.mod, because its source comes from openmp/runtime/src/include.
|
||||
|
Loading…
x
Reference in New Issue
Block a user