[flang] Enable building f18 as shared libraries

Original-commit: flang-compiler/f18@4544d75af1
Reviewed-on: https://github.com/flang-compiler/f18/pull/265
Tree-same-pre-rewrite: false
This commit is contained in:
peter klausler 2019-01-19 14:38:31 -08:00
parent e7b93436c3
commit db5b3fbd89

View File

@ -18,8 +18,8 @@ cmake_minimum_required(VERSION 3.9.0)
if( GCC )
set(CMAKE_CXX_COMPILER "${GCC}/bin/g++")
set(CMAKE_CC_COMPILER "${GCC}/bin/gcc")
set(CMAKE_BUILD_RPATH "${GCC}/lib64")
set(CMAKE_INSTALL_RPATH "${GCC}/lib64")
set(CMAKE_BUILD_WITH_INSTALL_RPATH true)
endif()
if(BUILD_WITH_CLANG)
set(CMAKE_CXX_COMPILER "${BUILD_WITH_CLANG}/bin/clang")
@ -29,6 +29,15 @@ if(BUILD_WITH_CLANG)
endif()
endif()
# Set RPATH in every executable (overriding default setting)
# If you set this first variable back to true (the default),
# also set the second one.
set(CMAKE_SKIP_BUILD_RPATH false)
set(CMAKE_BUILD_WITH_INSTALL_RPATH false)
# Don't use the installation RPATH when building
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH true)
# Reminder: Setting CMAKE_CXX_COMPILER must be done before calling project()
project(f18 CXX)