Skip to content

Commit

Permalink
Set the target linker language for the flang libraries to CXX on wind…
Browse files Browse the repository at this point in the history
…ows.

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.
  • Loading branch information
Albert Ziegenhagel committed Oct 25, 2017
1 parent 451499f commit 970f43b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions runtime/flang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,9 @@ add_dependencies(flang_shared
if (NOT MSVC)
target_compile_options(flang_static PRIVATE -fPIC)
target_compile_options(flang_shared PRIVATE -fPIC)
else()
set_target_properties(flang_static PROPERTIES LINKER_LANGUAGE CXX)
set_target_properties(flang_shared PROPERTIES LINKER_LANGUAGE CXX)
endif()

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

0 comments on commit 970f43b

Please sign in to comment.