Skip to content

Commit

Permalink
Install header for private/experimental API functions
Browse files Browse the repository at this point in the history
This allows client developers to use the private API without
needing to manually specify the header path in the source
code, which may vary from system to system.
  • Loading branch information
JFreegman committed Dec 7, 2023
1 parent d89677f commit 7a6d50e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
3 changes: 3 additions & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,19 @@ genrule(
srcs = [
"//c-toxcore/toxav:toxav.h",
"//c-toxcore/toxcore:tox.h",
"//c-toxcore/toxcore:tox_private.h",
"//c-toxcore/toxencryptsave:toxencryptsave.h",
],
outs = [
"tox/toxav.h",
"tox/tox.h",
"tox/tox_private.h",
"tox/toxencryptsave.h",
],
cmd = """
cp $(location //c-toxcore/toxav:toxav.h) $(GENDIR)/c-toxcore/tox/toxav.h
cp $(location //c-toxcore/toxcore:tox.h) $(GENDIR)/c-toxcore/tox/tox.h
cp $(location //c-toxcore/toxcore:tox_private.h) $(GENDIR)/c-toxcore/tox/tox_private.h
cp $(location //c-toxcore/toxencryptsave:toxencryptsave.h) $(GENDIR)/c-toxcore/tox/toxencryptsave.h
""",
visibility = ["//visibility:public"],
Expand Down
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,8 @@ set(toxcore_PKGCONFIG_REQUIRES ${toxcore_PKGCONFIG_REQUIRES} libsodium)
set(toxcore_API_HEADERS
${toxcore_SOURCE_DIR}/toxcore/tox.h^tox
${toxcore_SOURCE_DIR}/toxcore/tox_events.h^tox
${toxcore_SOURCE_DIR}/toxcore/tox_dispatch.h^tox)
${toxcore_SOURCE_DIR}/toxcore/tox_dispatch.h^tox
${toxcore_SOURCE_DIR}/toxcore/tox_private.h^tox)

################################################################################
#
Expand Down
5 changes: 4 additions & 1 deletion toxcore/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ load("@rules_fuzzing//fuzzing:cc_defs.bzl", "cc_fuzz_test")
load("//tools:no_undefined.bzl", "cc_library")

exports_files(
srcs = ["tox.h"],
srcs = [
"tox.h",
"tox_private.h",
],
visibility = ["//c-toxcore:__pkg__"],
)

Expand Down

0 comments on commit 7a6d50e

Please sign in to comment.