From 2a657bd1a9345643c45a745fc8c42623bd617def Mon Sep 17 00:00:00 2001 From: Zengtudor Date: Tue, 13 Aug 2024 14:03:19 +0800 Subject: [PATCH] update --- .gitignore | 4 ++++ build.bat | 25 +++++++++++++++++++++++++ config.yaml | 7 +++++++ src/main.cpp | 5 +++++ xmake.lua | 3 +++ 5 files changed, 44 insertions(+) create mode 100644 build.bat create mode 100644 config.yaml create mode 100644 src/main.cpp create mode 100644 xmake.lua diff --git a/.gitignore b/.gitignore index e257658..e5107f6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ +/.vscode +/.xmake +/build + # ---> C++ # Prerequisites *.d diff --git a/build.bat b/build.bat new file mode 100644 index 0000000..21bf803 --- /dev/null +++ b/build.bat @@ -0,0 +1,25 @@ +@echo off +setlocal + +rem 设置文件夹路径 +set "folderPath=.\build" + +rem 检查文件夹是否存在 +if not exist "%folderPath%" ( + mkdir "%folderPath%" + echo Folder created: %folderPath% +) else ( + echo Folder already exists: %folderPath% +) + +rem 编译C++文件 +g++ .\src\main.cpp -o "%folderPath%\tmake.exe" -I.\tomlplusplus -O3 + +rem 检查编译是否成功 +if %errorlevel% equ 0 ( + echo Compilation successful. +) else ( + echo Compilation failed with error level %errorlevel%. +) + +endlocal diff --git a/config.yaml b/config.yaml new file mode 100644 index 0000000..37bcb0a --- /dev/null +++ b/config.yaml @@ -0,0 +1,7 @@ +CompileFlags: + Add: + - "-I./tomlplusplus" + - "-O3" +Output: + Directory: ./build + File: tmake.exe diff --git a/src/main.cpp b/src/main.cpp new file mode 100644 index 0000000..c2b58a8 --- /dev/null +++ b/src/main.cpp @@ -0,0 +1,5 @@ +#include "toml.hpp" + +int main(int argc,char *argv[]){ + +} \ No newline at end of file diff --git a/xmake.lua b/xmake.lua new file mode 100644 index 0000000..8e5f4fc --- /dev/null +++ b/xmake.lua @@ -0,0 +1,3 @@ +target("tmake") + add_files("./src/main.cpp") + add_includedirs("./tomlplusplus") \ No newline at end of file