diff --git a/cc/BUILD.bazel b/cc/BUILD.bazel index 7060e42..8080a8d 100644 --- a/cc/BUILD.bazel +++ b/cc/BUILD.bazel @@ -16,7 +16,7 @@ exports_files( visibility = ["//visibility:public"], ) -# Disable tests and test libraries with --@rules_swiftnav//:disable_test=true +# Disable tests and test libraries with --@rules_swiftnav///cc:disable_test=true bool_flag( name = "disable_tests", build_setting_default = False, @@ -29,7 +29,7 @@ config_setting( visibility = ["//visibility:public"], ) -# Enable exceptions with --@rules_swiftnav//:enable_exceptions=true +# Enable exceptions with --@rules_swiftnav//cc:enable_exceptions=true bool_flag( name = "enable_exceptions", build_setting_default = False, @@ -42,7 +42,7 @@ config_setting( visibility = ["//visibility:public"], ) -# Enable rtti with --@rules_swiftnav//:enable_exceptions=true +# Enable rtti with --@rules_swiftnav//cc:enable_exceptions=true bool_flag( name = "enable_rtti", build_setting_default = False, @@ -55,6 +55,7 @@ config_setting( visibility = ["//visibility:public"], ) +# Enable shared linking with --@rules_swiftnav//cc:enable_shared=true bool_flag( name = "enable_shared", build_setting_default = False, @@ -87,21 +88,21 @@ string_flag( visibility = ["//visibility:public"], ) -# Enable with --@rules_swiftnav//:cxx_standard=17 +# Enable with --@rules_swiftnav//cc:cxx_standard=17 config_setting( name = "cxx17", flag_values = {":cxx_standard": "17"}, visibility = ["//visibility:public"], ) -# Enable with --@rules_swiftnav//:cxx_standard=20 +# Enable with --@rules_swiftnav//cc:cxx_standard=20 config_setting( name = "cxx20", flag_values = {":cxx_standard": "20"}, visibility = ["//visibility:public"], ) -# Enable with --@rules_swiftnav//:cxx_standard=23 +# Enable with --@rules_swiftnav//cc:cxx_standard=23 config_setting( name = "cxx23", flag_values = {":cxx_standard": "23"}, diff --git a/cc/defs.bzl b/cc/defs.bzl index 7b4fc10..9501816 100644 --- a/cc/defs.bzl +++ b/cc/defs.bzl @@ -77,9 +77,9 @@ def _common_cxx_opts(exceptions = False, rtti = False, standard = None): def _construct_local_includes(local_includes): return [construct_local_include(path) for path in local_includes] -def _link_static(linkstatic = False): +def _link_static(linkstatic = True): return select({ - Label("//cc:_enable_shared"): True, + Label("//cc:_enable_shared"): False, "//conditions:default": linkstatic, })