Skip to content

Commit

Permalink
Absolutize flags
Browse files Browse the repository at this point in the history
  • Loading branch information
jvolkman committed Feb 12, 2023
1 parent 87b5940 commit bb74afd
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions pycross/private/wheel_build.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,21 @@ def _absolute_tool_value(workspace_name, value):
return tool_value_absolute
return value

def _join_flags_list(workspace_name, flags):
return " ".join([absolutize_path_in_str(workspace_name, "$$EXT_BUILD_ROOT$$/", flag) for flag in flags])

def _get_sysconfig_data(workspace_name, tools, flags):
cc = _absolute_tool_value(workspace_name, tools.cc)
cxx = _absolute_tool_value(workspace_name, tools.cxx)
ar = _absolute_tool_value(workspace_name, tools.cxx_linker_static)
vars = {
"CC": cc,
"CXX": cxx,
"CFLAGS": " ".join(flags.cc),
"CFLAGS": _join_flags_list(workspace_name, flags.cc),
"CCSHARED": "-fPIC" if flags.needs_pic_for_dynamic_libraries else "",
"LDSHAREDFLAGS": " ".join(flags.cxx_linker_shared),
"LDSHAREDFLAGS": _join_flags_list(workspace_name, flags.cxx_linker_shared),
"AR": ar,
"ARFLAGS": " ".join(flags.cxx_linker_static),
"ARFLAGS": _join_flags_list(workspace_name, flags.cxx_linker_static),
"CUSTOMIZED_OSX_COMPILER": "True",
"GNULD": "yes" if "gcc" in cc else "no", # is there a better way?
}
Expand Down

0 comments on commit bb74afd

Please sign in to comment.