Switching to python build script.

This commit is contained in:
Ben Vanik
2015-07-31 23:48:24 -07:00
parent 2f1965082c
commit b56b262116
8 changed files with 1006 additions and 799 deletions

View File

@@ -46,12 +46,18 @@ void AttachConsole() {
setvbuf(stderr, nullptr, _IONBF, 0);
}
} // namespace xe
// Used in console mode apps; automatically picked based on subsystem.
int main(int argc, wchar_t* argv[]) {
int Main() {
auto entry_info = xe::GetEntryInfo();
// Convert command line to an argv-like format so we can share code/use
// gflags.
auto command_line = GetCommandLineW();
int argc;
wchar_t** argv = CommandLineToArgvW(command_line, &argc);
if (!argv) {
return 1;
}
google::SetUsageMessage(std::string("usage: ") +
xe::to_string(entry_info.usage));
google::SetVersionString("1.0");
@@ -82,30 +88,23 @@ int main(int argc, wchar_t* argv[]) {
int result = entry_info.entry_point(args);
google::ShutDownCommandLineFlags();
LocalFree(argv);
return result;
}
} // namespace xe
// Used in console mode apps; automatically picked based on subsystem.
int main(int argc_ignored, char** argv_ignored) { return xe::Main(); }
// Used in windowed apps; automatically picked based on subsystem.
int WINAPI wWinMain(HINSTANCE, HINSTANCE, LPWSTR command_line, int) {
// Attach a console so we can write output to stdout. If the user hasn't
// redirected output themselves it'll pop up a window.
xe::AttachConsole();
auto entry_info = xe::GetEntryInfo();
// Convert to an argv-like format so we can share code/use gflags.
std::wstring buffer = entry_info.name + L" " + command_line;
int argc;
wchar_t** argv = CommandLineToArgvW(buffer.c_str(), &argc);
if (!argv) {
return 1;
}
// Run normal entry point.
int result = main(argc, argv);
LocalFree(argv);
return result;
return xe::Main();
}
#if defined _M_IX86