refactor: drop Windows host support
crafter-build is moving to a single Flatpak distribution, and there is no Windows host in that picture: no build.cmd, no MSVC or mingw host build, no DLL plus launcher. Delete every host-Windows path instead of leaving it to rot unverified: the cmd.exe command runner and quoting, the LOCALAPPDATA cache, the MSVC and mingw-host LoadProject variants with their LIBCXX_DIR and CRAFTER_MINGW_DIR plumbing, the winsock port probe, the LoadLibrary libclang loader, the console-width and isatty shims, and the preprocessor guards around the Linux bodies. The x86_64-w64-mingw32 cross-compile target stays. It is target logic (output names, -femulated-tls, the libstdc++ link extras, copying a dependency DLL next to a mingw exe, wine as the runner) and did not depend on any of the removed code. The msvc target goes with the host that was the only thing able to use it. Three target-path warts fixed on the way: ExpectedOutput named a mingw static library <name>.lib while the archive step wrote lib<name>.a, so those libraries relinked on every run; the import lib is no longer copied next to a mingw exe, since the dependency's own bin dir is already on the link line; and llvm-ar now writes every archive, not only the LTO ones, so Debug and Release archives are made the same way. CRAFTER_API and Crafter.Build-Api.h existed only for the DLL boundary. Nothing downstream used them, so they are removed rather than kept as an empty macro nobody can verify. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
f60ba809b5
commit
46082a3117
24 changed files with 138 additions and 1053 deletions
|
|
@ -4,18 +4,8 @@
|
|||
module;
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#if defined(_WIN32)
|
||||
#include <io.h>
|
||||
#include <windows.h>
|
||||
#ifndef STDOUT_FILENO
|
||||
#define STDOUT_FILENO _fileno(stdout)
|
||||
#endif
|
||||
#define CRAFTER_PROGRESS_ISATTY _isatty
|
||||
#else
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
#define CRAFTER_PROGRESS_ISATTY isatty
|
||||
#endif
|
||||
#include <unistd.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
export module Crafter.Build:Progress_impl;
|
||||
import std;
|
||||
|
|
@ -32,19 +22,10 @@ namespace {
|
|||
std::chrono::steady_clock::time_point StartTime = std::chrono::steady_clock::now();
|
||||
|
||||
std::int32_t TerminalWidth() {
|
||||
#if defined(_WIN32)
|
||||
HANDLE h = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||
CONSOLE_SCREEN_BUFFER_INFO info;
|
||||
if (h != INVALID_HANDLE_VALUE && GetConsoleScreenBufferInfo(h, &info)) {
|
||||
std::int32_t w = info.srWindow.Right - info.srWindow.Left + 1;
|
||||
if (w > 0) return w;
|
||||
}
|
||||
#else
|
||||
winsize ws{};
|
||||
if (ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws) == 0 && ws.ws_col > 0) {
|
||||
return ws.ws_col;
|
||||
}
|
||||
#endif
|
||||
if (const char* col = std::getenv("COLUMNS")) {
|
||||
try { std::int32_t c = std::stoi(col); if (c > 0) return c; } catch (...) {}
|
||||
}
|
||||
|
|
@ -86,7 +67,7 @@ namespace Crafter::Progress {
|
|||
void SetVerbosity(Verbosity v) {
|
||||
std::lock_guard lock(StateMutex);
|
||||
ActiveVerbosity = v;
|
||||
IsTty = CRAFTER_PROGRESS_ISATTY(STDOUT_FILENO) != 0;
|
||||
IsTty = isatty(STDOUT_FILENO) != 0;
|
||||
StartTime = std::chrono::steady_clock::now();
|
||||
Total.store(0);
|
||||
Done.store(0);
|
||||
|
|
|
|||
Loading…
Reference in a new issue