Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion cc/private/toolchain/gcc_deps_scanner_wrapper.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ set -eu

# Call the C++ compiler

%{cc} -E -x c++ -fmodules-ts -fdeps-file=out.tmp -fdeps-format=p1689r5 "$@" >"$DEPS_SCANNER_OUTPUT_FILE"
%{cc} -E -x c++ -fmodules-ts -fdeps-file="$DEPS_SCANNER_OUTPUT_FILE".tmp -fdeps-format=p1689r5 "$@"

mv "$DEPS_SCANNER_OUTPUT_FILE".tmp "$DEPS_SCANNER_OUTPUT_FILE"
9 changes: 8 additions & 1 deletion cc/private/toolchain/unix_cc_toolchain_config.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
# limitations under the License.
"""A Starlark cc_toolchain configuration rule"""

#buildifier: disable=bzl-visibility
load("@bazel_features//private:util.bzl", "ge")
load("@bazel_skylib//rules:common_settings.bzl", "BuildSettingInfo")
load("@rules_cc//cc:action_names.bzl", "ACTION_NAMES")
load(
Expand All @@ -35,6 +37,11 @@ load("@rules_cc//cc/common:cc_common.bzl", "cc_common")
load("@rules_cc//cc/toolchains:cc_toolchain_config_info.bzl", "CcToolchainConfigInfo")
load("@rules_cc//cc/toolchains:feature_injection.bzl", "FeatureInfo", "convert_feature")

def _cpp_module_extension(compiler):
"""Returns the BMI/CMI file extension for cpp_module artifact_name_pattern."""
if compiler == "gcc" and ge("9.0.0"):
return ".gcm"
return ".pcm"
def _target_os_version(ctx):
xcode_config = ctx.attr._xcode_config[apple_common.XcodeVersionConfig]
return xcode_config.minimum_os_for_platform_type(apple_common.platform_type.macos)
Expand Down Expand Up @@ -1891,7 +1898,7 @@ def _impl(ctx):
artifact_name_pattern(
category_name = "cpp_module",
prefix = "",
extension = ".pcm",
extension = _cpp_module_extension(ctx.attr.compiler),
),
]
features = [
Expand Down