Skip to content

Commit 301af7f

Browse files
committed
Don't trust CMAKE_INSTALL_LIBDIR
Not used by compiler-rt either
1 parent a6b7618 commit 301af7f

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

flang-rt/CMakeLists.txt

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,6 @@ include(GetToolchainDirs)
6868
include(FlangCommon)
6969
include(HandleCompilerRT)
7070
include(ExtendPath)
71-
include(GNUInstallDirs)
7271

7372

7473
############################
@@ -110,9 +109,9 @@ else ()
110109
# be installed there using the same prefix. This is to not have a difference
111110
# between bootstrap and standalone runtimes builds.
112111
set(FLANG_RT_OUTPUT_RESOURCE_DIR "${CMAKE_CURRENT_BINARY_DIR}")
113-
set(FLANG_RT_INSTALL_RESOURCE_PATH "${CMAKE_INSTALL_LIBDIR}/clang/${LLVM_VERSION_MAJOR}")
112+
set(FLANG_RT_INSTALL_RESOURCE_PATH "lib/clang/${LLVM_VERSION_MAJOR}")
114113

115-
extend_path(FLANG_RT_OUTPUT_RESOURCE_LIB_DIR "${FLANG_RT_OUTPUT_RESOURCE_DIR}" "${CMAKE_INSTALL_LIBDIR}")
114+
extend_path(FLANG_RT_OUTPUT_RESOURCE_LIB_DIR "${FLANG_RT_OUTPUT_RESOURCE_DIR}" "lib")
116115
endif ()
117116
extend_path(FLANG_RT_INSTALL_RESOURCE_LIB_PATH "${FLANG_RT_INSTALL_RESOURCE_PATH}" "${toolchain_lib_subdir}")
118117
cmake_path(NORMAL_PATH FLANG_RT_OUTPUT_RESOURCE_DIR)

flang-rt/cmake/modules/GetToolchainDirs.cmake

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,6 @@
66
#
77
#===------------------------------------------------------------------------===#
88

9-
include(GNUInstallDirs)
10-
119

1210
# Determine the subdirectory relative to Clang's resource dir/sysroot where to
1311
# install target-specific libraries, to be found by Clang/Flang driver. This was
@@ -35,15 +33,15 @@ include(GNUInstallDirs)
3533
# ToolChain::getArchSpecificLibPaths(...).
3634
function (get_toolchain_library_subdir outvar)
3735
if (NOT APPLE)
38-
set(outval "${CMAKE_INSTALL_LIBDIR}")
36+
set(outval "lib")
3937
else ()
4038
# Required to be "darwin" for MachO toolchain.
4139
get_toolchain_os_dirname(os_dirname)
42-
set(outval "${CMAKE_INSTALL_LIBDIR}/${os_dirname}")
40+
set(outval "lib/${os_dirname}")
4341
endif ()
4442

4543
get_toolchain_arch_dirname(arch_dirname)
46-
set(outval "${CMAKE_INSTALL_LIBDIR}/${arch_dirname}")
44+
set(outval "lib/${arch_dirname}")
4745

4846
set(${outvar} "${outval}" PARENT_SCOPE)
4947
endfunction ()

0 commit comments

Comments
 (0)