Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Review of the ContextBase include file. #2

Merged
merged 19 commits into from
Mar 30, 2020
Merged
41 changes: 27 additions & 14 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ package(default_visibility = ["//visibility:public"])

cc_library(
name = "include",
hdrs = [
"include/proxy-wasm/compat.h",
"include/proxy-wasm/wasm_vm.h",
"include/proxy-wasm/word.h",
],
hdrs = glob(["include/proxy-wasm/*.h"]),
deps = [
"@proxy_wasm_cpp_sdk//:common_lib",
],
Expand All @@ -17,11 +13,7 @@ cc_library(
# TODO: remove when dependent projects have been upgraded.
cc_library(
name = "include14",
hdrs = [
"include/proxy-wasm/compat.h",
"include/proxy-wasm/wasm_vm.h",
"include/proxy-wasm/word.h",
],
hdrs = glob(["include/proxy-wasm/*.h"]),
copts = ["-std=c++14"],
deps = [
"@proxy_wasm_cpp_sdk//:common_lib",
Expand All @@ -30,9 +22,31 @@ cc_library(

cc_test(
name = "wasm_vm_test",
srcs = ["wasm_vm_test.cc"],
srcs = ["test/wasm_vm_test.cc"],
deps = [
":include",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)

cc_test(
name = "context_test",
srcs = ["test/context_test.cc"],
deps = [
":include",
"@com_google_googletest//:gtest",
"@com_google_googletest//:gtest_main",
],
)

# TODO: remove when dependent projects have been upgraded.
cc_test(
name = "wasm_vm_14_test",
srcs = ["test/wasm_vm_test.cc"],
copts = ["-std=c++14"],
deps = [
":include14",
"@com_google_absl//absl/base",
"@com_google_absl//absl/strings:strings",
"@com_google_absl//absl/types:optional",
Expand All @@ -41,10 +55,9 @@ cc_test(
],
)

# TODO: remove when dependent projects have been upgraded.
cc_test(
name = "wasm_vm_14_test",
srcs = ["wasm_vm_test.cc"],
name = "context_14_test",
srcs = ["test/context_test.cc"],
copts = ["-std=c++14"],
deps = [
":include14",
Expand Down
3 changes: 3 additions & 0 deletions VERSIONING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# ABI Versioning

TODO
12 changes: 4 additions & 8 deletions include/proxy-wasm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,12 @@
// Provide compatibiliby for projects which have not yet moved to C++17.
// TODO: remove this when all dependent projects have upgraded.

#ifndef __cpp_lib_optional
#include "absl/types/optional.h"
#else
#if __cplusplus >= 201703L
#include <optional>
#endif

#ifndef __cpp_lib_string_view
#include "absl/strings/string_view.h"
#else
#include <string_view>
#else
#include "absl/types/optional.h"
#include "absl/strings/string_view.h"
#endif

namespace proxy_wasm {
Expand Down
Loading