From 78cbebd0165c31fd4ca8cc4fd95e95983804d248 Mon Sep 17 00:00:00 2001 From: Isuru Fernando Date: Sun, 22 Oct 2017 18:30:24 -0500 Subject: [PATCH] Fix CMake --- CMakeLists.txt | 4 +++- runtime/flang/CMakeLists.txt | 9 ++++----- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 0e298e403e3..693755d31c0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 - " -Mpreprocess -E -o ") + " -cpp -E -o ") # If we are not building as a part of LLVM, build Flang as an # standalone project, using LLVM as an external library: diff --git a/runtime/flang/CMakeLists.txt b/runtime/flang/CMakeLists.txt index dc29e565e68..446e1129fcc 100644 --- a/runtime/flang/CMakeLists.txt +++ b/runtime/flang/CMakeLists.txt @@ -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 @@ -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 @@ -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 $<$:-Mreentrant>)