From d55952f338d7a93c17dd7bb84148551fae33a078 Mon Sep 17 00:00:00 2001 From: "Riff, Eric" Date: Mon, 5 Sep 2022 11:32:41 -0300 Subject: [PATCH] Improve source patching --- recipes/mold/all/conanfile.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/recipes/mold/all/conanfile.py b/recipes/mold/all/conanfile.py index aa739f6b32d3d..e8dcfed064aa8 100644 --- a/recipes/mold/all/conanfile.py +++ b/recipes/mold/all/conanfile.py @@ -102,15 +102,14 @@ def build(self): else: # Error out if ZLIB is not found, we want to be predictable files.replace_in_file(self, "source_subfolder/CMakeLists.txt", "find_package(ZLIB QUIET)", "find_package(ZLIB REQUIRED)") - # Since we introduce a conan wrapper, CMAKE_SOURCE_DIR points a dir above. mold_SOURD_DIR is an equivalent to the vanilla behavior + # Since we introduce a conan wrapper, CMAKE_SOURCE_DIR points to a dir above. mold_SOURD_DIR is an equivalent to the intended behavior files.replace_in_file(self, "source_subfolder/CMakeLists.txt", "${CMAKE_SOURCE_DIR}/update-git-hash.py", "${mold_SOURCE_DIR}/update-git-hash.py") - # This is a bug upstream. You can't assing definitions to a target you don't build. + # This is a bug upstream. You can't assing definitions to a target you don't build. It has been addressed on main but not released. files.replace_in_file(self, "source_subfolder/CMakeLists.txt", "target_compile_definitions(mimalloc INTERFACE USE_SYSTEM_MIMALLOC)", "target_compile_definitions(mold PRIVATE USE_SYSTEM_MIMALLOC)") # Use conan's xxhash - files.replace_in_file(self, "source_subfolder/CMakeLists.txt", "target_link_libraries(mold PRIVATE ${CMAKE_DL_LIBS})", "find_package(xxHash REQUIRED)\ntarget_link_libraries(mold PRIVATE ${CMAKE_DL_LIBS} xxHash::xxhash)") + files.replace_in_file(self, "source_subfolder/CMakeLists.txt", "target_link_libraries(mold PRIVATE ${CMAKE_DL_LIBS})", "target_link_libraries(mold PRIVATE ${CMAKE_DL_LIBS})\nfind_package(xxHash REQUIRED)\ntarget_link_libraries(xxHash::xxhash)") files.replace_in_file(self, "source_subfolder/mold.h", '#include "third-party/xxhash/xxhash.h"', '#include "xxhash.h"') - cmake = self._configure_cmake() cmake.build()