summaryrefslogtreecommitdiff
path: root/xmake/templates/c++/console
diff options
context:
space:
mode:
Diffstat (limited to 'xmake/templates/c++/console')
-rw-r--r--xmake/templates/c++/console/project/src/main.cpp9
-rw-r--r--xmake/templates/c++/console/project/xmake.lua32
-rw-r--r--xmake/templates/c++/console/template.lua27
3 files changed, 68 insertions, 0 deletions
diff --git a/xmake/templates/c++/console/project/src/main.cpp b/xmake/templates/c++/console/project/src/main.cpp
new file mode 100644
index 000000000..db2361659
--- /dev/null
+++ b/xmake/templates/c++/console/project/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/xmake/templates/c++/console/project/xmake.lua b/xmake/templates/c++/console/project/xmake.lua
new file mode 100644
index 000000000..7c1409763
--- /dev/null
+++ b/xmake/templates/c++/console/project/xmake.lua
@@ -0,0 +1,32 @@
+-- the debug mode
+if modes("debug") then
+
+ -- enable the debug symbols
+ set_symbols("debug")
+
+ -- disable optimization
+ set_optimize("none")
+end
+
+-- the release mode
+if modes("release") then
+
+ -- set the symbols visibility: hidden
+ set_symbols("hidden")
+
+ -- enable fastest optimization
+ set_optimize("fastest")
+
+ -- strip all symbols
+ set_strip("all")
+end
+
+-- add target
+add_target("demo")
+
+ -- set kind
+ set_kind("binary")
+
+ -- add files
+ add_files("src/*.cpp")
+
diff --git a/xmake/templates/c++/console/template.lua b/xmake/templates/c++/console/template.lua
new file mode 100644
index 000000000..0cf6efff2
--- /dev/null
+++ b/xmake/templates/c++/console/template.lua
@@ -0,0 +1,27 @@
+--!The Automatic Cross-platform Build Tool
+--
+-- XMake is free software; you can redistribute it and/or modify
+-- it under the terms of the GNU Lesser General Public License as published by
+-- the Free Software Foundation; either version 2.1 of the License, or
+-- (at your option) any later version.
+--
+-- XMake is distributed in the hope that it will be useful,
+-- but WITHOUT ANY WARRANTY; without even the implied warranty of
+-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+-- GNU Lesser General Public License for more details.
+--
+-- You should have received a copy of the GNU Lesser General Public License
+-- along with XMake;
+-- If not, see <a href="http://www.gnu.org/licenses/"> http://www.gnu.org/licenses/</a>
+--
+-- Copyright (C) 2009 - 2015, ruki All rights reserved.
+--
+-- @author ruki
+-- @file template.lua
+--
+
+-- define module: template
+local template = template or {}
+
+-- return module: template
+return template