Skip to content

Commit

Permalink
Set MACOSX_DEPLOYMENT_TARGET in build steps in macOS
Browse files Browse the repository at this point in the history
  • Loading branch information
elprans committed Oct 16, 2024
1 parent 64ec7a7 commit e6c9650
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions metapkg/targets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,9 @@ def get_shlib_relpath_run_time_ldflags(
def get_global_cflags(self, build: Build) -> list[str]:
return []

def get_global_env(self, build: Build) -> dict[str, str]:
return {}

def get_global_cxxflags(self, build: Build) -> list[str]:
return self.get_global_cflags(build)

Expand Down Expand Up @@ -1949,6 +1952,8 @@ def sh_append_global_flags(
if args is None:
args = {}
conf_args = dict(args)
for k, v in self.target.get_global_env(self).items():
self.sh_append_flags(conf_args, k, [v])
if global_cflags:
self.sh_append_flags(conf_args, "CFLAGS", global_cflags)
if global_cxxflags:
Expand Down
5 changes: 5 additions & 0 deletions metapkg/targets/macos/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -461,6 +461,11 @@ def get_shlib_relpath_run_time_ldflags(
) -> list[str]:
return []

def get_global_env(self, build: targets.Build) -> dict[str, str]:
return super().get_global_env(build) | {
"MACOSX_DEPLOYMENT_TARGET": self.min_supported_version,
}

def get_global_cflags(self, build: targets.Build) -> list[str]:
flags = super().get_global_cflags(build)
return flags + [
Expand Down

0 comments on commit e6c9650

Please sign in to comment.