Skip to content

Commit

Permalink
Fix CMake
Browse files Browse the repository at this point in the history
  • Loading branch information
isuruf authored and xoviat committed Dec 23, 2017
1 parent d061cad commit 78cbebd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ cmake_minimum_required(VERSION 2.8)
# In order to bootstrap the runtime library we need to skip
# CMake's Fortran tests
SET(CMAKE_Fortran_COMPILER_WORKS 1)


set(CMAKE_Fortran_PREPROCESS_SOURCE
"<CMAKE_Fortran_COMPILER> -Mpreprocess <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> -o <PREPROCESSED_SOURCE>")
"<CMAKE_Fortran_COMPILER> -cpp <DEFINES> <INCLUDES> <FLAGS> -E <SOURCE> -o <PREPROCESSED_SOURCE>")

# If we are not building as a part of LLVM, build Flang as an
# standalone project, using LLVM as an external library:
Expand Down
9 changes: 4 additions & 5 deletions runtime/flang/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,6 @@ set_property(
## CMake does not handle module dependencies between Fortran files,
## we need to help it

if (NOT MSVC)
# State the module that the source is producing
set_source_files_properties(
iso_c_bind.F95
Expand All @@ -546,7 +545,6 @@ set_source_files_properties(
PROPERTIES
OBJECT_DEPENDS ${CMAKE_Fortran_MODULE_DIRECTORY}/iso_c_binding.mod
)
endif()

set_target_properties(flang_static flang_shared
PROPERTIES
Expand Down Expand Up @@ -577,9 +575,10 @@ add_dependencies(flang_shared
flang2
)

target_compile_options(flang_static PRIVATE -fPIC)

target_compile_options(flang_shared PRIVATE -fPIC)
if (NOT MSVC)
target_compile_options(flang_static PRIVATE -fPIC)
target_compile_options(flang_shared PRIVATE -fPIC)
endif()

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

Expand Down

0 comments on commit 78cbebd

Please sign in to comment.