From 9a71f2931b0aa21a0eb0cb44524a036ea5d8efcf Mon Sep 17 00:00:00 2001 From: Bruce Forstall Date: Thu, 2 Mar 2017 10:23:21 -0800 Subject: [PATCH] Fix AsmConstants.inc to be incrementally rebuilt as necessary Previously, it was rebuilt on every build. Commit migrated from https://github.com/dotnet/coreclr/commit/a85b5038af55cdeda8375bdc7e6d0d65396e34bb --- src/coreclr/src/vm/wks/CMakeLists.txt | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/coreclr/src/vm/wks/CMakeLists.txt b/src/coreclr/src/vm/wks/CMakeLists.txt index 360845d..1da2ab8 100644 --- a/src/coreclr/src/vm/wks/CMakeLists.txt +++ b/src/coreclr/src/vm/wks/CMakeLists.txt @@ -105,11 +105,21 @@ if (WIN32) endif() add_custom_command( - # The AsmConstants.inc will be built in the pre-build phase of the cee_wks build - TARGET cee_wks PRE_BUILD + OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/AsmConstants.inc" + DEPENDS ${VM_DIR}/${ARCH_SOURCES_DIR}/asmconstants.h COMMAND ${POWERSHELL} -NoProfile -ExecutionPolicy Bypass -NonInteractive \"& \"\"${VM_DIR}/h2inc.ps1\"\"\" \"\"\"${VM_DIR}/${ARCH_SOURCES_DIR}/asmconstants.h\"\"\" >"${CMAKE_CURRENT_BINARY_DIR}/AsmConstants.tmp" COMMAND ${CMAKE_CXX_COMPILER} ${DEFINITIONS} /EP "${CMAKE_CURRENT_BINARY_DIR}/AsmConstants.tmp" >"${CMAKE_CURRENT_BINARY_DIR}/AsmConstants.inc" ) + + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/AsmConstants.inc PROPERTIES GENERATED TRUE) + + add_custom_target( + asmconstants_inc + DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/AsmConstants.inc + ) + + add_dependencies(cee_wks asmconstants_inc) + endif(NOT CLR_CMAKE_PLATFORM_ARCH_ARM) endif (WIN32) -- 2.7.4