Skip to content

Commit 78cbebd

Browse files
isurufxoviat
authored andcommitted
Fix CMake
1 parent d061cad commit 78cbebd

File tree

2 files changed

+7
-6
lines changed

2 files changed

+7
-6
lines changed

CMakeLists.txt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ cmake_minimum_required(VERSION 2.8)
2121
# In order to bootstrap the runtime library we need to skip
2222
# CMake's Fortran tests
2323
SET(CMAKE_Fortran_COMPILER_WORKS 1)
24+
25+
2426
set(CMAKE_Fortran_PREPROCESS_SOURCE
25-
"<CMAKE_Fortran_COMPILER> -Mpreprocess <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> -o <PREPROCESSED_SOURCE>")
27+
"<CMAKE_Fortran_COMPILER> -cpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> -o <PREPROCESSED_SOURCE>")
2628

2729
# If we are not building as a part of LLVM, build Flang as an
2830
# standalone project, using LLVM as an external library:

runtime/flang/CMakeLists.txt

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -531,7 +531,6 @@ set_property(
531531
## CMake does not handle module dependencies between Fortran files,
532532
## we need to help it
533533

534-
if (NOT MSVC)
535534
# State the module that the source is producing
536535
set_source_files_properties(
537536
iso_c_bind.F95
@@ -546,7 +545,6 @@ set_source_files_properties(
546545
PROPERTIES
547546
OBJECT_DEPENDS ${CMAKE_Fortran_MODULE_DIRECTORY}/iso_c_binding.mod
548547
)
549-
endif()
550548

551549
set_target_properties(flang_static flang_shared
552550
PROPERTIES
@@ -577,9 +575,10 @@ add_dependencies(flang_shared
577575
flang2
578576
)
579577

580-
target_compile_options(flang_static PRIVATE -fPIC)
581-
582-
target_compile_options(flang_shared PRIVATE -fPIC)
578+
if (NOT MSVC)
579+
target_compile_options(flang_static PRIVATE -fPIC)
580+
target_compile_options(flang_shared PRIVATE -fPIC)
581+
endif()
583582

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

0 commit comments

Comments
 (0)