diff options
| author | ruki <waruqi@gmail.com> | 2019-07-27 00:29:38 +0800 |
|---|---|---|
| committer | ruki <waruqi@gmail.com> | 2019-07-26 20:57:52 +0800 |
| commit | 58df8d503fdac49a71355c638df580bda23568e0 (patch) | |
| tree | 0228df4a144167ffa131d1461160a44609cb4323 | |
| parent | 31265429b8153b2ee7b4dd042ccf48c5d11b1e0a (diff) | |
| download | xmake-docs-58df8d503fdac49a71355c638df580bda23568e0.tar.gz xmake-docs-58df8d503fdac49a71355c638df580bda23568e0.zip | |
update project examples
| -rw-r--r-- | guide/project_examples.md | 48 | ||||
| -rw-r--r-- | zh-cn/guide/project_examples.md | 48 |
2 files changed, 96 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") +``` diff --git a/zh-cn/guide/project_examples.md b/zh-cn/guide/project_examples.md index 3f722f00..092a09fb 100644 --- a/zh-cn/guide/project_examples.md +++ b/zh-cn/guide/project_examples.md @@ -337,3 +337,51 @@ target("usbview") 更多详情可以参考:[#173](https://github.com/xmake-io/xmake/issues/173) +## MFC程序 + +```lua +target("test") + add_rules("win.sdk.mfc") + add_files("src/*.c") +``` + +更多详情可以参考:[#201](https://github.com/xmake-io/xmake/issues/201) + +## Protobuf程序 + +### 使用c库 + +```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"}) +``` + +### 使用c++库 + +```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程序 + +```lua +target("calc") + set_kind("binary") + add_rules("lex", "yacc") + add_files("src/*.l", "src/*.y") +``` |
