[PATCH] D84022: [flang] Fix multi-config generator builds.
David Truby via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 27 05:40:06 PDT 2020
DavidTruby updated this revision to Diff 280880.
DavidTruby added a comment.
Removed unnecessary change to flang/test/lit.cfg.py
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D84022/new/
https://reviews.llvm.org/D84022
Files:
flang/CMakeLists.txt
flang/test/lit.site.cfg.py.in
flang/tools/f18/CMakeLists.txt
Index: flang/tools/f18/CMakeLists.txt
===================================================================
--- flang/tools/f18/CMakeLists.txt
+++ flang/tools/f18/CMakeLists.txt
@@ -59,8 +59,14 @@
install(TARGETS f18 DESTINATION bin)
set(FLANG_INTRINSIC_MODULES_DIR ${FLANG_BINARY_DIR}/include/flang)
-configure_file(${CMAKE_CURRENT_SOURCE_DIR}/flang.sh.in ${CMAKE_BINARY_DIR}/tools/flang/bin/flang @ONLY)
-file(COPY ${CMAKE_BINARY_DIR}/tools/flang/bin/flang DESTINATION ${CMAKE_BINARY_DIR}/bin FILE_PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE)
+# This flang shell script will only work in a POSIX shell.
+if (NOT WIN32)
+ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/flang.sh.in ${CMAKE_CURRENT_BINARY_DIR}/tools/flang/bin/flang @ONLY)
+add_custom_command(TARGET f18
+ POST_BUILD
+ COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/tools/flang/bin/flang ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang
+ COMMAND chmod +x ${LLVM_RUNTIME_OUTPUT_INTDIR}/flang)
+endif()
# The flang script to be installed needs a different path to the headers.
set(FLANG_INTRINSIC_MODULES_DIR ${CMAKE_INSTALL_PREFIX}/include/flang)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/flang.sh.in ${FLANG_BINARY_DIR}/bin/flang-install.sh @ONLY)
Index: flang/test/lit.site.cfg.py.in
===================================================================
--- flang/test/lit.site.cfg.py.in
+++ flang/test/lit.site.cfg.py.in
@@ -7,7 +7,7 @@
config.flang_src_dir = "@FLANG_SOURCE_DIR@"
config.flang_tools_dir = "@FLANG_TOOLS_DIR@"
config.flang_intrinsic_modules_dir = "@FLANG_INTRINSIC_MODULES_DIR@"
-config.flang_llvm_tools_dir = "@CMAKE_BINARY_DIR@/bin"
+config.flang_llvm_tools_dir = "@LLVM_TOOLS_DIR@"
config.python_executable = "@PYTHON_EXECUTABLE@"
# Support substitution of the tools_dir with user parameters. This is
Index: flang/CMakeLists.txt
===================================================================
--- flang/CMakeLists.txt
+++ flang/CMakeLists.txt
@@ -180,7 +180,7 @@
${LLVM_INCLUDE_TESTS})
set(FLANG_GTEST_AVAIL 1)
- set(FLANG_BINARY_DIR ${CMAKE_BINARY_DIR}/tools/flang)
+ set(FLANG_BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR})
set(BACKEND_PACKAGE_STRING "${PACKAGE_STRING}")
if (LINK_WITH_FIR)
set(MLIR_MAIN_SRC_DIR ${LLVM_MAIN_SRC_DIR}/../mlir/include ) # --src-root
@@ -194,8 +194,6 @@
if(LINK_WITH_FIR)
# tco tool and FIR lib output directories
- set(LLVM_RUNTIME_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/bin)
- set(LLVM_LIBRARY_OUTPUT_INTDIR ${CMAKE_BINARY_DIR}/lib)
# Always build tco tool
set(LLVM_BUILD_TOOLS ON)
message(STATUS "Linking driver with FIR and LLVM")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84022.280880.patch
Type: text/x-patch
Size: 2610 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200727/5d6447a3/attachment.bin>
More information about the llvm-commits
mailing list