summaryrefslogtreecommitdiffstats
path: root/llvm/cmake/modules
diff options
context:
space:
mode:
authorserge-sans-paille <sguelton@redhat.com>2020-04-20 14:43:21 +0200
committerTom Stellard <tstellar@redhat.com>2020-06-17 16:57:30 -0700
commit0c05269e0232d5eebfd835aa1401913b181031a3 (patch)
tree45b660697af4646530ad63162ea6420c3df3dd5d /llvm/cmake/modules
parent4b932da77db7405f075fa2519edef6efd41b047c (diff)
downloadbcm5719-llvm-0c05269e0232d5eebfd835aa1401913b181031a3.tar.gz
bcm5719-llvm-0c05269e0232d5eebfd835aa1401913b181031a3.zip
[nfc] Cleanup extension header generation
(cherry picked from commit f44a508df629ecc97e0b1345726b12f25927409e)
Diffstat (limited to 'llvm/cmake/modules')
-rw-r--r--llvm/cmake/modules/AddLLVM.cmake13
1 files changed, 7 insertions, 6 deletions
diff --git a/llvm/cmake/modules/AddLLVM.cmake b/llvm/cmake/modules/AddLLVM.cmake
index 8fbb33a22fd..a8b3628fd31 100644
--- a/llvm/cmake/modules/AddLLVM.cmake
+++ b/llvm/cmake/modules/AddLLVM.cmake
@@ -937,17 +937,18 @@ function(process_llvm_pass_plugins)
DESTINATION ${LLVM_INSTALL_PACKAGE_DIR}
COMPONENT cmake-exports)
- file(WRITE "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def.tmp" "//extension handlers\n")
+ set(ExtensionDef "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def")
+ file(WRITE "${ExtensionDef}.tmp" "//extension handlers\n")
foreach(llvm_extension ${LLVM_STATIC_EXTENSIONS})
- file(APPEND "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def.tmp" "HANDLE_EXTENSION(${llvm_extension})\n")
+ file(APPEND "${ExtensionDef}.tmp" "HANDLE_EXTENSION(${llvm_extension})\n")
endforeach()
- file(APPEND "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def.tmp" "#undef HANDLE_EXTENSION\n")
+ file(APPEND "${ExtensionDef}.tmp" "#undef HANDLE_EXTENSION\n")
# only replace if there's an actual change
execute_process(COMMAND ${CMAKE_COMMAND} -E copy_if_different
- "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def.tmp"
- "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def")
- file(REMOVE "${LLVM_BINARY_DIR}/include/llvm/Support/Extension.def.tmp")
+ "${ExtensionDef}.tmp"
+ "${ExtensionDef}")
+ file(REMOVE "${ExtensionDef}.tmp")
endif()
endfunction()
OpenPOWER on IntegriCloud