Skip to content

Commit 970f43b

Browse files
author
Albert Ziegenhagel
committed
Set the target linker language for the flang libraries to CXX on windows.
This makes sure link.exe from Visual Studio is used to link the libraries, even though the libraries include fortran code. CMake is not able to detect this since the flang fortran compiler is not working at CMake configure time and thus the CMAKE_Fortran_COMPILER_ID is unknown.
1 parent 451499f commit 970f43b

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

runtime/flang/CMakeLists.txt

+3
Original file line numberDiff line numberDiff line change
@@ -579,6 +579,9 @@ add_dependencies(flang_shared
579579
if (NOT MSVC)
580580
target_compile_options(flang_static PRIVATE -fPIC)
581581
target_compile_options(flang_shared PRIVATE -fPIC)
582+
else()
583+
set_target_properties(flang_static PROPERTIES LINKER_LANGUAGE CXX)
584+
set_target_properties(flang_shared PROPERTIES LINKER_LANGUAGE CXX)
582585
endif()
583586

584587
target_compile_options(flang_static PUBLIC $<$<COMPILE_LANGUAGE:Fortran>:-Mreentrant>)

0 commit comments

Comments
 (0)