aboutsummaryrefslogtreecommitdiff
path: root/guide
diff options
context:
space:
mode:
authorruki <waruqi@gmail.com>2019-07-27 00:29:38 +0800
committerruki <waruqi@gmail.com>2019-07-26 20:57:52 +0800
commit58df8d503fdac49a71355c638df580bda23568e0 (patch)
tree0228df4a144167ffa131d1461160a44609cb4323 /guide
parent31265429b8153b2ee7b4dd042ccf48c5d11b1e0a (diff)
downloadxmake-docs-58df8d503fdac49a71355c638df580bda23568e0.tar.gz
xmake-docs-58df8d503fdac49a71355c638df580bda23568e0.zip
update project examples
Diffstat (limited to 'guide')
-rw-r--r--guide/project_examples.md48
1 files changed, 48 insertions, 0 deletions
diff --git a/guide/project_examples.md b/guide/project_examples.md
index cdb1ca8e..620fc7de 100644
--- a/guide/project_examples.md
+++ b/guide/project_examples.md
@@ -331,3 +331,51 @@ target("usbview")
If you want to known more information, you can see [#173](https://github.com/xmake-io/xmake/issues/173).
+## MFC Application Program
+
+```lua
+target("test")
+     add_rules("win.sdk.mfc")
+     add_files("src/*.c")
+```
+
+For more details, please refer to: [#201](https://github.com/xmake-io/xmake/issues/201)
+
+## Protobuf program
+
+### Using c library
+
+```lua
+add_requires("protobuf-c")
+
+target("console_c")
+     set_kind("binary")
+     add_packages("protobuf-c")
+
+     add_files("src/*.c")
+     add_files("src/*.proto", {rules = "protobuf.c"})
+```
+
+### Using the C++ library
+
+```lua
+add_requires("protobuf-cpp")
+
+target("console_c++")
+     set_kind("binary")
+     set_languages("c++11")
+
+     add_packages("protobuf-cpp")
+
+     add_files("src/*.cpp")
+     add_files("src/*.proto", {rules = "protobuf.cpp"})
+```
+
+## Lex&Yacc Program
+
+```lua
+target("calc")
+     set_kind("binary")
+     add_rules("lex", "yacc")
+     add_files("src/*.l", "src/*.y")
+```