Unnamed: 0
int64 0
0
| repo_id
stringlengths 5
186
| file_path
stringlengths 15
223
| content
stringlengths 1
32.8M
⌀ |
---|---|---|---|
0 | repos/xmake/xmake/templates/nim/shared | repos/xmake/xmake/templates/nim/shared/project/xmake.lua | add_rules("mode.debug", "mode.release")
target("${TARGETNAME}")
set_kind("shared")
add_files("src/foo.nim")
target("${TARGETNAME}_demo")
set_kind("binary")
add_deps("${TARGETNAME}")
add_files("src/main.nim")
${FAQ}
|
0 | repos/xmake/xmake/templates/nim | repos/xmake/xmake/templates/nim/static/template.lua | template("static")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/nim/static | repos/xmake/xmake/templates/nim/static/project/xmake.lua | add_rules("mode.debug", "mode.release")
target("${TARGETNAME}")
set_kind("static")
add_files("src/foo.nim")
target("${TARGETNAME}_demo")
set_kind("binary")
add_deps("${TARGETNAME}")
add_files("src/main.nim")
${FAQ}
|
0 | repos/xmake/xmake/templates/nim | repos/xmake/xmake/templates/nim/console/template.lua | template("console")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/nim/console | repos/xmake/xmake/templates/nim/console/project/xmake.lua | add_rules("mode.debug", "mode.release")
target("${TARGETNAME}")
set_kind("binary")
add_files("src/main.nim")
${FAQ}
|
0 | repos/xmake/xmake/templates/pascal | repos/xmake/xmake/templates/pascal/shared/template.lua | template("shared")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/pascal/shared | repos/xmake/xmake/templates/pascal/shared/project/xmake.lua | add_rules("mode.debug", "mode.release")
target("foo")
set_kind("shared")
add_files("src/foo.pas")
target("${TARGETNAME}")
set_kind("binary")
add_deps("foo")
add_files("src/main.pas")
${FAQ}
|
0 | repos/xmake/xmake/templates/pascal | repos/xmake/xmake/templates/pascal/console/template.lua | template("console")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/pascal/console | repos/xmake/xmake/templates/pascal/console/project/xmake.lua | add_rules("mode.debug", "mode.release")
target("${TARGETNAME}")
set_kind("binary")
add_files("src/*.pas")
${FAQ}
|
0 | repos/xmake/xmake/templates/cuda | repos/xmake/xmake/templates/cuda/shared/template.lua | template("shared")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/cuda/shared | repos/xmake/xmake/templates/cuda/shared/project/xmake.lua | add_rules("mode.debug", "mode.release")
target("${TARGETNAME}")
set_kind("shared")
add_files("src/**.cu")
add_includedirs("inc")
-- generate SASS code for SM architecture of current host
add_cugencodes("native")
-- generate PTX code for the virtual architecture to guarantee compatibility
add_cugencodes("compute_30")
-- -- generate SASS code for each SM architecture
-- add_cugencodes("sm_30", "sm_35", "sm_37", "sm_50", "sm_52", "sm_60", "sm_61", "sm_70", "sm_75")
-- -- generate PTX code from the highest SM architecture to guarantee forward-compatibility
-- add_cugencodes("compute_75")
${FAQ}
|
0 | repos/xmake/xmake/templates/cuda | repos/xmake/xmake/templates/cuda/static/template.lua | template("static")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/cuda/static | repos/xmake/xmake/templates/cuda/static/project/xmake.lua | add_rules("mode.debug", "mode.release")
target("${TARGETNAME}")
set_kind("static")
add_files("src/**.cu")
add_includedirs("inc")
-- generate SASS code for SM architecture of current host
add_cugencodes("native")
-- generate PTX code for the virtual architecture to guarantee compatibility
add_cugencodes("compute_30")
-- -- generate SASS code for each SM architecture
-- add_cugencodes("sm_30", "sm_35", "sm_37", "sm_50", "sm_52", "sm_60", "sm_61", "sm_70", "sm_75")
-- -- generate PTX code from the highest SM architecture to guarantee forward-compatibility
-- add_cugencodes("compute_75")
${FAQ}
|
0 | repos/xmake/xmake/templates/cuda | repos/xmake/xmake/templates/cuda/console/template.lua | template("console")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/cuda/console | repos/xmake/xmake/templates/cuda/console/project/xmake.lua | add_rules("mode.debug", "mode.release")
target("${TARGETNAME}")
set_kind("binary")
add_files("src/*.cu")
-- generate SASS code for SM architecture of current host
add_cugencodes("native")
-- generate PTX code for the virtual architecture to guarantee compatibility
add_cugencodes("compute_35")
-- -- generate SASS code for each SM architecture
-- add_cugencodes("sm_35", "sm_37", "sm_50", "sm_52", "sm_60", "sm_61", "sm_70", "sm_75")
-- -- generate PTX code from the highest SM architecture to guarantee forward-compatibility
-- add_cugencodes("compute_75")
${FAQ}
|
0 | repos/xmake/xmake/templates/swift | repos/xmake/xmake/templates/swift/console/template.lua | template("console")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/swift/console | repos/xmake/xmake/templates/swift/console/project/xmake.lua | -- add modes: debug and release
add_rules("mode.debug", "mode.release")
-- add target
target("${TARGETNAME}")
-- set kind
set_kind("binary")
-- add files
add_files("src/*.swift")
${FAQ}
|
0 | repos/xmake/xmake/templates/dlang | repos/xmake/xmake/templates/dlang/shared/template.lua | template("shared")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/dlang/shared | repos/xmake/xmake/templates/dlang/shared/project/xmake.lua | add_rules("mode.debug", "mode.release")
target("${TARGETNAME}")
set_kind("shared")
add_files("src/interfaces.d")
add_includedirs("src", {public = true})
add_rules("utils.symbols.export_list", {symbols = {
"add",
"sub"}})
target("${TARGETNAME}_demo")
set_kind("binary")
add_deps("${TARGETNAME}")
add_files("src/main.d")
${FAQ}
|
0 | repos/xmake/xmake/templates/dlang | repos/xmake/xmake/templates/dlang/static/template.lua | template("static")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/dlang/static | repos/xmake/xmake/templates/dlang/static/project/xmake.lua | add_rules("mode.debug", "mode.release")
target("${TARGETNAME}")
set_kind("static")
add_files("src/interfaces.d")
add_includedirs("src", {public = true})
target("${TARGETNAME}_demo")
set_kind("binary")
add_deps("${TARGETNAME}")
add_files("src/main.d")
${FAQ}
|
0 | repos/xmake/xmake/templates/dlang | repos/xmake/xmake/templates/dlang/console/template.lua | template("console")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/dlang/console | repos/xmake/xmake/templates/dlang/console/project/xmake.lua | add_rules("mode.debug", "mode.release")
target("${TARGETNAME}")
set_kind("binary")
add_files("src/*.d")
${FAQ}
|
0 | repos/xmake/xmake/templates/c++ | repos/xmake/xmake/templates/c++/shared/template.lua | template("shared")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/c++/shared | repos/xmake/xmake/templates/c++/shared/project/xmake.lua | add_rules("mode.debug", "mode.release")
target("foo")
set_kind("shared")
add_files("src/foo.cpp")
target("${TARGETNAME}")
set_kind("binary")
add_deps("foo")
add_files("src/main.cpp")
${FAQ}
|
0 | repos/xmake/xmake/templates/c++/shared/project | repos/xmake/xmake/templates/c++/shared/project/src/foo.h | #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
|
0 | repos/xmake/xmake/templates/c++/shared/project | repos/xmake/xmake/templates/c++/shared/project/src/foo.cpp | #include "foo.h"
int add(int a, int b) {
return a + b;
}
|
0 | repos/xmake/xmake/templates/c++/shared/project | repos/xmake/xmake/templates/c++/shared/project/src/main.cpp | #include "foo.h"
#include <iostream>
int main(int argc, char** argv) {
std::cout << "add(1, 2) = " << add(1, 2) << std::endl;
return 0;
}
|
0 | repos/xmake/xmake/templates/c++ | repos/xmake/xmake/templates/c++/static/template.lua | template("static")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/c++/static | repos/xmake/xmake/templates/c++/static/project/xmake.lua | add_rules("mode.debug", "mode.release")
target("foo")
set_kind("static")
add_files("src/foo.cpp")
target("${TARGETNAME}")
set_kind("binary")
add_deps("foo")
add_files("src/main.cpp")
${FAQ}
|
0 | repos/xmake/xmake/templates/c++/static/project | repos/xmake/xmake/templates/c++/static/project/src/foo.h | #ifdef __cplusplus
extern "C" {
#endif
int add(int a, int b);
#ifdef __cplusplus
}
#endif
|
0 | repos/xmake/xmake/templates/c++/static/project | repos/xmake/xmake/templates/c++/static/project/src/foo.cpp | #include "foo.h"
int add(int a, int b) {
return a + b;
}
|
0 | repos/xmake/xmake/templates/c++/static/project | repos/xmake/xmake/templates/c++/static/project/src/main.cpp | #include "foo.h"
#include <iostream>
int main(int argc, char** argv) {
std::cout << "add(1, 2) = " << add(1, 2) << std::endl;
return 0;
}
|
0 | repos/xmake/xmake/templates/c++ | repos/xmake/xmake/templates/c++/module.binary/template.lua | template("module.binary")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/c++/module.binary | repos/xmake/xmake/templates/c++/module.binary/project/xmake.lua | add_rules("mode.debug", "mode.release")
add_moduledirs("modules")
target("${TARGETNAME}")
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}
|
0 | repos/xmake/xmake/templates/c++/module.binary/project/modules/binary | repos/xmake/xmake/templates/c++/module.binary/project/modules/binary/bar/xmake.lua | 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")
|
0 | repos/xmake/xmake/templates/c++/module.binary/project/modules/binary/bar | repos/xmake/xmake/templates/c++/module.binary/project/modules/binary/bar/src/add.cpp | #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;
}
|
0 | repos/xmake/xmake/templates/c++/module.binary/project/modules/binary/bar | repos/xmake/xmake/templates/c++/module.binary/project/modules/binary/bar/src/sub.cpp | #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;
}
|
0 | repos/xmake/xmake/templates/c++/module.binary/project | repos/xmake/xmake/templates/c++/module.binary/project/src/main.cpp | #include <iostream>
int main(int argc, char** argv) {
std::cout << "hello world!" << std::endl;
return 0;
}
|
0 | repos/xmake/xmake/templates/c++ | repos/xmake/xmake/templates/c++/qt.widgetapp_static/template.lua | template("qt.widgetapp_static")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/c++/qt.widgetapp_static | repos/xmake/xmake/templates/c++/qt.widgetapp_static/project/xmake.lua | add_rules("mode.debug", "mode.release")
includes("@builtin/qt")
target("${TARGETNAME}")
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}
|
0 | repos/xmake/xmake/templates/c++/qt.widgetapp_static/project | repos/xmake/xmake/templates/c++/qt.widgetapp_static/project/src/mainwindow.h | #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
|
0 | repos/xmake/xmake/templates/c++/qt.widgetapp_static/project | repos/xmake/xmake/templates/c++/qt.widgetapp_static/project/src/mainwindow.cpp | #include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
|
0 | repos/xmake/xmake/templates/c++/qt.widgetapp_static/project | repos/xmake/xmake/templates/c++/qt.widgetapp_static/project/src/main.cpp | #include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
|
0 | repos/xmake/xmake/templates/c++ | repos/xmake/xmake/templates/c++/qt.widgetapp/template.lua | template("qt.widgetapp")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/c++/qt.widgetapp | repos/xmake/xmake/templates/c++/qt.widgetapp/project/xmake.lua | add_rules("mode.debug", "mode.release")
target("${TARGETNAME}")
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}
|
0 | repos/xmake/xmake/templates/c++/qt.widgetapp/project | repos/xmake/xmake/templates/c++/qt.widgetapp/project/src/mainwindow.h | #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
|
0 | repos/xmake/xmake/templates/c++/qt.widgetapp/project | repos/xmake/xmake/templates/c++/qt.widgetapp/project/src/mainwindow.cpp | #include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent),
ui(new Ui::MainWindow) {
ui->setupUi(this);
}
MainWindow::~MainWindow() {
delete ui;
}
|
0 | repos/xmake/xmake/templates/c++/qt.widgetapp/project | repos/xmake/xmake/templates/c++/qt.widgetapp/project/src/main.cpp | #include "mainwindow.h"
#include <QApplication>
int main(int argc, char *argv[]) {
QApplication a(argc, argv);
MainWindow w;
w.show();
return a.exec();
}
|
0 | repos/xmake/xmake/templates/c++ | repos/xmake/xmake/templates/c++/console/template.lua | template("console")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/c++/console | repos/xmake/xmake/templates/c++/console/project/xmake.lua | add_rules("mode.debug", "mode.release")
target("${TARGETNAME}")
set_kind("binary")
add_files("src/*.cpp")
${FAQ}
|
0 | repos/xmake/xmake/templates/c++/console/project | repos/xmake/xmake/templates/c++/console/project/src/main.cpp | #include <iostream>
int main(int argc, char** argv) {
std::cout << "hello world!" << std::endl;
return 0;
}
|
0 | repos/xmake/xmake/templates/c++ | repos/xmake/xmake/templates/c++/qt.quickapp/template.lua | template("qt.quickapp")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/c++/qt.quickapp | repos/xmake/xmake/templates/c++/qt.quickapp/project/xmake.lua | add_rules("mode.debug", "mode.release")
target("${TARGETNAME}")
add_rules("qt.quickapp")
add_headerfiles("src/*.h")
add_files("src/*.cpp")
add_files("src/qml.qrc")
${FAQ}
|
0 | repos/xmake/xmake/templates/c++/qt.quickapp/project | repos/xmake/xmake/templates/c++/qt.quickapp/project/src/main.cpp | #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();
}
|
0 | repos/xmake/xmake/templates/c++ | repos/xmake/xmake/templates/c++/qt.quickapp_static/template.lua | template("qt.quickapp_static")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/c++/qt.quickapp_static | repos/xmake/xmake/templates/c++/qt.quickapp_static/project/xmake.lua | add_rules("mode.debug", "mode.release")
includes("@builtin/qt")
target("${TARGETNAME}")
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}
|
0 | repos/xmake/xmake/templates/c++/qt.quickapp_static/project | repos/xmake/xmake/templates/c++/qt.quickapp_static/project/src/main.cpp | #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();
}
|
0 | repos/xmake/xmake/templates/c++ | repos/xmake/xmake/templates/c++/tbox.static/template.lua | template("tbox.static")
add_configfiles("xmake.lua")
add_configfiles("src/_demo/main.cpp")
add_configfiles("src/_demo/xmake.lua")
add_configfiles("src/_library/xmake.lua")
after_create(function (template, opt)
os.mv("src/_library", path.join("src", opt.targetname))
os.mv("src/_demo", path.join("src", opt.targetname .. "_demo"))
end)
|
0 | repos/xmake/xmake/templates/c++/tbox.static | repos/xmake/xmake/templates/c++/tbox.static/project/xmake.lua | set_xmakever("2.3.6")
set_warnings("all", "error")
set_languages("c99", "cxx11")
add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing")
add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing")
add_rules("mode.release", "mode.debug")
add_requires("tbox", {debug = is_mode("debug")})
if is_plat("windows") then
if is_mode("release") then
add_cxflags("-MT")
elseif is_mode("debug") then
add_cxflags("-MTd")
end
add_ldflags("-nodefaultlib:msvcrt.lib")
end
includes("src/${TARGETNAME}", "src/${TARGETNAME}_demo")
${FAQ}
|
0 | repos/xmake/xmake/templates/c++/tbox.static/project/src | repos/xmake/xmake/templates/c++/tbox.static/project/src/_library/interface.cpp | /* //////////////////////////////////////////////////////////////////////////////////////
* includes
*/
#include "interface.h"
/* //////////////////////////////////////////////////////////////////////////////////////
* implementation
*/
tb_int_t add(tb_int_t a, tb_int_t b) {
return a + b;
}
|
0 | repos/xmake/xmake/templates/c++/tbox.static/project/src | repos/xmake/xmake/templates/c++/tbox.static/project/src/_library/interface.h | #ifndef INTERFACE_H
#define INTERFACE_H
/* //////////////////////////////////////////////////////////////////////////////////////
* includes
*/
#include "tbox/tbox.h"
/* //////////////////////////////////////////////////////////////////////////////////////
* extern
*/
__tb_extern_c_enter__
/*! calculate add(a, b)
*
* @param a the first argument
* @param b the second argument
*
* @return the result
*/
tb_int_t add(tb_int_t a, tb_int_t b);
/* //////////////////////////////////////////////////////////////////////////////////////
* extern
*/
__tb_extern_c_leave__
#endif
|
0 | repos/xmake/xmake/templates/c++/tbox.static/project/src | repos/xmake/xmake/templates/c++/tbox.static/project/src/_library/xmake.lua | -- add target
target("${TARGETNAME}")
-- set kind
set_kind("static")
-- add definitions
add_defines("__tb_prefix__=\"${TARGETNAME}\"")
-- add the header files for installing
add_headerfiles("../(${TARGETNAME}/**.h)")
-- add includes directory
add_includedirs("..", {interface = true})
-- add packages
add_packages("tbox")
-- add files
add_files("*.cpp")
|
0 | repos/xmake/xmake/templates/c++/tbox.static/project/src | repos/xmake/xmake/templates/c++/tbox.static/project/src/_demo/main.cpp | /* //////////////////////////////////////////////////////////////////////////////////////
* includes
*/
#include "${TARGETNAME}/interface.h"
/* //////////////////////////////////////////////////////////////////////////////////////
* main
*/
tb_int_t main(tb_int_t argc, tb_char_t** argv) {
if (tb_init(tb_null, tb_null)) {
tb_trace_i("hello tbox!");
tb_trace_i("add(1 + 1) = %d", add(1, 1));
tb_exit();
}
return 0;
}
|
0 | repos/xmake/xmake/templates/c++/tbox.static/project/src | repos/xmake/xmake/templates/c++/tbox.static/project/src/_demo/xmake.lua | target("demo")
set_kind("binary")
add_deps("${TARGETNAME}")
add_defines("__tb_prefix__=\"demo\"")
add_files("*.cpp")
add_packages("tbox")
|
0 | repos/xmake/xmake/templates/c++ | repos/xmake/xmake/templates/c++/tbox.console/template.lua | template("tbox.console")
add_configfiles("xmake.lua")
add_configfiles("src/xmake.lua")
|
0 | repos/xmake/xmake/templates/c++/tbox.console | repos/xmake/xmake/templates/c++/tbox.console/project/xmake.lua | set_xmakever("2.3.6")
set_warnings("all", "error")
set_languages("c99", "cxx11")
add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing")
add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing")
add_rules("mode.release", "mode.debug")
add_requires("tbox", {debug = is_mode("debug")})
if is_plat("windows") then
if is_mode("release") then
add_cxflags("-MT")
elseif is_mode("debug") then
add_cxflags("-MTd")
end
add_ldflags("-nodefaultlib:msvcrt.lib")
end
includes("src")
${FAQ}
|
0 | repos/xmake/xmake/templates/c++/tbox.console/project | repos/xmake/xmake/templates/c++/tbox.console/project/src/main.cpp | /* //////////////////////////////////////////////////////////////////////////////////////
* includes
*/
#include "tbox/tbox.h"
/* //////////////////////////////////////////////////////////////////////////////////////
* main
*/
tb_int_t main(tb_int_t argc, tb_char_t** argv) {
if (tb_init(tb_null, tb_null)) {
tb_trace_i("hello tbox!");
tb_exit();
}
return 0;
}
|
0 | repos/xmake/xmake/templates/c++/tbox.console/project | repos/xmake/xmake/templates/c++/tbox.console/project/src/xmake.lua | -- add target
target("${TARGETNAME}")
-- set kind
set_kind("binary")
-- add definitions
add_defines("__tb_prefix__=\"${TARGETNAME}\"")
-- add packages
add_packages("tbox")
-- add files
add_files("*.cpp")
|
0 | repos/xmake/xmake/templates/c++ | repos/xmake/xmake/templates/c++/qt.static/template.lua | template("qt.static")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/c++/qt.static | repos/xmake/xmake/templates/c++/qt.static/project/xmake.lua | add_rules("mode.debug", "mode.release")
target("${TARGETNAME}")
add_rules("qt.static")
add_headerfiles("src/*.h")
add_files("src/*.cpp")
add_frameworks("QtGui")
${FAQ}
|
0 | repos/xmake/xmake/templates/c++/qt.static/project | repos/xmake/xmake/templates/c++/qt.static/project/src/demo.cpp | #include "demo.h"
QtDemo::QtDemo()
{
}
|
0 | repos/xmake/xmake/templates/c++/qt.static/project | repos/xmake/xmake/templates/c++/qt.static/project/src/demo.h | #ifndef QT_DEMO_H
#define QT_DEMO_H
class QtDemo
{
public:
QtDemo();
};
#endif // QT_DEMO_H
|
0 | repos/xmake/xmake/templates/c++ | repos/xmake/xmake/templates/c++/module.shared/template.lua | template("module.shared")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/c++/module.shared | repos/xmake/xmake/templates/c++/module.shared/project/xmake.lua | add_rules("mode.debug", "mode.release")
add_moduledirs("modules")
target("${TARGETNAME}")
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}
|
0 | repos/xmake/xmake/templates/c++/module.shared/project/modules/shared | repos/xmake/xmake/templates/c++/module.shared/project/modules/shared/foo/xmake.lua | add_rules("mode.debug", "mode.release")
target("foo")
add_rules("module.shared")
add_files("src/foo.cpp")
|
0 | repos/xmake/xmake/templates/c++/module.shared/project/modules/shared/foo | repos/xmake/xmake/templates/c++/module.shared/project/modules/shared/foo/src/foo.cpp | #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;
}
|
0 | repos/xmake/xmake/templates/c++/module.shared/project | repos/xmake/xmake/templates/c++/module.shared/project/src/main.cpp | #include <iostream>
int main(int argc, char** argv) {
std::cout << "hello world!" << std::endl;
return 0;
}
|
0 | repos/xmake/xmake/templates/c++ | repos/xmake/xmake/templates/c++/qt.shared/template.lua | template("qt.shared")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/c++/qt.shared | repos/xmake/xmake/templates/c++/qt.shared/project/xmake.lua | add_rules("mode.debug", "mode.release")
target("${TARGETNAME}")
add_rules("qt.shared")
add_headerfiles("src/*.h")
add_files("src/*.cpp")
add_defines("QT_DEMO_LIBRARY")
add_frameworks("QtGui")
${FAQ}
|
0 | repos/xmake/xmake/templates/c++/qt.shared/project | repos/xmake/xmake/templates/c++/qt.shared/project/src/demo.cpp | #include "demo.h"
QtDemo::QtDemo()
{
}
|
0 | repos/xmake/xmake/templates/c++/qt.shared/project | repos/xmake/xmake/templates/c++/qt.shared/project/src/demo.h | #ifndef QT_DEMO_H
#define QT_DEMO_H
#include "demo_global.h"
class QT_DEMOSHARED_EXPORT QtDemo
{
public:
QtDemo();
};
#endif // QT_DEMO_H
|
0 | repos/xmake/xmake/templates/c++/qt.shared/project | repos/xmake/xmake/templates/c++/qt.shared/project/src/demo_global.h | #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
|
0 | repos/xmake/xmake/templates/c++ | repos/xmake/xmake/templates/c++/qt.console/template.lua | template("qt.console")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/c++/qt.console | repos/xmake/xmake/templates/c++/qt.console/project/xmake.lua | add_rules("mode.debug", "mode.release")
target("${TARGETNAME}")
add_rules("qt.console")
add_files("src/*.cpp")
${FAQ}
|
0 | repos/xmake/xmake/templates/c++/qt.console/project | repos/xmake/xmake/templates/c++/qt.console/project/src/main.cpp | #include <QCoreApplication>
int main(int argc, char *argv[]) {
QCoreApplication a(argc, argv);
printf("hello xmake\n");
return a.exec();
}
|
0 | repos/xmake/xmake/templates/c++ | repos/xmake/xmake/templates/c++/wxwidgets/template.lua | template("wxwidgets")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/c++/wxwidgets | repos/xmake/xmake/templates/c++/wxwidgets/project/xmake.lua | add_rules("mode.debug", "mode.release")
add_requires("wxwidgets")
target("${TARGETNAME}")
set_kind("binary")
add_files("src/*.cpp")
set_languages("c++14")
add_packages("wxwidgets")
${FAQ} |
0 | repos/xmake/xmake/templates/c++/wxwidgets/project | repos/xmake/xmake/templates/c++/wxwidgets/project/src/main.cpp | #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;
}
};
}
wxIMPLEMENT_APP(Examples::Application); |
0 | repos/xmake/xmake/templates/c++ | repos/xmake/xmake/templates/c++/xmake.cli/template.lua | template("xmake.cli")
add_configfiles("src/lni/main.c")
add_configfiles("xmake.lua")
|
0 | repos/xmake/xmake/templates/c++/xmake.cli | repos/xmake/xmake/templates/c++/xmake.cli/project/xmake.lua | add_rules("mode.debug", "mode.release")
add_requires("libxmake", {debug = is_mode("debug")})
target("${TARGETNAME}")
add_rules("xmake.cli")
add_files("src/lni/*.c")
add_packages("libxmake")
${FAQ} |
0 | repos/xmake/xmake/templates/c++/xmake.cli/project/src | repos/xmake/xmake/templates/c++/xmake.cli/project/src/lni/main.cpp | #include <xmake/xmake.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);
}
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("${TARGETNAME}", argc, argv, taskargv, lni_initalizer);
}
|
0 | repos/xmake/xmake/templates/c++/xmake.cli/project/src | repos/xmake/xmake/templates/c++/xmake.cli/project/src/lua/main.lua | 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
|
0 | repos/xmake/xmake/templates/c++ | repos/xmake/xmake/templates/c++/tbox.shared/template.lua | template("tbox.shared")
add_configfiles("xmake.lua")
add_configfiles("src/_demo/main.cpp")
add_configfiles("src/_demo/xmake.lua")
add_configfiles("src/_library/xmake.lua")
after_create(function (template, opt)
os.mv("src/_library", path.join("src", opt.targetname))
os.mv("src/_demo", path.join("src", opt.targetname .. "_demo"))
end)
|
0 | repos/xmake/xmake/templates/c++/tbox.shared | repos/xmake/xmake/templates/c++/tbox.shared/project/xmake.lua | set_xmakever("2.3.6")
set_warnings("all", "error")
set_languages("c99", "cxx11")
add_cxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing")
add_mxflags("-Wno-error=deprecated-declarations", "-fno-strict-aliasing")
add_rules("mode.release", "mode.debug")
add_requires("tbox", {debug = is_mode("debug")})
if is_plat("windows") then
if is_mode("release") then
add_cxflags("-MT")
elseif is_mode("debug") then
add_cxflags("-MTd")
end
add_ldflags("-nodefaultlib:msvcrt.lib")
end
includes("src/${TARGETNAME}", "src/${TARGETNAME}_demo")
${FAQ}
|
0 | repos/xmake/xmake/templates/c++/tbox.shared/project/src | repos/xmake/xmake/templates/c++/tbox.shared/project/src/_library/interface.cpp | /* //////////////////////////////////////////////////////////////////////////////////////
* includes
*/
#include "interface.h"
/* //////////////////////////////////////////////////////////////////////////////////////
* implementation
*/
tb_int_t add(tb_int_t a, tb_int_t b) {
return a + b;
}
|
0 | repos/xmake/xmake/templates/c++/tbox.shared/project/src | repos/xmake/xmake/templates/c++/tbox.shared/project/src/_library/interface.h | #ifndef INTERFACE_H
#define INTERFACE_H
/* //////////////////////////////////////////////////////////////////////////////////////
* includes
*/
#include "tbox/tbox.h"
/* //////////////////////////////////////////////////////////////////////////////////////
* extern
*/
__tb_extern_c_enter__
/*! calculate add(a, b)
*
* @param a the first argument
* @param b the second argument
*
* @return the result
*/
__tb_export__ tb_int_t add(tb_int_t a, tb_int_t b);
/* //////////////////////////////////////////////////////////////////////////////////////
* extern
*/
__tb_extern_c_leave__
#endif
|
0 | repos/xmake/xmake/templates/c++/tbox.shared/project/src | repos/xmake/xmake/templates/c++/tbox.shared/project/src/_library/xmake.lua | -- add target
target("${TARGETNAME}")
-- set kind
set_kind("shared")
-- add definitions
add_defines("__tb_prefix__=\"${TARGETNAME}\"")
-- add the header files for installing
add_headerfiles("../(${TARGETNAME}/**.h)")
-- add includes directory
add_includedirs("..", {interface = true})
-- add packages
add_packages("tbox")
-- add files
add_files("*.cpp")
|
0 | repos/xmake/xmake/templates/c++/tbox.shared/project/src | repos/xmake/xmake/templates/c++/tbox.shared/project/src/_demo/main.cpp | /* //////////////////////////////////////////////////////////////////////////////////////
* includes
*/
#include "${TARGETNAME}/interface.h"
/* //////////////////////////////////////////////////////////////////////////////////////
* main
*/
tb_int_t main(tb_int_t argc, tb_char_t** argv) {
if (tb_init(tb_null, tb_null)) {
tb_trace_i("hello tbox!");
tb_trace_i("add(1 + 1) = %d", add(1, 1));
tb_exit();
}
return 0;
}
|
0 | repos/xmake/xmake/templates/c++/tbox.shared/project/src | repos/xmake/xmake/templates/c++/tbox.shared/project/src/_demo/xmake.lua | target("demo")
set_kind("binary")
add_deps("${TARGETNAME}")
add_defines("__tb_prefix__=\"demo\"")
add_files("*.cpp")
add_packages("tbox")
|
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.