[llvm] r317694 - [CMake] Add custom target to create build directory
Jonas Hahnfeld via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 8 06:31:51 PST 2017
Author: hahnfeld
Date: Wed Nov 8 06:31:51 2017
New Revision: 317694
URL: http://llvm.org/viewvc/llvm-project?rev=317694&view=rev
Log:
[CMake] Add custom target to create build directory
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.
Differential Revision: https://reviews.llvm.org/D39298
Modified:
llvm/trunk/cmake/modules/CrossCompile.cmake
Modified: llvm/trunk/cmake/modules/CrossCompile.cmake
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/cmake/modules/CrossCompile.cmake?rev=317694&r1=317693&r2=317694&view=diff
==============================================================================
--- llvm/trunk/cmake/modules/CrossCompile.cmake (original)
+++ llvm/trunk/cmake/modules/CrossCompile.cmake Wed Nov 8 06:31:51 2017
@@ -16,12 +16,15 @@ function(llvm_create_cross_target_intern
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}
More information about the llvm-commits
mailing list