This commit is contained in:
parent
d9069501b9
commit
04533b5778
4 changed files with 2 additions and 17 deletions
|
|
@ -147,14 +147,6 @@ namespace Crafter {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void AutoDetect() {
|
|
||||||
std::string directoryPath = RunCommand("\"C:\\Program Files (x86)\\Microsoft Visual Studio\\Installer\\vswhere.exe\" -latest -property installationPath");
|
|
||||||
|
|
||||||
directoryPath.pop_back();
|
|
||||||
|
|
||||||
vsVars = std::format("\"{}\\VC\\Auxiliary\\Build\\vcvars64.bat\" > nul", directoryPath);
|
|
||||||
}
|
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
||||||
std::string RunCommand(const std::string_view cmd) {
|
std::string RunCommand(const std::string_view cmd) {
|
||||||
|
|
|
||||||
|
|
@ -458,7 +458,7 @@ namespace Crafter {
|
||||||
|
|
||||||
#if defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_windows_msvc) || defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_w64_mingw32)
|
#if defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_windows_msvc) || defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_w64_mingw32)
|
||||||
system("copy %LIBCXX_DIR%\\lib\\c++.dll \bin\executable-windows-msvc\\c++.dll");
|
system("copy %LIBCXX_DIR%\\lib\\c++.dll \bin\executable-windows-msvc\\c++.dll");
|
||||||
RunClang(std::format("{} && lib.exe {} /OUT:{}.lib", vsVars, files, (binDir/fs::path(outputName)).string()));
|
RunClang(std::format("clang-lib.exe {} /OUT:{}.lib", files, (binDir/fs::path(outputName)).string()));
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
buildResult.errors = RunClang(std::format("{}{} -shared -o {}.so -Wl,-rpath,'$ORIGIN' -fuse-ld=lld", command, files, (binDir/(std::string("lib")+outputName)).string()));
|
buildResult.errors = RunClang(std::format("{}{} -shared -o {}.so -Wl,-rpath,'$ORIGIN' -fuse-ld=lld", command, files, (binDir/(std::string("lib")+outputName)).string()));
|
||||||
|
|
|
||||||
|
|
@ -66,9 +66,6 @@ int main(int argc, char* argv[]) {
|
||||||
projectPath = filepath;
|
projectPath = filepath;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_windows_msvc) || defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_w64_mingw32)
|
|
||||||
AutoDetect();
|
|
||||||
#endif
|
|
||||||
Project project(std::move(projectPath));
|
Project project(std::move(projectPath));
|
||||||
|
|
||||||
if(command == "build") {
|
if(command == "build") {
|
||||||
|
|
|
||||||
|
|
@ -38,10 +38,6 @@ namespace Crafter {
|
||||||
|
|
||||||
export class Project;
|
export class Project;
|
||||||
export class Configuration;
|
export class Configuration;
|
||||||
#if defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_pc_windows_msvc) || defined(CRAFTER_BUILD_CONFIGURATION_TARGET_x86_64_w64_mingw32)
|
|
||||||
export std::string vsVars;
|
|
||||||
export void AutoDetect();
|
|
||||||
#endif
|
|
||||||
export std::string RunCommand(const std::string_view cmd);
|
export std::string RunCommand(const std::string_view cmd);
|
||||||
export void RunCommandIgnore(const std::string_view cmd);
|
export void RunCommandIgnore(const std::string_view cmd);
|
||||||
export std::string RunClang(const std::string_view cmd);
|
export std::string RunClang(const std::string_view cmd);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue