diff options
| author | ruki <[email protected]> | 2026-03-04 00:40:11 +0800 |
|---|---|---|
| committer | ruki <[email protected]> | 2026-03-04 00:40:11 +0800 |
| commit | 078b2ee0b6087a70bae05d3fa86d01078786513c (patch) | |
| tree | 6f28e600fd9dcfb11bebb7abf02d36ebf1b7a685 /xmake/templates/c++ | |
| parent | e0e20ef6ddbd0fc62fbaa00d195ce95f22a86fdf (diff) | |
move templates to repository
Diffstat (limited to 'xmake/templates/c++')
54 files changed, 0 insertions, 649 deletions
diff --git a/xmake/templates/c++/console/src/main.cpp b/xmake/templates/c++/console/src/main.cpp deleted file mode 100644 index 9b6abffea..000000000 --- a/xmake/templates/c++/console/src/main.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include <iostream> - -int main(int argc, char **argv) { - std::cout << "hello world!" << std::endl; - return 0; -} diff --git a/xmake/templates/c++/console/xmake.lua b/xmake/templates/c++/console/xmake.lua deleted file mode 100644 index c73be8724..000000000 --- a/xmake/templates/c++/console/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/*.cpp") - -${FAQ} diff --git a/xmake/templates/c++/module/binary/.gitignore b/xmake/templates/c++/module/binary/.gitignore deleted file mode 100644 index 152105761..000000000 --- a/xmake/templates/c++/module/binary/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Xmake cache -.xmake/ -build/ - -# MacOS Cache -.DS_Store - - diff --git a/xmake/templates/c++/module/binary/modules/binary/bar/.gitignore b/xmake/templates/c++/module/binary/modules/binary/bar/.gitignore deleted file mode 100644 index 152105761..000000000 --- a/xmake/templates/c++/module/binary/modules/binary/bar/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Xmake cache -.xmake/ -build/ - -# MacOS Cache -.DS_Store - - diff --git a/xmake/templates/c++/module/binary/modules/binary/bar/src/add.cpp b/xmake/templates/c++/module/binary/modules/binary/bar/src/add.cpp deleted file mode 100644 index 93fdf0ad8..000000000 --- a/xmake/templates/c++/module/binary/modules/binary/bar/src/add.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> - -int main(int argc, char **argv) { - int a = atoi(argv[1]); - int b = atoi(argv[2]); - printf("%d", a + b); - return 0; -} diff --git a/xmake/templates/c++/module/binary/modules/binary/bar/src/sub.cpp b/xmake/templates/c++/module/binary/modules/binary/bar/src/sub.cpp deleted file mode 100644 index ae7b6d1f2..000000000 --- a/xmake/templates/c++/module/binary/modules/binary/bar/src/sub.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include <stdio.h> -#include <stdlib.h> - -int main(int argc, char **argv) { - int a = atoi(argv[1]); - int b = atoi(argv[2]); - printf("%d", a - b); - return 0; -} diff --git a/xmake/templates/c++/module/binary/modules/binary/bar/xmake.lua b/xmake/templates/c++/module/binary/modules/binary/bar/xmake.lua deleted file mode 100644 index add3c6e97..000000000 --- a/xmake/templates/c++/module/binary/modules/binary/bar/xmake.lua +++ /dev/null @@ -1,10 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("add") - add_rules("module.binary") - add_files("src/add.cpp") - -target("sub") - add_rules("module.binary") - add_files("src/sub.cpp") - diff --git a/xmake/templates/c++/module/binary/src/main.cpp b/xmake/templates/c++/module/binary/src/main.cpp deleted file mode 100644 index 9b6abffea..000000000 --- a/xmake/templates/c++/module/binary/src/main.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include <iostream> - -int main(int argc, char **argv) { - std::cout << "hello world!" << std::endl; - return 0; -} diff --git a/xmake/templates/c++/module/binary/xmake.lua b/xmake/templates/c++/module/binary/xmake.lua deleted file mode 100644 index d73d457d3..000000000 --- a/xmake/templates/c++/module/binary/xmake.lua +++ /dev/null @@ -1,15 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_moduledirs("modules") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/*.cpp") - on_config(function (target) - import("binary.bar") - print("binary: 1 + 1 = %s", bar.add(1, 1)) - print("binary: 1 - 1 = %s", bar.sub(1, 1)) - end) - -${FAQ} - diff --git a/xmake/templates/c++/module/shared/.gitignore b/xmake/templates/c++/module/shared/.gitignore deleted file mode 100644 index 152105761..000000000 --- a/xmake/templates/c++/module/shared/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Xmake cache -.xmake/ -build/ - -# MacOS Cache -.DS_Store - - diff --git a/xmake/templates/c++/module/shared/modules/shared/foo/src/foo.cpp b/xmake/templates/c++/module/shared/modules/shared/foo/src/foo.cpp deleted file mode 100644 index adde214ca..000000000 --- a/xmake/templates/c++/module/shared/modules/shared/foo/src/foo.cpp +++ /dev/null @@ -1,22 +0,0 @@ -#include <xmi.h> - -static int add(lua_State *lua) { - int a = lua_tointeger(lua, 1); - int b = lua_tointeger(lua, 2); - lua_pushinteger(lua, a + b); - return 1; -} - -static int sub(lua_State *lua) { - int a = lua_tointeger(lua, 1); - int b = lua_tointeger(lua, 2); - lua_pushinteger(lua, a - b); - return 1; -} - -int luaopen(foo, lua_State *lua) { - static const luaL_Reg funcs[] = { { "add", add }, { "sub", sub }, { NULL, NULL } }; - lua_newtable(lua); - luaL_setfuncs(lua, funcs, 0); - return 1; -} diff --git a/xmake/templates/c++/module/shared/modules/shared/foo/xmake.lua b/xmake/templates/c++/module/shared/modules/shared/foo/xmake.lua deleted file mode 100644 index 9b3423d41..000000000 --- a/xmake/templates/c++/module/shared/modules/shared/foo/xmake.lua +++ /dev/null @@ -1,6 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("foo") - add_rules("module.shared") - add_files("src/foo.cpp") - diff --git a/xmake/templates/c++/module/shared/src/main.cpp b/xmake/templates/c++/module/shared/src/main.cpp deleted file mode 100644 index 9b6abffea..000000000 --- a/xmake/templates/c++/module/shared/src/main.cpp +++ /dev/null @@ -1,6 +0,0 @@ -#include <iostream> - -int main(int argc, char **argv) { - std::cout << "hello world!" << std::endl; - return 0; -} diff --git a/xmake/templates/c++/module/shared/xmake.lua b/xmake/templates/c++/module/shared/xmake.lua deleted file mode 100644 index 43aafe904..000000000 --- a/xmake/templates/c++/module/shared/xmake.lua +++ /dev/null @@ -1,15 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_moduledirs("modules") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/*.cpp") - on_config(function (target) - import("shared.foo") - print("shared: 1 + 1 = %s", foo.add(1, 1)) - print("shared: 1 - 1 = %s", foo.sub(1, 1)) - end) - -${FAQ} - diff --git a/xmake/templates/c++/qt/console/src/main.cpp b/xmake/templates/c++/qt/console/src/main.cpp deleted file mode 100644 index e876eea4f..000000000 --- a/xmake/templates/c++/qt/console/src/main.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include <QCoreApplication> - -int main(int argc, char *argv[]) { - QCoreApplication a(argc, argv); - printf("hello xmake\n"); - return a.exec(); -} diff --git a/xmake/templates/c++/qt/console/xmake.lua b/xmake/templates/c++/qt/console/xmake.lua deleted file mode 100644 index 2ce5aa993..000000000 --- a/xmake/templates/c++/qt/console/xmake.lua +++ /dev/null @@ -1,7 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - add_rules("qt.console") - add_files("src/*.cpp") - -${FAQ} diff --git a/xmake/templates/c++/qt/quickapp/src/main.cpp b/xmake/templates/c++/qt/quickapp/src/main.cpp deleted file mode 100644 index 7d9cb80df..000000000 --- a/xmake/templates/c++/qt/quickapp/src/main.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include <QGuiApplication> -#include <QQmlApplicationEngine> - -int main(int argc, char *argv[]) { -#if QT_VERSION >= 0x50601 - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); -#endif - - QGuiApplication app(argc, argv); - - QQmlApplicationEngine engine; - engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); - if (engine.rootObjects().isEmpty()) - return -1; - - return app.exec(); -} diff --git a/xmake/templates/c++/qt/quickapp/src/main.qml b/xmake/templates/c++/qt/quickapp/src/main.qml deleted file mode 100644 index 120cdbddd..000000000 --- a/xmake/templates/c++/qt/quickapp/src/main.qml +++ /dev/null @@ -1,18 +0,0 @@ -import QtQuick 2.6 -import QtQuick.Window 2.2 -import QtQuick.Controls 2.2 - -Window { - id: root - visible: true - width: 640 - height: 480 - title: qsTr("Hello World") - Button { - text: "Ok" - onClicked: { - root.color = Qt.rgba(Math.random(), Math.random(), Math.random(), 1); - } - } -} - diff --git a/xmake/templates/c++/qt/quickapp/src/qml.qrc b/xmake/templates/c++/qt/quickapp/src/qml.qrc deleted file mode 100644 index 5f6483ac3..000000000 --- a/xmake/templates/c++/qt/quickapp/src/qml.qrc +++ /dev/null @@ -1,5 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>main.qml</file> - </qresource> -</RCC> diff --git a/xmake/templates/c++/qt/quickapp/xmake.lua b/xmake/templates/c++/qt/quickapp/xmake.lua deleted file mode 100644 index 3f71d1c15..000000000 --- a/xmake/templates/c++/qt/quickapp/xmake.lua +++ /dev/null @@ -1,9 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - add_rules("qt.quickapp") - add_headerfiles("src/*.h") - add_files("src/*.cpp") - add_files("src/qml.qrc") - -${FAQ} diff --git a/xmake/templates/c++/qt/quickapp_static/src/main.cpp b/xmake/templates/c++/qt/quickapp_static/src/main.cpp deleted file mode 100644 index 7d9cb80df..000000000 --- a/xmake/templates/c++/qt/quickapp_static/src/main.cpp +++ /dev/null @@ -1,17 +0,0 @@ -#include <QGuiApplication> -#include <QQmlApplicationEngine> - -int main(int argc, char *argv[]) { -#if QT_VERSION >= 0x50601 - QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); -#endif - - QGuiApplication app(argc, argv); - - QQmlApplicationEngine engine; - engine.load(QUrl(QStringLiteral("qrc:/main.qml"))); - if (engine.rootObjects().isEmpty()) - return -1; - - return app.exec(); -} diff --git a/xmake/templates/c++/qt/quickapp_static/src/main.qml b/xmake/templates/c++/qt/quickapp_static/src/main.qml deleted file mode 100644 index 120cdbddd..000000000 --- a/xmake/templates/c++/qt/quickapp_static/src/main.qml +++ /dev/null @@ -1,18 +0,0 @@ -import QtQuick 2.6 -import QtQuick.Window 2.2 -import QtQuick.Controls 2.2 - -Window { - id: root - visible: true - width: 640 - height: 480 - title: qsTr("Hello World") - Button { - text: "Ok" - onClicked: { - root.color = Qt.rgba(Math.random(), Math.random(), Math.random(), 1); - } - } -} - diff --git a/xmake/templates/c++/qt/quickapp_static/src/qml.qrc b/xmake/templates/c++/qt/quickapp_static/src/qml.qrc deleted file mode 100644 index 5f6483ac3..000000000 --- a/xmake/templates/c++/qt/quickapp_static/src/qml.qrc +++ /dev/null @@ -1,5 +0,0 @@ -<RCC> - <qresource prefix="/"> - <file>main.qml</file> - </qresource> -</RCC> diff --git a/xmake/templates/c++/qt/quickapp_static/xmake.lua b/xmake/templates/c++/qt/quickapp_static/xmake.lua deleted file mode 100644 index 0d311a762..000000000 --- a/xmake/templates/c++/qt/quickapp_static/xmake.lua +++ /dev/null @@ -1,16 +0,0 @@ -add_rules("mode.debug", "mode.release") - -includes("@builtin/qt") - -target("${TARGET_NAME}") - add_rules("qt.quickapp_static") - add_headerfiles("src/*.h") - add_files("src/*.cpp") - add_files("src/qml.qrc") - add_frameworks("QtQuickControls2", "QtQuickTemplates2") - qt_add_static_plugins("QtQuick2Plugin", {linkdirs = "qml/QtQuick.2", links = "qtquick2plugin"}) - qt_add_static_plugins("QtQuick2WindowPlugin", {linkdirs = "qml/QtQuick/Window.2", links = "windowplugin"}) - qt_add_static_plugins("QtQuickControls2Plugin", {linkdirs = "qml/QtQuick/Controls.2", links = "qtquickcontrols2plugin"}) - qt_add_static_plugins("QtQuickTemplates2Plugin", {linkdirs = "qml/QtQuick/Templates.2", links = "qtquicktemplates2plugin"}) - -${FAQ} diff --git a/xmake/templates/c++/qt/shared/src/demo.cpp b/xmake/templates/c++/qt/shared/src/demo.cpp deleted file mode 100644 index 576c861f0..000000000 --- a/xmake/templates/c++/qt/shared/src/demo.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#include "demo.h" - -QtDemo::QtDemo() { -} diff --git a/xmake/templates/c++/qt/shared/src/demo.h b/xmake/templates/c++/qt/shared/src/demo.h deleted file mode 100644 index 89f29ec46..000000000 --- a/xmake/templates/c++/qt/shared/src/demo.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef QT_DEMO_H -#define QT_DEMO_H - -#include "demo_global.h" - -class QT_DEMOSHARED_EXPORT QtDemo { - public: - QtDemo(); -}; - -#endif // QT_DEMO_H diff --git a/xmake/templates/c++/qt/shared/src/demo_global.h b/xmake/templates/c++/qt/shared/src/demo_global.h deleted file mode 100644 index d6b1ddf0b..000000000 --- a/xmake/templates/c++/qt/shared/src/demo_global.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef QT_DEMO_GLOBAL_H -#define QT_DEMO_GLOBAL_H - -#include <QtCore/qglobal.h> - -#if defined(QT_DEMO_LIBRARY) -#define QT_DEMOSHARED_EXPORT Q_DECL_EXPORT -#else -#define QT_DEMOSHARED_EXPORT Q_DECL_IMPORT -#endif - -#endif // QT_DEMO_GLOBAL_H diff --git a/xmake/templates/c++/qt/shared/xmake.lua b/xmake/templates/c++/qt/shared/xmake.lua deleted file mode 100644 index 3b07153b9..000000000 --- a/xmake/templates/c++/qt/shared/xmake.lua +++ /dev/null @@ -1,10 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - add_rules("qt.shared") - add_headerfiles("src/*.h") - add_files("src/*.cpp") - add_defines("QT_DEMO_LIBRARY") - add_frameworks("QtGui") - -${FAQ} diff --git a/xmake/templates/c++/qt/static/src/demo.cpp b/xmake/templates/c++/qt/static/src/demo.cpp deleted file mode 100644 index 576c861f0..000000000 --- a/xmake/templates/c++/qt/static/src/demo.cpp +++ /dev/null @@ -1,4 +0,0 @@ -#include "demo.h" - -QtDemo::QtDemo() { -} diff --git a/xmake/templates/c++/qt/static/src/demo.h b/xmake/templates/c++/qt/static/src/demo.h deleted file mode 100644 index 24730c9d8..000000000 --- a/xmake/templates/c++/qt/static/src/demo.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef QT_DEMO_H -#define QT_DEMO_H - -class QtDemo { - public: - QtDemo(); -}; - -#endif // QT_DEMO_H diff --git a/xmake/templates/c++/qt/static/xmake.lua b/xmake/templates/c++/qt/static/xmake.lua deleted file mode 100644 index 371bdf082..000000000 --- a/xmake/templates/c++/qt/static/xmake.lua +++ /dev/null @@ -1,9 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - add_rules("qt.static") - add_headerfiles("src/*.h") - add_files("src/*.cpp") - add_frameworks("QtGui") - -${FAQ} diff --git a/xmake/templates/c++/qt/widgetapp/src/main.cpp b/xmake/templates/c++/qt/widgetapp/src/main.cpp deleted file mode 100644 index 191ae18d2..000000000 --- a/xmake/templates/c++/qt/widgetapp/src/main.cpp +++ /dev/null @@ -1,9 +0,0 @@ -#include "mainwindow.h" -#include <QApplication> - -int main(int argc, char *argv[]) { - QApplication a(argc, argv); - MainWindow w; - w.show(); - return a.exec(); -} diff --git a/xmake/templates/c++/qt/widgetapp/src/mainwindow.cpp b/xmake/templates/c++/qt/widgetapp/src/mainwindow.cpp deleted file mode 100644 index c9c6a0d98..000000000 --- a/xmake/templates/c++/qt/widgetapp/src/mainwindow.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "mainwindow.h" -#include "ui_mainwindow.h" - -MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { - ui->setupUi(this); -} - -MainWindow::~MainWindow() { - delete ui; -} diff --git a/xmake/templates/c++/qt/widgetapp/src/mainwindow.h b/xmake/templates/c++/qt/widgetapp/src/mainwindow.h deleted file mode 100644 index a4245aa42..000000000 --- a/xmake/templates/c++/qt/widgetapp/src/mainwindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include <QMainWindow> - -namespace Ui { -class MainWindow; -} - -class MainWindow : public QMainWindow { - Q_OBJECT - - public: - explicit MainWindow(QWidget *parent = 0); - ~MainWindow(); - - private: - Ui::MainWindow *ui; -}; - -#endif // MAINWINDOW_H diff --git a/xmake/templates/c++/qt/widgetapp/src/mainwindow.ui b/xmake/templates/c++/qt/widgetapp/src/mainwindow.ui deleted file mode 100644 index 1c59b695e..000000000 --- a/xmake/templates/c++/qt/widgetapp/src/mainwindow.ui +++ /dev/null @@ -1,24 +0,0 @@ -<ui version="4.0"> - <class>MainWindow</class> - <widget class="QMainWindow" name="MainWindow" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>400</width> - <height>300</height> - </rect> - </property> - <property name="windowTitle" > - <string>MainWindow</string> - </property> - <widget class="QMenuBar" name="menuBar" /> - <widget class="QToolBar" name="mainToolBar" /> - <widget class="QWidget" name="centralWidget" /> - <widget class="QStatusBar" name="statusBar" /> - </widget> - <layoutDefault spacing="6" margin="11" /> - <pixmapfunction></pixmapfunction> - <resources/> - <connections/> -</ui> diff --git a/xmake/templates/c++/qt/widgetapp/xmake.lua b/xmake/templates/c++/qt/widgetapp/xmake.lua deleted file mode 100644 index e0f9f455e..000000000 --- a/xmake/templates/c++/qt/widgetapp/xmake.lua +++ /dev/null @@ -1,11 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("${TARGET_NAME}") - add_rules("qt.widgetapp") - add_headerfiles("src/*.h") - add_files("src/*.cpp") - add_files("src/mainwindow.ui") - -- add files with Q_OBJECT meta (only for qt.moc) - add_files("src/mainwindow.h") - -${FAQ} diff --git a/xmake/templates/c++/qt/widgetapp_static/src/main.cpp b/xmake/templates/c++/qt/widgetapp_static/src/main.cpp deleted file mode 100644 index db5b0cce8..000000000 --- a/xmake/templates/c++/qt/widgetapp_static/src/main.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "mainwindow.h" -#include <QApplication> - -int main(int argc, char *argv[]) { - QApplication a(argc, argv); - MainWindow w; - w.show(); - - return a.exec(); -} diff --git a/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.cpp b/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.cpp deleted file mode 100644 index c9c6a0d98..000000000 --- a/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.cpp +++ /dev/null @@ -1,10 +0,0 @@ -#include "mainwindow.h" -#include "ui_mainwindow.h" - -MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) { - ui->setupUi(this); -} - -MainWindow::~MainWindow() { - delete ui; -} diff --git a/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.h b/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.h deleted file mode 100644 index a4245aa42..000000000 --- a/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.h +++ /dev/null @@ -1,21 +0,0 @@ -#ifndef MAINWINDOW_H -#define MAINWINDOW_H - -#include <QMainWindow> - -namespace Ui { -class MainWindow; -} - -class MainWindow : public QMainWindow { - Q_OBJECT - - public: - explicit MainWindow(QWidget *parent = 0); - ~MainWindow(); - - private: - Ui::MainWindow *ui; -}; - -#endif // MAINWINDOW_H diff --git a/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.ui b/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.ui deleted file mode 100644 index 1c59b695e..000000000 --- a/xmake/templates/c++/qt/widgetapp_static/src/mainwindow.ui +++ /dev/null @@ -1,24 +0,0 @@ -<ui version="4.0"> - <class>MainWindow</class> - <widget class="QMainWindow" name="MainWindow" > - <property name="geometry" > - <rect> - <x>0</x> - <y>0</y> - <width>400</width> - <height>300</height> - </rect> - </property> - <property name="windowTitle" > - <string>MainWindow</string> - </property> - <widget class="QMenuBar" name="menuBar" /> - <widget class="QToolBar" name="mainToolBar" /> - <widget class="QWidget" name="centralWidget" /> - <widget class="QStatusBar" name="statusBar" /> - </widget> - <layoutDefault spacing="6" margin="11" /> - <pixmapfunction></pixmapfunction> - <resources/> - <connections/> -</ui> diff --git a/xmake/templates/c++/qt/widgetapp_static/xmake.lua b/xmake/templates/c++/qt/widgetapp_static/xmake.lua deleted file mode 100644 index 2c357e531..000000000 --- a/xmake/templates/c++/qt/widgetapp_static/xmake.lua +++ /dev/null @@ -1,18 +0,0 @@ -add_rules("mode.debug", "mode.release") - -includes("@builtin/qt") - -target("${TARGET_NAME}") - add_rules("qt.widgetapp_static") - add_headerfiles("src/*.h") - add_files("src/*.cpp") - add_files("src/mainwindow.ui") - - -- add files with Q_OBJECT meta (only for qt.moc) - add_files("src/mainwindow.h") - - -- add plugin: QSvgPlugin (optional) - add_frameworks("QtSvg") - qt_add_static_plugins("QSvgPlugin", {linkdirs = "plugins/imageformats", links = {"qsvg"}}) - -${FAQ} diff --git a/xmake/templates/c++/shared/src/foo.cpp b/xmake/templates/c++/shared/src/foo.cpp deleted file mode 100644 index 1a1fb3425..000000000 --- a/xmake/templates/c++/shared/src/foo.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "foo.h" - -int add(int a, int b) { - return a + b; -} diff --git a/xmake/templates/c++/shared/src/foo.h b/xmake/templates/c++/shared/src/foo.h deleted file mode 100644 index bd496c784..000000000 --- a/xmake/templates/c++/shared/src/foo.h +++ /dev/null @@ -1,17 +0,0 @@ -#ifdef __cplusplus -extern "C" { -#endif - -#if defined(_WIN32) -#define __export __declspec(dllexport) -#elif defined(__GNUC__) && ((__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 3)) -#define __export __attribute__((visibility("default"))) -#else -#define __export -#endif - -__export int add(int a, int b); - -#ifdef __cplusplus -} -#endif diff --git a/xmake/templates/c++/shared/src/main.cpp b/xmake/templates/c++/shared/src/main.cpp deleted file mode 100644 index 3834ee4d3..000000000 --- a/xmake/templates/c++/shared/src/main.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "foo.h" -#include <iostream> - -int main(int argc, char **argv) { - std::cout << "add(1, 2) = " << add(1, 2) << std::endl; - return 0; -} diff --git a/xmake/templates/c++/shared/xmake.lua b/xmake/templates/c++/shared/xmake.lua deleted file mode 100644 index 96bd36d7c..000000000 --- a/xmake/templates/c++/shared/xmake.lua +++ /dev/null @@ -1,12 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("foo") - set_kind("shared") - add_files("src/foo.cpp") - -target("${TARGET_NAME}") - set_kind("binary") - add_deps("foo") - add_files("src/main.cpp") - -${FAQ} diff --git a/xmake/templates/c++/static/src/foo.cpp b/xmake/templates/c++/static/src/foo.cpp deleted file mode 100644 index 1a1fb3425..000000000 --- a/xmake/templates/c++/static/src/foo.cpp +++ /dev/null @@ -1,5 +0,0 @@ -#include "foo.h" - -int add(int a, int b) { - return a + b; -} diff --git a/xmake/templates/c++/static/src/foo.h b/xmake/templates/c++/static/src/foo.h deleted file mode 100644 index d2506bca9..000000000 --- a/xmake/templates/c++/static/src/foo.h +++ /dev/null @@ -1,9 +0,0 @@ -#ifdef __cplusplus -extern "C" { -#endif - -int add(int a, int b); - -#ifdef __cplusplus -} -#endif diff --git a/xmake/templates/c++/static/src/main.cpp b/xmake/templates/c++/static/src/main.cpp deleted file mode 100644 index 3834ee4d3..000000000 --- a/xmake/templates/c++/static/src/main.cpp +++ /dev/null @@ -1,7 +0,0 @@ -#include "foo.h" -#include <iostream> - -int main(int argc, char **argv) { - std::cout << "add(1, 2) = " << add(1, 2) << std::endl; - return 0; -} diff --git a/xmake/templates/c++/static/xmake.lua b/xmake/templates/c++/static/xmake.lua deleted file mode 100644 index 2c15d36e8..000000000 --- a/xmake/templates/c++/static/xmake.lua +++ /dev/null @@ -1,12 +0,0 @@ -add_rules("mode.debug", "mode.release") - -target("foo") - set_kind("static") - add_files("src/foo.cpp") - -target("${TARGET_NAME}") - set_kind("binary") - add_deps("foo") - add_files("src/main.cpp") - -${FAQ} diff --git a/xmake/templates/c++/wxwidgets/src/main.cpp b/xmake/templates/c++/wxwidgets/src/main.cpp deleted file mode 100644 index 4b43fe6e3..000000000 --- a/xmake/templates/c++/wxwidgets/src/main.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include <wx/wx.h> - -namespace Examples { -class Frame : public wxFrame { - enum wxOwnedID { - ID_Hello = 2 - }; - - public: - Frame() : wxFrame(nullptr, wxID_ANY, "Hello World") { - auto menuFile = new wxMenu(); - menuFile->Append(ID_Hello, "&Hello...\tCtrl-H", "Help string shown in status bar for this menu item"); - menuFile->AppendSeparator(); - menuFile->Append(wxID_EXIT); - - auto menuHelp = new wxMenu(); - menuHelp->Append(wxID_ABOUT); - auto menuBar = new wxMenuBar(); - - menuBar->Append(menuFile, "&File"); - menuBar->Append(menuHelp, "&Help"); - SetMenuBar(menuBar); - - CreateStatusBar(); - SetStatusText("Welcome to wxWidgets!"); - - menuBar->Bind(wxEVT_MENU, [&](wxCommandEvent &event) { - if (event.GetId() == ID_Hello) - wxLogMessage("Hello world from wxWidgets!"); - else if (event.GetId() == wxID_ABOUT) - wxMessageBox("This is a wxWidgets Hello World example", "About Hello World", wxOK | wxICON_INFORMATION); - else if (event.GetId() == wxID_EXIT) - Close(true); - else - event.Skip(); - }); - } -}; - -class Application : public wxApp { - bool OnInit() override { - (new Frame())->Show(); - return true; - } -}; -} // namespace Examples - -wxIMPLEMENT_APP(Examples::Application);
\ No newline at end of file diff --git a/xmake/templates/c++/wxwidgets/xmake.lua b/xmake/templates/c++/wxwidgets/xmake.lua deleted file mode 100644 index 65a05c72c..000000000 --- a/xmake/templates/c++/wxwidgets/xmake.lua +++ /dev/null @@ -1,11 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_requires("wxwidgets") - -target("${TARGET_NAME}") - set_kind("binary") - add_files("src/*.cpp") - set_languages("c++14") - add_packages("wxwidgets") - -${FAQ}
\ No newline at end of file diff --git a/xmake/templates/c++/xmake/cli/src/lni/main.cpp b/xmake/templates/c++/xmake/cli/src/lni/main.cpp deleted file mode 100644 index 3de2b1e36..000000000 --- a/xmake/templates/c++/xmake/cli/src/lni/main.cpp +++ /dev/null @@ -1,23 +0,0 @@ -extern "C" { -#include <xmake/xmake.h> -} - -static tb_byte_t const g_luafiles_data[] = { -#include "luafiles.xmz.h" -}; - -static tb_int_t lni_test_hello(lua_State *lua) { - lua_pushliteral(lua, "hello xmake!"); - return 1; -} - -static tb_void_t lni_initalizer(xm_engine_ref_t engine, lua_State *lua) { - static luaL_Reg const lni_test_funcs[] = { { "hello", lni_test_hello }, { tb_null, tb_null } }; - xm_engine_register(engine, "test", lni_test_funcs); - xm_engine_add_embedfiles(engine, g_luafiles_data, sizeof(g_luafiles_data)); -} - -tb_int_t main(tb_int_t argc, tb_char_t **argv) { - tb_char_t *taskargv[] = { "lua", "-D", "lua.main", tb_null }; - return xm_engine_run("${TARGET_NAME}", argc, argv, taskargv, lni_initalizer); -} diff --git a/xmake/templates/c++/xmake/cli/src/lua/main.lua b/xmake/templates/c++/xmake/cli/src/lua/main.lua deleted file mode 100644 index d87daf102..000000000 --- a/xmake/templates/c++/xmake/cli/src/lua/main.lua +++ /dev/null @@ -1,10 +0,0 @@ -import("core.base.option") -import("lib.lni.test") - -function main () - print(test.hello()) - local argv = option.get("arguments") - if argv then - print(argv) - end -end diff --git a/xmake/templates/c++/xmake/cli/xmake.lua b/xmake/templates/c++/xmake/cli/xmake.lua deleted file mode 100644 index cf1987c60..000000000 --- a/xmake/templates/c++/xmake/cli/xmake.lua +++ /dev/null @@ -1,12 +0,0 @@ -add_rules("mode.debug", "mode.release") - -add_requires("libxmake") - -target("${TARGET_NAME}") - add_rules("xmake.cli") - add_files("src/lni/*.cpp") - add_files("src/lua/*.lua", {rootdir = "src"}) - add_packages("libxmake") - -${FAQ} - |
