Skip to content

Commit

Permalink
raise on attempt to build for 32-bit platform on macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
kambala-decapitator committed Feb 13, 2025
1 parent 9d4d8bf commit 9849471
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion recipes/luajit/all/conanfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,18 @@ def configure(self):
def layout(self):
basic_layout(self, src_folder="src")

@property
def _is_host_32bit(self):
return self.settings.arch in ["armv7", "x86"]

def validate(self):
if self.settings.os == "Macos" and self.settings.arch == "armv8" and cross_building(self):
raise ConanInvalidConfiguration(f"{self.ref} can not be cross-built to Mac M1. Please, try any version >=2.1")
elif Version(self.version) <= "2.1.0-beta1" and self.settings.os == "Macos" and self.settings.arch == "armv8":
raise ConanInvalidConfiguration(f"{self.ref} is not supported by Mac M1. Please, try any version >=2.1")
elif self._is_host_32bit and self.settings_build.os == "Macos":
# well, technically it should work on macOS <= 10.14
raise ConanInvalidConfiguration(f"{self.ref} cannot be cross-built to a 32-bit platform on macOS, see https://github.com/LuaJIT/LuaJIT/issues/664")

def source(self):
filename = f"LuaJIT-{self.version}.tar.gz"
Expand Down Expand Up @@ -105,7 +112,7 @@ def _make_arguments(self):
target_flag = f"{to_apple_arch(self)}-apple-ios{self._apple_deployment_target(default='')}"
args.extend([
f"CROSS={os.path.dirname(xcrun.cxx)}/",
f"TARGET_FLAGS='-isysroot \"{xcrun.sdk_path}\" -target {target_flag}'",
f"""TARGET_FLAGS='-isysroot "{xcrun.sdk_path}" -target {target_flag}'""",
"TARGET_SYS=iOS",
])
return args
Expand Down

0 comments on commit 9849471

Please sign in to comment.