From 242918faa45d40d1fe24cf5c508310675f808b23 Mon Sep 17 00:00:00 2001 From: Jan Vorlicek Date: Thu, 2 Mar 2017 00:36:12 +0100 Subject: [PATCH] Fix incremental build on Unix (dotnet/coreclr#9779) This change fixes issue with dactablerva.h being generated even if the libcoreclr.so hasn't changed. Also, the dependency of the daccess.cpp on this header was not honored by the build system and so even if the dactablerva.h was regenerated with a different contents, the daccess.cpp was not rebuilt. Commit migrated from https://github.com/dotnet/coreclr/commit/6af7b26738149d46eaccbce631d670c949527ada --- src/coreclr/src/debug/daccess/CMakeLists.txt | 24 +++++++++++++++++++--- .../src/dlls/mscoree/coreclr/CMakeLists.txt | 8 -------- 2 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/coreclr/src/debug/daccess/CMakeLists.txt b/src/coreclr/src/debug/daccess/CMakeLists.txt index daf2773..c06e946 100644 --- a/src/coreclr/src/debug/daccess/CMakeLists.txt +++ b/src/coreclr/src/debug/daccess/CMakeLists.txt @@ -10,8 +10,8 @@ include_directories(${CLR_DIR}/src/debug/ee) include_directories(${CLR_DIR}/src/gcdump) if(CLR_CMAKE_PLATFORM_UNIX) - include_directories(${GENERATED_INCLUDE_DIR}) - add_compile_options(-fPIC) + include_directories(${GENERATED_INCLUDE_DIR}) + add_compile_options(-fPIC) endif(CLR_CMAKE_PLATFORM_UNIX) set(DACCESS_SOURCES @@ -44,5 +44,23 @@ add_precompiled_header(stdafx.h stdafx.cpp DACCESS_SOURCES) add_library_clr(daccess ${DACCESS_SOURCES}) if(CLR_CMAKE_PLATFORM_UNIX) - add_dependencies(daccess coreclr) + add_custom_command( + OUTPUT ${GENERATED_INCLUDE_DIR}/dactablerva.h + DEPENDS coreclr + VERBATIM + COMMAND sh ${CLR_DIR}/src/pal/tools/gen-dactable-rva.sh $ ${GENERATED_INCLUDE_DIR}/dactablerva.h + COMMENT Generating ${GENERATED_INCLUDE_DIR}/dactablerva.h + ) + + set_source_files_properties( + ${GENERATED_INCLUDE_DIR}/dactablerva.h + PROPERTIES GENERATED TRUE + ) + + add_custom_target( + dactablerva_header + DEPENDS ${GENERATED_INCLUDE_DIR}/dactablerva.h + ) + + add_dependencies(daccess coreclr dactablerva_header) endif(CLR_CMAKE_PLATFORM_UNIX) diff --git a/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt b/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt index afd18d6..95af2a7 100644 --- a/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt +++ b/src/coreclr/src/dlls/mscoree/coreclr/CMakeLists.txt @@ -168,14 +168,6 @@ if(WIN32) COMMAND ${BuildToolsDir}/InjectResource.exe /bin:${CMAKE_CURRENT_BINARY_DIR}/clrDebugResource.bin /dll:$ /name:CLRDEBUGINFO COMMENT Add dactable & debug resources to coreclr ) -else() - add_custom_command( - TARGET coreclr - POST_BUILD - VERBATIM - COMMAND sh ${CLR_DIR}/src/pal/tools/gen-dactable-rva.sh $ ${GENERATED_INCLUDE_DIR}/dactablerva.h - COMMENT Generating ${GENERATED_INCLUDE_DIR}/dactablerva.h - ) endif(WIN32) # add the install targets -- 2.7.4