Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.7.2 added + macos cross compile support #12333

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions recipes/foonathan-memory/all/conandata.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
sources:
"0.7.2":
url: "https://github.com/foonathan/memory/archive/refs/tags/v0.7-2.tar.gz"
sha256: "8aba7211bb0e59b7538decda453e492cc6e36f8781508ed92b38cbafe8a48762"
"0.7.1":
url: "https://github.com/foonathan/memory/archive/refs/tags/v0.7-1.tar.gz"
sha256: "19eb61c5cba6ccc40b8ee741350fd29402a46641ba752c30b7079528d87dbc79"
Expand All @@ -8,3 +11,7 @@ sources:
patches:
"0.7.0":
- patch_file: "patches/0.7.0-0001-fix-virtualAllocFromApp.patch"
"0.7.1":
- patch_file: "patches/fix-macosCrossCompile.patch"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"0.7.2":
- patch_file: "patches/fix-macosCrossCompile.patch"
7 changes: 4 additions & 3 deletions recipes/foonathan-memory/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class FoonathanMemoryConan(ConanFile):
homepage = "https://github.com/foonathan/memory"
url = "https://github.com/conan-io/conan-center-index"
description = "STL compatible C++ memory allocator library"
topics = ("memory", "STL", "RawAllocator")
topics = ("memory", "stl", "rawallocator")

settings = "os", "arch", "compiler", "build_type"
options = {
Expand Down Expand Up @@ -46,10 +46,11 @@ def configure(self):
del self.options.fPIC

def validate(self):
# FIXME: jenkins servers throw error with this combination
# FIXME: jenkins servers throw error with this combination
# quick fix until somebody can reproduce
if hasattr(self, "settings_build") and cross_building(self):
raise ConanInvalidConfiguration("Cross building is not yet supported. Contributions are welcome")
if self.version == '0.7.0' or not (self.settings.os == "Macos" and self.settings.arch != self.settings_build.arch):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does it mean, only version 0.7.0 is broken? Because the message says it's not supported for any version.

raise ConanInvalidConfiguration("Cross building is not yet supported. Contributions are welcome")

def layout(self):
cmake_layout(self, src_folder="src")
Expand Down
13 changes: 13 additions & 0 deletions recipes/foonathan-memory/all/patches/fix-macosCrossCompile.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
diff --git a/tool/CMakeLists.txt b/tool/CMakeLists.txt
index df51586..0ba9a2b 100644
--- a/tool/CMakeLists.txt
+++ b/tool/CMakeLists.txt
@@ -9,6 +9,8 @@ if (CMAKE_CROSSCOMPILING)
# statically link when cross compiling so emulator doesn't need library paths
if (MSVC)
set_target_properties(foonathan_memory_node_size_debugger PROPERTIES LINK_FLAGS "/WHOLEARCHIVE")
+ elseif(CMAKE_HOST_APPLE AND ${CMAKE_SYSTEM_NAME} STREQUAL "Darwin") #MacOS to MacOS
+ message(STATUS "Cross compile on MacOS from ${CMAKE_HOST_SYSTEM_PROCESSOR} to ${CMAKE_OSX_ARCHITECTURES}")
else()
set_target_properties(foonathan_memory_node_size_debugger PROPERTIES LINK_FLAGS "-static")
endif()
2 changes: 2 additions & 0 deletions recipes/foonathan-memory/config.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
versions:
"0.7.2":
folder: all
"0.7.1":
folder: all
"0.7.0":
Expand Down