From af61cbaa215c5593cfc941c7769bde355057fafe Mon Sep 17 00:00:00 2001 From: battlmonstr Date: Mon, 4 Nov 2024 11:56:16 +0100 Subject: [PATCH] cmake: hardcode git info for faster incremental Debug builds Problem: A git commit sha or a branch name change causes relinking of executable targets with silkworm-buildinfo library even if nothing else has changed. During development (e.g. local Debug builds) it is more important to have fast incremental builds than having the correct git commit sha and a branch name baked into the binary. Solution: Add git info arguments to cable_add_buildinfo_library. Hardcode them in Debug builds to avoid relinking and save time when doing small changes and git rebase/squash/reword operations. --- CMakeLists.txt | 14 +++++++++++++- third_party/evmone/evmone | 2 +- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 923b42c6aa..54b17b905c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,7 +45,19 @@ set(PROJECT_VERSION_MAJOR ${CMAKE_MATCH_1}) set(PROJECT_VERSION_MINOR ${CMAKE_MATCH_2}) set(PROJECT_VERSION_PATCH ${CMAKE_MATCH_3}) -cable_add_buildinfo_library(PROJECT_NAME ${PROJECT_NAME}) +if(CMAKE_BUILD_TYPE STREQUAL "Debug") + set(CABLE_GIT_DESCRIBE "c0deadded1111111111111111111111111111111") + set(CABLE_GIT_BRANCH "dev") +endif() + +cable_add_buildinfo_library( + PROJECT_NAME + "${PROJECT_NAME}" + GIT_DESCRIBE + "${CABLE_GIT_DESCRIBE}" + GIT_BRANCH + "${CABLE_GIT_BRANCH}" +) option(SILKWORM_WASM_API "Build WebAssembly API" OFF) option(SILKWORM_CORE_ONLY "Only build Silkworm Core" OFF) diff --git a/third_party/evmone/evmone b/third_party/evmone/evmone index de082396f1..314a4bc007 160000 --- a/third_party/evmone/evmone +++ b/third_party/evmone/evmone @@ -1 +1 @@ -Subproject commit de082396f15759431e9ea6ca4fc10a37c0ac2213 +Subproject commit 314a4bc00731f98ecb64c41fe2fc5f2ab84d9537