From 0d86812c73edbebc5f3aa9923a32062ca97188c5 Mon Sep 17 00:00:00 2001 From: wangrong Date: Thu, 23 Oct 2025 10:55:49 +0800 Subject: [PATCH] fix: Fix non-reproducible builds Skip build rpath when the build type is set to "Release" to ensure reproducible builds. --- CMakeLists.txt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index 80404af..7184e0f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -48,6 +48,11 @@ endif() #set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS_MINSIZEREL} -g -fsanitize=address -O2") #set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -g -fsanitize=address -O2") +# Skip build rpath for reproducible release build +if(CMAKE_BUILD_TYPE STREQUAL "Release") + set(CMAKE_SKIP_BUILD_RPATH TRUE) +endif() + ADD_SUBDIRECTORY(basestruct) ADD_SUBDIRECTORY(log) ADD_SUBDIRECTORY(application)