Skip to content

Commit

Permalink
Update bazel files
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Carroll <[email protected]>
  • Loading branch information
mjcarroll committed Dec 7, 2023
1 parent 27c540c commit 3d4e590
Show file tree
Hide file tree
Showing 2 changed files with 49 additions and 5 deletions.
45 changes: 45 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ load(
"GZ_ROOT",
"GZ_VISIBILITY",
"add_lint_tests",
"gz_configure_file",
"gz_configure_header",
"gz_export_header",
"gz_include_header",
Expand Down Expand Up @@ -125,6 +126,16 @@ cc_library(
],
)

cc_library(
name = "sdformat_internal",
srcs = [
"src/gz.cc",
"src/gz.hh",
],
visibility = ["//visibility:private"],
deps = [":sdformat"],
)

test_sources = glob(
["src/*_TEST.cc"],
exclude = ["src/gz_TEST.cc"],
Expand All @@ -150,6 +161,40 @@ test_sources = glob(
],
) for src in test_sources]

gz_configure_file(
name = "sdformat.rb",
src = "src/cmd/cmdsdformat.rb.in",
out = "cmdsdformat.rb",
cmakelists = ["CMakeLists.txt"],
defines = [
"library_location=libgz-sdformat.so",
],
package = "sdformat",
visibility = [GZ_ROOT + "tools:__pkg__"],
)

gz_configure_file(
name = "sdformat_yaml",
src = "conf/sdformat.yaml.in",
out = "sdformat.yaml",
cmakelists = ["CMakeLists.txt"],
defines = [
"gz_library_path=gz/sdformat/cmdsdformat.rb",
],
package = "sdformat",
visibility = [GZ_ROOT + "tools:__pkg__"],
)

cc_binary(
name = "libgz-sdformat.so",
srcs = [":sdformat_internal"],
linkshared = True,
visibility = [GZ_ROOT + "tools:__pkg__"],
deps = [
":sdformat",
],
)

exports_files(["sdf"])

add_lint_tests()
9 changes: 4 additions & 5 deletions test/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
load(
"@gz//bazel/skylark:build_defs.bzl",
"GZ_FEATURES",
"GZ_ROOT",
"GZ_VISIBILITY",
"GZ_FEATURES",
"cmake_configure_file",
)

Expand All @@ -11,7 +11,6 @@ package(
features = GZ_FEATURES,
)


licenses(["notice"])

cmake_configure_file(
Expand All @@ -30,9 +29,9 @@ cc_library(
],
includes = ["."],
deps = [
GZ_ROOT + "utils:utils",
GZ_ROOT + "sdformat:sdformat"
]
GZ_ROOT + "utils:utils",
GZ_ROOT + "sdformat:sdformat",
],
)

integration_test_sources = glob(
Expand Down

0 comments on commit 3d4e590

Please sign in to comment.