[PATCH] D39298: [CMake] Add custom target to create build directory
Jonas Hahnfeld via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 25 10:30:01 PDT 2017
Hahnfeld created this revision.
Herald added a subscriber: mgorny.
CMake does a poor job in tracking dependencies on files and directories
directly. Create custom target similar to the configuration step.
On my system, this avoids the reconfiguration on each build.
https://reviews.llvm.org/D39298
Files:
cmake/modules/CrossCompile.cmake
Index: cmake/modules/CrossCompile.cmake
===================================================================
--- cmake/modules/CrossCompile.cmake
+++ cmake/modules/CrossCompile.cmake
@@ -16,12 +16,15 @@
COMMAND ${CMAKE_COMMAND} -E make_directory ${LLVM_${target_name}_BUILD}
COMMENT "Creating ${LLVM_${target_name}_BUILD}...")
+ add_custom_target(CREATE_LLVM_${target_name}
+ DEPENDS ${LLVM_${target_name}_BUILD})
+
add_custom_command(OUTPUT ${LLVM_${target_name}_BUILD}/CMakeCache.txt
COMMAND ${CMAKE_COMMAND} -G "${CMAKE_GENERATOR}"
${CROSS_TOOLCHAIN_FLAGS_${target_name}} ${CMAKE_SOURCE_DIR}
-DLLVM_TARGET_IS_CROSSCOMPILE_HOST=TRUE
WORKING_DIRECTORY ${LLVM_${target_name}_BUILD}
- DEPENDS ${LLVM_${target_name}_BUILD}
+ DEPENDS CREATE_LLVM_${target_name}
COMMENT "Configuring ${target_name} LLVM...")
add_custom_target(CONFIGURE_LLVM_${target_name}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D39298.120281.patch
Type: text/x-patch
Size: 930 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171025/9ea93348/attachment.bin>
More information about the llvm-commits
mailing list