[DO-967] update for windows cross-build (!2)

Co-authored-by: aleksandr.vodyanov <aleksandr.vodyanov@avroid.tech>
Reviewed-on: https://git.avroid.tech/Conan/conan_build/pulls/2
This commit is contained in:
Aleksandr Vodyanov
2024-11-21 14:59:17 +03:00
parent 2d78d3be7c
commit bb6197bed7
3 changed files with 18 additions and 17 deletions

View File

@@ -25,42 +25,42 @@ patches:
- patch_file: "patches/0003-absl-string-libm-20240116.patch"
patch_description: "link libm to absl string"
patch_type: "portability"
patch_source: "https://git.avroid.tech/Mirrors/abseil-cpp/issues/1100"
patch_source: "https://github.com/abseil/abseil-cpp/issues/1100"
"20240116.2":
- patch_file: "patches/0003-absl-string-libm-20240116.patch"
patch_description: "link libm to absl string"
patch_type: "portability"
patch_source: "https://git.avroid.tech/Mirrors/abseil-cpp/issues/1100"
patch_source: "https://github.com/abseil/abseil-cpp/issues/1100"
- patch_file: "patches/20240116.1-0001-fix-filesystem-include.patch"
patch_description: "Fix GCC 7 including <filesystem> in C++17 mode when it is not available (until GCC 8)"
patch_type: "portability"
patch_source: "https://git.avroid.tech/Mirrors/abseil-cpp/commit/bb83aceacb554e79e7cd2404856f0be30bd00303"
patch_source: "https://github.com/abseil/abseil-cpp/commit/bb83aceacb554e79e7cd2404856f0be30bd00303"
- patch_file: "patches/0004-test-allocator-testonly.patch"
patch_description: "Do not build test_allocator target when tests are disabled"
patch_type: "portability"
patch_source: "https://git.avroid.tech/Mirrors/abseil-cpp/commit/779a3565ac6c5b69dd1ab9183e500a27633117d5"
patch_source: "https://github.com/abseil/abseil-cpp/commit/779a3565ac6c5b69dd1ab9183e500a27633117d5"
"20240116.1":
- patch_file: "patches/0003-absl-string-libm-20240116.patch"
patch_description: "link libm to absl string"
patch_type: "portability"
patch_source: "https://git.avroid.tech/Mirrors/abseil-cpp/issues/1100"
patch_source: "https://github.com/abseil/abseil-cpp/issues/1100"
- patch_file: "patches/20240116.1-0001-fix-filesystem-include.patch"
patch_description: "Fix GCC 7 including <filesystem> in C++17 mode when it is not available (until GCC 8)"
patch_type: "portability"
patch_source: "https://git.avroid.tech/Mirrors/abseil-cpp/commit/bb83aceacb554e79e7cd2404856f0be30bd00303"
patch_source: "https://github.com/abseil/abseil-cpp/commit/bb83aceacb554e79e7cd2404856f0be30bd00303"
- patch_file: "patches/0004-test-allocator-testonly.patch"
patch_description: "Do not build test_allocator target when tests are disabled"
patch_type: "portability"
patch_source: "https://git.avroid.tech/Mirrors/abseil-cpp/commit/779a3565ac6c5b69dd1ab9183e500a27633117d5"
patch_source: "https://github.com/abseil/abseil-cpp/commit/779a3565ac6c5b69dd1ab9183e500a27633117d5"
"20230802.1":
- patch_file: "patches/0003-absl-string-libm-20230802.patch"
patch_description: "link libm to absl string"
patch_type: "portability"
patch_source: "https://git.avroid.tech/Mirrors/abseil-cpp/issues/1100"
patch_source: "https://github.com/abseil/abseil-cpp/issues/1100"
- patch_file: "patches/20230802.1-0001-fix-mingw.patch"
patch_description: "Fix build with MinGW"
patch_type: "portability"
patch_source: "https://git.avroid.tech/Mirrors/abseil-cpp/commit/2f77684e8dc473a48dbc19167ffe69c40ce8ada4"
patch_source: "https://github.com/abseil/abseil-cpp/commit/2f77684e8dc473a48dbc19167ffe69c40ce8ada4"
"20230125.3":
- patch_file: "patches/0003-absl-string-libm.patch"
patch_description: "link libm to absl string"
@@ -71,7 +71,7 @@ patches:
patch_type: "portability"
- patch_file: "patches/0005-has-unique-object-representations.patch"
patch_description: "Workaround bug in GCC 7.2"
patch_source: "https://git.avroid.tech/Mirrors/abseil-cpp/pull/1250"
patch_source: "https://github.com/abseil/abseil-cpp/pull/1250"
patch_type: "portability"
"20211102.0":
- patch_file: "patches/0003-absl-string-libm.patch"

View File

@@ -74,10 +74,10 @@ class AbseilConan(ConanFile):
# upstream tries its best to export symbols, but it's broken for the moment
raise ConanInvalidConfiguration(f"{self.ref} shared not availabe for Visual Studio, please use version 20230802.1 or newer")
def build_requirements(self):
# https://github.com/abseil/abseil-cpp/blob/20240722.0/CMakeLists.txt#L19
if Version(self.version) >= "20240722.0":
self.tool_requires("cmake/[>=3.16 <4]")
# def build_requirements(self):
# # https://github.com/abseil/abseil-cpp/blob/20240722.0/CMakeLists.txt#L19
# if Version(self.version) >= "20240722.0":
# self.tool_requires("cmake/[>=3.16 <4]")
def layout(self):
cmake_layout(self, src_folder="src")

View File

@@ -21,9 +21,10 @@ class TestPackageConan(ConanFile):
tc.generate()
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
if not cross_building(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def test(self):
if not cross_building(self):