This commit is contained in:
parent
69b797c1aa
commit
8df52b4ae7
2 changed files with 45 additions and 11 deletions
22
build.ps1
22
build.ps1
|
|
@ -35,24 +35,24 @@ $vulkanSDKPath = Join-Path -Path $vulkanBasePath -ChildPath (Join-Path -Path $la
|
||||||
|
|
||||||
clang++ -std=c++26 -I"$vulkanSDKPath" -Wno-reserved-identifier -Wno-reserved-module-identifier --precompile .\build/std.cppm -o .\build/std.pcm
|
clang++ -std=c++26 -I"$vulkanSDKPath" -Wno-reserved-identifier -Wno-reserved-module-identifier --precompile .\build/std.cppm -o .\build/std.pcm
|
||||||
clang++ -std=c++26 -I"$vulkanSDKPath" --precompile -fprebuilt-module-path=".\build" interfaces\Crafter.Build-CompileStatus.cppm -o .\build\Crafter.Build-CompileStatus.pcm
|
clang++ -std=c++26 -I"$vulkanSDKPath" --precompile -fprebuilt-module-path=".\build" interfaces\Crafter.Build-CompileStatus.cppm -o .\build\Crafter.Build-CompileStatus.pcm
|
||||||
clang++ -std=c++26 -I"$vulkanSDKPath" --precompile -fprebuilt-module-path=".\build" interfaces\Crafter.Build-Command.cppm -o .\build\Crafter.Build-Command.pcm
|
clang++ -std=c++26 -I"$vulkanSDKPath" --precompile -fprebuilt-module-path=".\build" -D PLATFORM_WINDOWS interfaces\Crafter.Build-Command.cppm -o .\build\Crafter.Build-Command.pcm
|
||||||
clang++ -std=c++26 -I"$vulkanSDKPath" --precompile -fprebuilt-module-path=".\build" interfaces\Crafter.Build-Shader.cppm -o .\build\Crafter.Build-Shader.pcm
|
clang++ -std=c++26 -I"$vulkanSDKPath" --precompile -fprebuilt-module-path=".\build" interfaces\Crafter.Build-Shader.cppm -o .\build\Crafter.Build-Shader.pcm
|
||||||
clang++ -std=c++26 -I"$vulkanSDKPath" --precompile -fprebuilt-module-path=".\build" interfaces\Crafter.Build-Module.cppm -o .\build\Crafter.Build-Module.pcm
|
clang++ -std=c++26 -I"$vulkanSDKPath" --precompile -fprebuilt-module-path=".\build" interfaces\Crafter.Build-Module.cppm -o .\build\Crafter.Build-Module.pcm
|
||||||
clang++ -std=c++26 -I"$vulkanSDKPath" --precompile -fprebuilt-module-path=".\build" interfaces\Crafter.Build-Implementation.cppm -o .\build\Crafter.Build-Implementation.pcm
|
clang++ -std=c++26 -I"$vulkanSDKPath" --precompile -fprebuilt-module-path=".\build" interfaces\Crafter.Build-Implementation.cppm -o .\build\Crafter.Build-Implementation.pcm
|
||||||
clang++ -std=c++26 -I"$vulkanSDKPath" --precompile -fprebuilt-module-path=".\build" interfaces\Crafter.Build-Configuration.cppm -o .\build\Crafter.Build-Configuration.pcm
|
clang++ -std=c++26 -I"$vulkanSDKPath" --precompile -fprebuilt-module-path=".\build" interfaces\Crafter.Build-Configuration.cppm -o .\build\Crafter.Build-Configuration.pcm
|
||||||
clang++ -std=c++26 -I"$vulkanSDKPath" --precompile -fprebuilt-module-path=".\build" interfaces\Crafter.Build-Test.cppm -o .\build\Crafter.Build-Test.pcm
|
clang++ -std=c++26 -I"$vulkanSDKPath" --precompile -fprebuilt-module-path=".\build" interfaces\Crafter.Build-Test.cppm -o .\build\Crafter.Build-Test.pcm
|
||||||
clang++ -std=c++26 -I"$vulkanSDKPath" --precompile -fprebuilt-module-path=".\build" interfaces\Crafter.Build-Project.cppm -o .\build\Crafter.Build-Project.pcm
|
clang++ -std=c++26 -I"$vulkanSDKPath" --precompile -fprebuilt-module-path=".\build" interfaces\Crafter.Build-Project.cppm -o .\build\Crafter.Build-Project.pcm
|
||||||
clang++ -std=c++26 -I"$vulkanSDKPath" --precompile -fprebuilt-module-path=".\build" -D CRAFTER_BUILD_CONFIGURATION_TYPE_EXECUTABLE interfaces\Crafter.Build.cppm -o .\build\Crafter.Build.pcm
|
clang++ -std=c++26 -I"$vulkanSDKPath" --precompile -fprebuilt-module-path=".\build" -D CRAFTER_BUILD_CONFIGURATION_TYPE_EXECUTABLE interfaces\Crafter.Build.cppm -o .\build\Crafter.Build.pcm
|
||||||
|
|
||||||
clang++ -std=c++26 -I"$vulkanSDKPath" -O3 -fprebuilt-module-path=".\build" -c .\build\Crafter.Build-Command.pcm -o .\build\Crafter.Build-Command.o
|
clang++ -std=c++26 -O3 -fprebuilt-module-path=".\build" -c .\build\Crafter.Build-Command.pcm -o .\build\Crafter.Build-Command.o
|
||||||
clang++ -std=c++26 -I"$vulkanSDKPath" -O3 -fprebuilt-module-path=".\build" -c .\build\Crafter.Build-Shader.pcm -o .\build\Crafter.Build-Shader.o
|
clang++ -std=c++26 -O3 -fprebuilt-module-path=".\build" -c .\build\Crafter.Build-Shader.pcm -o .\build\Crafter.Build-Shader.o
|
||||||
clang++ -std=c++26 -I"$vulkanSDKPath" -O3 -fprebuilt-module-path=".\build" -c .\build\Crafter.Build-Module.pcm -o .\build\Crafter.Build-Module.o
|
clang++ -std=c++26 -O3 -fprebuilt-module-path=".\build" -c .\build\Crafter.Build-Module.pcm -o .\build\Crafter.Build-Module.o
|
||||||
clang++ -std=c++26 -I"$vulkanSDKPath" -O3 -fprebuilt-module-path=".\build" -c .\build\Crafter.Build-Implementation.pcm -o .\build\Crafter.Build-Implementation.o
|
clang++ -std=c++26 -O3 -fprebuilt-module-path=".\build" -c .\build\Crafter.Build-Implementation.pcm -o .\build\Crafter.Build-Implementation.o
|
||||||
clang++ -std=c++26 -I"$vulkanSDKPath" -O3 -fprebuilt-module-path=".\build" -c .\build\Crafter.Build-Configuration.pcm -o .\build\Crafter.Build-Configuration.o
|
clang++ -std=c++26 -O3 -fprebuilt-module-path=".\build" -c .\build\Crafter.Build-Configuration.pcm -o .\build\Crafter.Build-Configuration.o
|
||||||
clang++ -std=c++26 -I"$vulkanSDKPath" -O3 -fprebuilt-module-path=".\build" -c .\build\Crafter.Build-Project.pcm -o .\build\Crafter.Build-Project.o
|
clang++ -std=c++26 -O3 -fprebuilt-module-path=".\build" -c .\build\Crafter.Build-Project.pcm -o .\build\Crafter.Build-Project.o
|
||||||
clang++ -std=c++26 -I"$vulkanSDKPath" -O3 -fprebuilt-module-path=".\build" -c .\build\Crafter.Build-Test.pcm -o .\build\Crafter.Build-Test.o
|
clang++ -std=c++26 -O3 -fprebuilt-module-path=".\build" -c .\build\Crafter.Build-Test.pcm -o .\build\Crafter.Build-Test.o
|
||||||
clang++ -std=c++26 -I"$vulkanSDKPath" -O3 -fprebuilt-module-path=".\build" -c .\build\Crafter.Build-CompileStatus.pcm -o .\build\Crafter.Build-CompileStatus.o
|
clang++ -std=c++26 -O3 -fprebuilt-module-path=".\build" -c .\build\Crafter.Build-CompileStatus.pcm -o .\build\Crafter.Build-CompileStatus.o
|
||||||
clang++ -std=c++26 -I"$vulkanSDKPath" -O3 -fprebuilt-module-path=".\build" -c .\build\Crafter.Build.pcm -o .\build\Crafter.Build.o
|
clang++ -std=c++26 -O3 -fprebuilt-module-path=".\build" -c .\build\Crafter.Build.pcm -o .\build\Crafter.Build.o
|
||||||
|
|
||||||
clang++ -std=c++26 -I"$vulkanSDKPath" -O3 -fprebuilt-module-path=".\build" -c .\implementations\Crafter.Build-Command.cpp -o .\build\Crafter.Build-Command_impl.o
|
clang++ -std=c++26 -I"$vulkanSDKPath" -O3 -fprebuilt-module-path=".\build" -c .\implementations\Crafter.Build-Command.cpp -o .\build\Crafter.Build-Command_impl.o
|
||||||
clang++ -std=c++26 -I"$vulkanSDKPath" -O3 -fprebuilt-module-path=".\build" -c .\implementations\Crafter.Build-Test.cpp -o .\build\Crafter.Build-Test_impl.o
|
clang++ -std=c++26 -I"$vulkanSDKPath" -O3 -fprebuilt-module-path=".\build" -c .\implementations\Crafter.Build-Test.cpp -o .\build\Crafter.Build-Test_impl.o
|
||||||
|
|
|
||||||
|
|
@ -19,12 +19,16 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||||
|
|
||||||
module;
|
module;
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#ifdef PLATFORM_WINDOWS
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
module Crafter.Build:Command_impl;
|
module Crafter.Build:Command_impl;
|
||||||
import :Command;
|
import :Command;
|
||||||
import std;
|
import std;
|
||||||
|
|
||||||
|
|
||||||
namespace Crafter {
|
namespace Crafter {
|
||||||
|
#ifndef PLATFORM_WINDOWS
|
||||||
std::string RunCommand(const std::string_view cmd) {
|
std::string RunCommand(const std::string_view cmd) {
|
||||||
std::array<char, 128> buffer;
|
std::array<char, 128> buffer;
|
||||||
std::string result;
|
std::string result;
|
||||||
|
|
@ -50,6 +54,36 @@ namespace Crafter {
|
||||||
if (!pipe) throw std::runtime_error("popen() failed!");
|
if (!pipe) throw std::runtime_error("popen() failed!");
|
||||||
pclose(pipe);
|
pclose(pipe);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
std::string RunCommand(const std::string_view cmd) {
|
||||||
|
std::array<char, 128> buffer;
|
||||||
|
std::string result;
|
||||||
|
std::string command = "cmd.exe /C " + std::string(cmd) + " 2>&1"; // Redirect stderr to stdout
|
||||||
|
|
||||||
|
// Open pipe to file
|
||||||
|
FILE* pipe = _popen(command.c_str(), "r");
|
||||||
|
if (!pipe) throw std::runtime_error("popen() failed!");
|
||||||
|
|
||||||
|
// Read till end of process:
|
||||||
|
while (fgets(buffer.data(), buffer.size(), pipe) != nullptr) {
|
||||||
|
result += buffer.data();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Close pipe
|
||||||
|
_pclose(pipe);
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
void RunCommandIgnore(const std::string_view cmd) {
|
||||||
|
std::string command = "cmd.exe /C " + std::string(cmd) + " > NUL 2>&1"; // Redirect stdout and stderr to NUL
|
||||||
|
|
||||||
|
// Open pipe to file
|
||||||
|
FILE* pipe = _popen(command.c_str(), "r");
|
||||||
|
if (!pipe) throw std::runtime_error("popen() failed!");
|
||||||
|
_pclose(pipe);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
// CompileException::CompileException(std::vector<CompileError>&& errors) : errors(std::move(errors)) {
|
// CompileException::CompileException(std::vector<CompileError>&& errors) : errors(std::move(errors)) {
|
||||||
// for(CompileError error : errors) {
|
// for(CompileError error : errors) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue