@@ -76,66 +76,8 @@ include(ExtendPath)
76
76
# Path to LLVM development tools (FileCheck, llvm-lit, not, ...)
77
77
set (LLVM_TOOLS_DIR "${LLVM_BINARY_DIR} /bin" )
78
78
79
-
80
79
flang_module_fortran_enable ()
81
80
82
- # Determine build and install paths.
83
- # The build path is absolute, but the install dir is relative, CMake's install
84
- # command has to apply CMAKE_INSTALL_PREFIX itself.
85
- get_toolchain_library_subdir (toolchain_lib_subdir )
86
- get_toolchain_module_subdir (toolchain_mod_subdir )
87
-
88
- if (LLVM_TREE_AVAILABLE )
89
- # In a bootstrap build emit the libraries into a default search path in the
90
- # build directory of the just-built compiler. This allows using the
91
- # just-built compiler without specifying paths to runtime libraries.
92
- #
93
- # Despite Clang in the name, get_clang_resource_dir does not depend on Clang
94
- # being added to the build. Flang uses the same resource dir as clang.
95
- include (GetClangResourceDir )
96
- get_clang_resource_dir (FLANG_RT_OUTPUT_RESOURCE_DIR PREFIX "${LLVM_LIBRARY_OUTPUT_INTDIR} /.." )
97
- get_clang_resource_dir (FLANG_RT_INSTALL_RESOURCE_PATH_DEFAULT )
98
-
99
- extend_path (FLANG_RT_OUTPUT_RESOURCE_LIB_DIR "${FLANG_RT_OUTPUT_RESOURCE_DIR} " "${toolchain_lib_subdir} " )
100
- extend_path (FLANG_RT_OUTPUT_RESOURCE_MOD_DIR "${FLANG_RT_OUTPUT_RESOURCE_DIR} " "${toolchain_mod_subdir} " )
101
- else ()
102
- # In a standalone runtimes build, do not write into LLVM_BINARY_DIR. It may be
103
- # read-only and/or shared by multiple runtimes with different build
104
- # configurations (e.g. Debug/Release). Use the runtime's own lib dir like any
105
- # non-toolchain library.
106
- # For the install prefix, still use the resource dir assuming that Flang will
107
- # be installed there using the same prefix. This is to not have a difference
108
- # between bootstrap and standalone runtimes builds.
109
- set (FLANG_RT_OUTPUT_RESOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR} " )
110
- set (FLANG_RT_INSTALL_RESOURCE_PATH_DEFAULT "lib${LLVM_LIBDIR_SUFFIX} /clang/${LLVM_VERSION_MAJOR} " )
111
-
112
- extend_path (FLANG_RT_OUTPUT_RESOURCE_LIB_DIR "${FLANG_RT_OUTPUT_RESOURCE_DIR} " "lib${LLVM_LIBDIR_SUFFIX} " )
113
- extend_path (FLANG_RT_OUTPUT_RESOURCE_MOD_DIR "${FLANG_RT_OUTPUT_RESOURCE_DIR} " "finclude" )
114
- endif ()
115
- set (FLANG_RT_INSTALL_RESOURCE_PATH "${FLANG_RT_INSTALL_RESOURCE_PATH_DEFAULT} "
116
- CACHE PATH "Path to install runtime libraries to (default: clang resource dir)" )
117
- extend_path (FLANG_RT_INSTALL_RESOURCE_LIB_PATH "${FLANG_RT_INSTALL_RESOURCE_PATH} " "${toolchain_lib_subdir} " )
118
- #extend_path(FLANG_RT_INSTALL_RESOURCE_MOD_PATH "${FLANG_RT_INSTALL_RESOURCE_PATH}" "${toolchain_mod_subdir}")
119
- cmake_path (NORMAL_PATH FLANG_RT_OUTPUT_RESOURCE_DIR )
120
- cmake_path (NORMAL_PATH FLANG_RT_INSTALL_RESOURCE_PATH )
121
- # FIXME: For the libflang_rt.so, the toolchain resource lib dir is not a good
122
- # destination because it is not a ld.so default search path.
123
- # The machine where the executable is eventually executed may not be the
124
- # machine where the Flang compiler and its resource dir is installed, so
125
- # setting RPath by the driver is not an solution. It should belong into
126
- # /usr/lib/<triple>/libflang_rt.so, like e.g. libgcc_s.so.
127
- # But the linker as invoked by the Flang driver also requires
128
- # libflang_rt.so to be found when linking and the resource lib dir is
129
- # the only reliable location.
130
- cmake_path (NORMAL_PATH FLANG_RT_OUTPUT_RESOURCE_LIB_DIR )
131
- cmake_path (NORMAL_PATH FLANG_RT_INSTALL_RESOURCE_LIB_PATH )
132
- cmake_path (NORMAL_PATH FLANG_RT_OUTPUT_RESOURCE_MOD_DIR )
133
- #cmake_path(NORMAL_PATH FLANG_RT_INSTALL_RESOURCE_MOD_PATH)
134
-
135
- message ("toolchain_mod_subdir: ${toolchain_mod_subdir} " )
136
- message ("FLANG_RT_OUTPUT_RESOURCE_MOD_DIR: ${FLANG_RT_OUTPUT_RESOURCE_MOD_DIR} " )
137
- #message("FLANG_RT_INSTALL_RESOURCE_MOD_PATH: ${FLANG_RT_INSTALL_RESOURCE_MOD_PATH}")
138
-
139
81
140
82
#################
141
83
# Build Options #
0 commit comments