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/Changelog.md b/Changelog.md index 01d5bbd4..99cef4c9 100644 --- a/Changelog.md +++ b/Changelog.md @@ -4,6 +4,17 @@ ## Gazebo Common 5.x +## Gazebo Common 5.5.1 (2024-03-14) + +1. Various Bazel adjustments for linting + * [Pull request #582](https://github.com/gazebosim/gz-common/pull/582) + +1. Extend AssimpLoader to parse material transmission factor + * [Pull request #577](https://github.com/gazebosim/gz-common/pull/577) + +1. Fix noise issue that appears in certain image textures + * [Pull request #578](https://github.com/gazebosim/gz-common/pull/578) + ## Gazebo Common 5.5.0 (2024-02-26) 1. Be louder when graphics is missing for geospatial 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..dfeeaa4f 100644 --- a/graphics/BUILD.bazel +++ b/graphics/BUILD.bazel @@ -1,16 +1,28 @@ 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", "include/gz/common/**/*.hh", ]) +private_headers = glob(["src/VHACD/*.h"]) + sources = glob( ["src/*.cc"], exclude = ["src/*_TEST.cc"], @@ -41,8 +53,12 @@ public_headers = public_headers_no_gen + [ cc_library( name = "graphics", - srcs = sources, + srcs = sources + private_headers, hdrs = public_headers, + copts = [ + "-Wno-implicit-fallthrough", + "-Wno-unused-value", + ], includes = ["include"], visibility = GZ_VISIBILITY, deps = [ @@ -70,3 +86,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()