diff --git a/flang/docs/ModFiles.md b/flang/docs/ModFiles.md index e55d72fa3a705..7463454c8563a 100644 --- a/flang/docs/ModFiles.md +++ b/flang/docs/ModFiles.md @@ -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. `-f18.mod`. +between the module name and extension, e.g. `-f18.mod`. If this +is needed, Flang's fc1 accepts the option `-module-suffix` to alter the suffix +used for the module file. ## Format diff --git a/flang/tools/f18/CMakeLists.txt b/flang/tools/f18/CMakeLists.txt index e266055a4bf01..dda3b6887be89 100644 --- a/flang/tools/f18/CMakeLists.txt +++ b/flang/tools/f18/CMakeLists.txt @@ -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.