diff --git a/BUILD.bazel b/BUILD.bazel index 33ac2dac..9ebf6f9c 100644 --- a/BUILD.bazel +++ b/BUILD.bazel @@ -7,13 +7,24 @@ load( "gz_export_header", "gz_include_header", ) +load( + "@gz//bazel/lint:lint.bzl", + "add_lint_tests", +) +load("@rules_license//rules:license.bzl", "license") package( + default_applicable_licenses = [GZ_ROOT + "common:license"], default_visibility = GZ_VISIBILITY, features = GZ_FEATURES, ) -licenses(["notice"]) # Apache-2.0 +license( + name = "license", + package_name = "gz-common", +) + +licenses(["notice"]) exports_files(["LICENSE"]) @@ -67,6 +78,10 @@ cc_library( name = "common", srcs = sources + private_headers, hdrs = public_headers, + copts = [ + "-fexceptions", + "-Wno-unused-value", + ], includes = ["include"], deps = [ GZ_ROOT + "utils", @@ -86,6 +101,7 @@ test_sources = glob( [cc_test( name = src.replace("/", "_").replace(".cc", "").replace("src_", ""), srcs = [src], + copts = ["-fexceptions"], deps = [ ":common", GZ_ROOT + "common/testing", @@ -93,3 +109,5 @@ test_sources = glob( "@gtest//:gtest_main", ], ) for src in test_sources] + +add_lint_tests() diff --git a/av/BUILD.bazel b/av/BUILD.bazel index 93fb8a6a..8f833d54 100644 --- a/av/BUILD.bazel +++ b/av/BUILD.bazel @@ -1,10 +1,20 @@ load( "@gz//bazel/skylark:build_defs.bzl", + "GZ_FEATURES", "GZ_ROOT", "GZ_VISIBILITY", "gz_export_header", "gz_include_header", ) +load( + "@gz//bazel/lint:lint.bzl", + "add_lint_tests", +) + +package( + default_applicable_licenses = [GZ_ROOT + "common:license"], + features = GZ_FEATURES, +) public_headers_no_gen = glob([ "include/gz/common/*.hh", @@ -68,3 +78,5 @@ cc_library( "@gtest//:gtest_main", ], ) for src in test_sources] + +add_lint_tests() diff --git a/events/BUILD.bazel b/events/BUILD.bazel index 4d6936b9..23af24c1 100644 --- a/events/BUILD.bazel +++ b/events/BUILD.bazel @@ -1,10 +1,20 @@ load( "@gz//bazel/skylark:build_defs.bzl", + "GZ_FEATURES", "GZ_ROOT", "GZ_VISIBILITY", "gz_export_header", "gz_include_header", ) +load( + "@gz//bazel/lint:lint.bzl", + "add_lint_tests", +) + +package( + default_applicable_licenses = [GZ_ROOT + "common:license"], + features = GZ_FEATURES, +) public_headers_no_gen = glob([ "include/gz/common/*.hh", @@ -59,3 +69,5 @@ cc_library( "@gtest//:gtest_main", ], ) for src in test_sources] + +add_lint_tests() diff --git a/geospatial/BUILD.bazel b/geospatial/BUILD.bazel index b01923fa..317adb24 100644 --- a/geospatial/BUILD.bazel +++ b/geospatial/BUILD.bazel @@ -1,10 +1,20 @@ load( "@gz//bazel/skylark:build_defs.bzl", + "GZ_FEATURES", "GZ_ROOT", "GZ_VISIBILITY", "gz_export_header", "gz_include_header", ) +load( + "@gz//bazel/lint:lint.bzl", + "add_lint_tests", +) + +package( + default_applicable_licenses = [GZ_ROOT + "common:license"], + features = GZ_FEATURES, +) public_headers_no_gen = glob([ "include/gz/common/*.hh", @@ -42,6 +52,10 @@ cc_library( name = "geospatial", srcs = sources, hdrs = public_headers, + copts = [ + "-Wno-unused-value", + "-fexceptions", + ], includes = ["include"], visibility = GZ_VISIBILITY, deps = [ @@ -66,3 +80,5 @@ cc_library( "@gtest//:gtest_main", ], ) for src in test_sources] + +add_lint_tests() diff --git a/graphics/BUILD.bazel b/graphics/BUILD.bazel index 6d7b8822..a2285810 100644 --- a/graphics/BUILD.bazel +++ b/graphics/BUILD.bazel @@ -1,10 +1,20 @@ load( "@gz//bazel/skylark:build_defs.bzl", + "GZ_FEATURES", "GZ_ROOT", "GZ_VISIBILITY", "gz_export_header", "gz_include_header", ) +load( + "@gz//bazel/lint:lint.bzl", + "add_lint_tests", +) + +package( + default_applicable_licenses = [GZ_ROOT + "common:license"], + features = GZ_FEATURES, +) public_headers_no_gen = glob([ "include/gz/common/*.hh", @@ -43,6 +53,10 @@ cc_library( name = "graphics", srcs = sources, hdrs = public_headers, + copts = [ + "-Wno-implicit-fallthrough", + "-Wno-unused-value", + ], includes = ["include"], visibility = GZ_VISIBILITY, deps = [ @@ -70,3 +84,5 @@ cc_library( "@gtest//:gtest_main", ], ) for src in test_sources] + +add_lint_tests() diff --git a/io/BUILD.bazel b/io/BUILD.bazel index a3371a45..5a99ada6 100644 --- a/io/BUILD.bazel +++ b/io/BUILD.bazel @@ -1,10 +1,20 @@ load( "@gz//bazel/skylark:build_defs.bzl", + "GZ_FEATURES", "GZ_ROOT", "GZ_VISIBILITY", "gz_export_header", "gz_include_header", ) +load( + "@gz//bazel/lint:lint.bzl", + "add_lint_tests", +) + +package( + default_applicable_licenses = [GZ_ROOT + "common:license"], + features = GZ_FEATURES, +) public_headers_no_gen = glob([ "include/gz/common/*.hh", @@ -42,6 +52,9 @@ cc_library( name = "io", srcs = sources, hdrs = public_headers, + copts = [ + "-fexceptions", + ], includes = ["include"], visibility = GZ_VISIBILITY, deps = [ @@ -63,3 +76,5 @@ cc_library( "@gtest//:gtest_main", ], ) for src in test_sources] + +add_lint_tests() diff --git a/profiler/BUILD.bazel b/profiler/BUILD.bazel index 8d9a6dd2..1bbd351e 100644 --- a/profiler/BUILD.bazel +++ b/profiler/BUILD.bazel @@ -1,11 +1,21 @@ load( "@gz//bazel/skylark:build_defs.bzl", + "GZ_FEATURES", "GZ_ROOT", "GZ_VISIBILITY", "cmake_configure_file", "gz_export_header", "gz_include_header", ) +load( + "@gz//bazel/lint:lint.bzl", + "add_lint_tests", +) + +package( + default_applicable_licenses = [GZ_ROOT + "common:license"], + features = GZ_FEATURES, +) # Configuration for UNIX RMT_ENABLED = 1 @@ -97,6 +107,7 @@ cc_library( cc_test( name = "Profiler_Disabled_TEST", srcs = ["src/Profiler_Disabled_TEST.cc"], + copts = ["-Wno-macro-redefined"], defines = [ "GZ_PROFILER_ENABLE=0", "GZ_PROFILER_REMOTERY=0", @@ -117,3 +128,5 @@ cc_test( "@gtest//:gtest_main", ], ) + +add_lint_tests() diff --git a/test/BUILD.bazel b/test/BUILD.bazel index d62c70a6..b0c103bb 100644 --- a/test/BUILD.bazel +++ b/test/BUILD.bazel @@ -1,7 +1,17 @@ load( "@gz//bazel/skylark:build_defs.bzl", + "GZ_FEATURES", "GZ_ROOT", ) +load( + "@gz//bazel/lint:lint.bzl", + "add_lint_tests", +) + +package( + default_applicable_licenses = [GZ_ROOT + "common:license"], + features = GZ_FEATURES, +) cc_test( name = "INTEGRATION_console", @@ -35,8 +45,11 @@ cc_test( GZ_ROOT + "common", GZ_ROOT + "common/graphics", GZ_ROOT + "common/testing", + GZ_ROOT + "math", "@gtest//:gtest_main", ], ) exports_files(["data"]) + +add_lint_tests() diff --git a/testing/BUILD.bazel b/testing/BUILD.bazel index ac9111cd..be0dd2c6 100644 --- a/testing/BUILD.bazel +++ b/testing/BUILD.bazel @@ -1,8 +1,18 @@ load( "@gz//bazel/skylark:build_defs.bzl", + "GZ_FEATURES", "GZ_ROOT", "gz_export_header", ) +load( + "@gz//bazel/lint:lint.bzl", + "add_lint_tests", +) + +package( + default_applicable_licenses = [GZ_ROOT + "common:license"], + features = GZ_FEATURES, +) gz_export_header( name = "include/gz/common/testing/Export.hh", @@ -25,6 +35,7 @@ cc_library( "src/Utils.cc", ], hdrs = public_headers, + copts = ["-fexceptions"], includes = ["include"], visibility = ["//visibility:public"], deps = [ @@ -67,3 +78,5 @@ cc_test( "@gtest//:gtest_main", ], ) + +add_lint_tests()