Skip to content

Commit 7efbc4f

Browse files
author
Andrey Filipenkov
committed
raise on attempt to build for 32-bit platform on macOS
1 parent 9d4d8bf commit 7efbc4f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

recipes/luajit/all/conanfile.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,18 @@ def configure(self):
4141
def layout(self):
4242
basic_layout(self, src_folder="src")
4343

44+
@property
45+
def _is_host_32bit(self):
46+
return self.settings.arch in ["armv7", "x86"]
47+
4448
def validate(self):
4549
if self.settings.os == "Macos" and self.settings.arch == "armv8" and cross_building(self):
4650
raise ConanInvalidConfiguration(f"{self.ref} can not be cross-built to Mac M1. Please, try any version >=2.1")
4751
elif Version(self.version) <= "2.1.0-beta1" and self.settings.os == "Macos" and self.settings.arch == "armv8":
4852
raise ConanInvalidConfiguration(f"{self.ref} is not supported by Mac M1. Please, try any version >=2.1")
53+
elif self._is_host_32bit and self.settings_build.os == "Macos":
54+
# well, technically it should work on macOS <= 10.14
55+
raise ConanInvalidConfiguration(f"{self.ref} cannot be cross-built to a 32-bit platform on macOS, see https://github.com/LuaJIT/LuaJIT/issues/664")
4956

5057
def source(self):
5158
filename = f"LuaJIT-{self.version}.tar.gz"
@@ -105,7 +112,7 @@ def _make_arguments(self):
105112
target_flag = f"{to_apple_arch(self)}-apple-ios{self._apple_deployment_target(default='')}"
106113
args.extend([
107114
f"CROSS={os.path.dirname(xcrun.cxx)}/",
108-
f"TARGET_FLAGS='-isysroot \"{xcrun.sdk_path}\" -target {target_flag}'",
115+
f"""TARGET_FLAGS='-isysroot "{xcrun.sdk_path}" -target {target_flag}'""",
109116
"TARGET_SYS=iOS",
110117
])
111118
return args

0 commit comments

Comments
 (0)