浏览代码

Merge topic 'lfortran-generate-object-code'

daf6cc89ee LFortran: Remove hard-coded --generate-object-code flag

Acked-by: Kitware Robot <[email protected]>
Merge-request: !10159
Brad King 9 月之前
父节点
当前提交
02b7250712

+ 1 - 1
Modules/Compiler/LFortran-Fortran.cmake

@@ -9,6 +9,6 @@ set(CMAKE_Fortran_LINKER_WRAPPER_FLAG "-Wl,")
 set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_ON "--cpp")
 set(CMAKE_Fortran_COMPILE_OPTIONS_PREPROCESS_OFF "--no-cpp")
 set(CMAKE_Fortran_PREPROCESS_SOURCE "<CMAKE_Fortran_COMPILER> --cpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> > <PREPROCESSED_SOURCE>")
-set(CMAKE_Fortran_COMPILE_OBJECT "<CMAKE_Fortran_COMPILER> --cpp-infer <DEFINES> <INCLUDES> <FLAGS> --generate-object-code -c <SOURCE> -o <OBJECT>")
+set(CMAKE_Fortran_COMPILE_OBJECT "<CMAKE_Fortran_COMPILER> --cpp-infer <DEFINES> <INCLUDES> <FLAGS> -c <SOURCE> -o <OBJECT>")
 set(CMAKE_SHARED_LIBRARY_CREATE_Fortran_FLAGS "--shared")
 set(CMAKE_SHARED_LIBRARY_LINK_Fortran_FLAGS "-Wl,-export-dynamic")

+ 1 - 1
Modules/FortranCInterface/CMakeLists.txt

@@ -101,7 +101,7 @@ target_link_libraries(symbols PUBLIC myfort)
 set_property(TARGET symbols PROPERTY POSITION_INDEPENDENT_CODE 1)
 
 if(CMAKE_Fortran_COMPILER_ID STREQUAL "LFortran")
-  add_compile_options(--implicit-interface)
+  add_compile_options(--implicit-interface --generate-object-code)
 endif()
 
 # Require symbols through Fortran.

+ 4 - 0
Modules/FortranCInterface/Verify/CMakeLists.txt

@@ -4,6 +4,10 @@
 cmake_minimum_required(VERSION ${CMAKE_VERSION})
 project(VerifyFortranC C Fortran)
 
+if(CMAKE_Fortran_COMPILER_ID STREQUAL "LFortran")
+  add_compile_options("$<$<COMPILE_LANGUAGE:Fortran>:--generate-object-code>")
+endif()
+
 option(VERIFY_CXX "Whether to verify C++ and Fortran" OFF)
 if(VERIFY_CXX)
   enable_language(CXX)

+ 1 - 1
Tests/Fortran/CMakeLists.txt

@@ -38,7 +38,7 @@ if(WIN32 AND NOT CYGWIN)
 endif()
 
 if(CMAKE_Fortran_COMPILER_ID STREQUAL "LFortran")
-  add_compile_options("$<$<COMPILE_LANGUAGE:Fortran>:--implicit-interface>")
+  add_compile_options("$<$<COMPILE_LANGUAGE:Fortran>:--implicit-interface;--generate-object-code>")
 endif()
 
 add_library(hello STATIC hello.f)

+ 1 - 1
Tests/FortranOnly/CMakeLists.txt

@@ -8,7 +8,7 @@ if("${CMAKE_Fortran_COMPILER_ID};${CMAKE_Fortran_SIMULATE_ID}" MATCHES "^Intel(L
 endif()
 
 if(CMAKE_Fortran_COMPILER_ID STREQUAL "LFortran")
-  add_compile_options(--implicit-interface)
+  add_compile_options(--implicit-interface --generate-object-code)
 endif()
 
 # create a library with hello and world functions

+ 1 - 1
Tests/Module/CheckIPOSupported-Fortran/CMakeLists.txt

@@ -4,7 +4,7 @@ project(CheckIPOSupported-Fortran LANGUAGES Fortran)
 cmake_policy(SET CMP0069 NEW)
 
 if(CMAKE_Fortran_COMPILER_ID STREQUAL "LFortran")
-  add_compile_options(--implicit-interface)
+  add_compile_options(--implicit-interface --generate-object-code)
 endif()
 
 include(CheckIPOSupported)

+ 1 - 1
Tests/VSGNUFortran/subdir/fortran/CMakeLists.txt

@@ -26,7 +26,7 @@ target_link_libraries(sunq sunquad)
 endfunction()
 
 if(CMAKE_Fortran_COMPILER_ID STREQUAL "LFortran")
-  add_compile_options(--implicit-interface)
+  add_compile_options(--implicit-interface --generate-object-code)
 endif()
 
 # check for the fortran c interface mangling