From 58df8d503fdac49a71355c638df580bda23568e0 Mon Sep 17 00:00:00 2001 From: ruki Date: Sat, 27 Jul 2019 00:29:38 +0800 Subject: update project examples --- guide/project_examples.md | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'guide') 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") +``` -- cgit v1.2.3