diff --git a/third_party/clog/BUILD.bazel b/third_party/clog/BUILD.bazel index ee601b85f2b..e1d59304299 100644 --- a/third_party/clog/BUILD.bazel +++ b/third_party/clog/BUILD.bazel @@ -19,11 +19,20 @@ cc_library( ":windows": [], "//conditions:default": ["-Wno-unused-result"], }), + defines = select({ + # When linkstatic=False, we need default visibility + ":macos_x86_64": ["CLOG_VISIBILITY="], + "//conditions:default": [], + }), linkopts = select({ ":android": ["-llog"], "//conditions:default": [], }), - linkstatic = True, + linkstatic = select({ + # https://github.com/bazelbuild/bazel/issues/11552 + ":macos_x86_64": False, + "//conditions:default": True, + }), strip_include_prefix = "deps/clog/include", ) @@ -36,3 +45,11 @@ config_setting( name = "windows", values = {"cpu": "x64_windows"}, ) + +config_setting( + name = "macos_x86_64", + values = { + "apple_platform_type": "macos", + "cpu": "darwin", + }, +) diff --git a/third_party/cpuinfo/BUILD.bazel b/third_party/cpuinfo/BUILD.bazel index 2a2be96d82f..c2c6381950f 100644 --- a/third_party/cpuinfo/BUILD.bazel +++ b/third_party/cpuinfo/BUILD.bazel @@ -125,7 +125,11 @@ cc_library( "-Iexternal/cpuinfo/include", "-Iexternal/cpuinfo/src", ], - linkstatic = True, + linkstatic = select({ + # https://github.com/bazelbuild/bazel/issues/11552 + ":macos_x86_64": False, + "//conditions:default": True, + }), # Headers must be in textual_hdrs to allow us to set the standard to C99 textual_hdrs = [ "include/cpuinfo.h",