Skip to content

Commit

Permalink
Restore the ability to configure_dependency with direct {C,LD}FLAGS
Browse files Browse the repository at this point in the history
  • Loading branch information
elprans committed Oct 30, 2024
1 parent fee006f commit e23c777
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 16 deletions.
2 changes: 2 additions & 0 deletions metapkg/packages/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
PackageFileLayout,
MetaPackage,
NormalizedName,
PkgConfigMeta,
canonicalize_name,
get_bundled_pkg,
pep440_to_semver,
Expand Down Expand Up @@ -45,6 +46,7 @@
"BundledAdHocRustPackage",
"CMakeTargetBuildSystem",
"NormalizedName",
"PkgConfigMeta",
"canonicalize_name",
"get_bundled_pkg",
"pep440_to_semver",
Expand Down
38 changes: 22 additions & 16 deletions metapkg/packages/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1564,23 +1564,29 @@ def configure_dependency(
dep, relative_to="pkgbuild", wd=wd
)

build.sh_append_quoted_flags(
conf_args,
f"{var_prefix}_CFLAGS",
[f"-I{rel_path}/include"],
)
build.sh_append_quoted_flags(
conf_args,
f"{var_prefix}_LIBS",
dep_ldflags,
)
build.sh_append_quoted_flags(
conf_args,
f"{var_prefix}_CFLAGS",
transitive_cflags,
)
if var_prefix:
build.sh_append_quoted_flags(
conf_args,
f"{var_prefix}_CFLAGS",
[f"-I{rel_path}/include"] + transitive_cflags,
)
build.sh_append_quoted_flags(
conf_args,
f"{var_prefix}_LIBS",
dep_ldflags,
)
else:
build.sh_append_quoted_flags(
conf_args,
"CFLAGS",
[f"-I{rel_path}/include"] + transitive_cflags,
)
build.sh_append_quoted_ldflags(
conf_args,
dep_ldflags,
)

elif build.is_stdlib(dep):
elif build.is_stdlib(dep) and pkg_config_meta.provides_pkg_config:
conf_args[f"{var_prefix}_CFLAGS"] = f"-D_{var_prefix}_IS_SYSLIB"
std_ldflags = []
for shlib in dep.get_shlibs(build):
Expand Down

0 comments on commit e23c777

Please sign in to comment.