diff options
| author | ruki <[email protected]> | 2019-06-30 13:27:31 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2019-06-30 13:27:31 +0800 |
| commit | ff067fda68bf431a4d46ce0149d425c7665aa2e7 (patch) | |
| tree | f92d697dcfdafdd4e078b379aef73816b5b2b3a7 /tests/projects | |
| parent | 782068ccf675fb9846708b549b2ef3888701472b (diff) | |
add protobuf rules
Diffstat (limited to 'tests/projects')
| -rw-r--r-- | tests/projects/c++/protobuf/src/main.cpp | 9 | ||||
| -rw-r--r-- | tests/projects/c++/protobuf/src/test.proto | 8 | ||||
| -rw-r--r-- | tests/projects/c++/protobuf/xmake.lua | 20 |
3 files changed, 37 insertions, 0 deletions
diff --git a/tests/projects/c++/protobuf/src/main.cpp b/tests/projects/c++/protobuf/src/main.cpp new file mode 100644 index 000000000..db2361659 --- /dev/null +++ b/tests/projects/c++/protobuf/src/main.cpp @@ -0,0 +1,9 @@ +#include <iostream> + +using namespace std; + +int main(int argc, char** argv) +{ + cout << "hello world!" << endl; + return 0; +} diff --git a/tests/projects/c++/protobuf/src/test.proto b/tests/projects/c++/protobuf/src/test.proto new file mode 100644 index 000000000..0f129ea13 --- /dev/null +++ b/tests/projects/c++/protobuf/src/test.proto @@ -0,0 +1,8 @@ +syntax = "proto3"; +package test; +message TestCase { + string name = 4; +} +message Test { + repeated TestCase case = 1; +} diff --git a/tests/projects/c++/protobuf/xmake.lua b/tests/projects/c++/protobuf/xmake.lua new file mode 100644 index 000000000..b340a8cd4 --- /dev/null +++ b/tests/projects/c++/protobuf/xmake.lua @@ -0,0 +1,20 @@ + +-- add rules: debug and release +add_rules("mode.debug", "mode.release") + +-- add protobuf +add_requires("protobuf-cpp", "protoc") + +-- add target +target("console_c++") + + -- set kind + set_kind("binary") + + -- add rules and packages + add_rules("protobuf.cpp") + add_packages("protobuf-cpp", "protoc") + + -- add files + add_files("src/*.cpp", "src/*.proto") + |
