From 3d66af1c8aeffe76e89612af9667424c2b3117d2 Mon Sep 17 00:00:00 2001 From: AOYAMA Kazuharu Date: Tue, 22 Feb 2022 19:04:32 +0900 Subject: [PATCH] updated search path. --- compiler.cpp | 10 ++++++++++ main.cpp | 3 +++ 2 files changed, 13 insertions(+) diff --git a/compiler.cpp b/compiler.cpp index d66c5f2..7885d68 100644 --- a/compiler.cpp +++ b/compiler.cpp @@ -54,12 +54,22 @@ QString Compiler::cxx() } #endif } else { +#ifdef Q_OS_WIN + QFileInfo fi(compiler); + if (!fi.isAbsolute()) { + compiler = searchPath(compiler); + } +#else // check path compiler = searchPath(compiler); +#endif } if (compiler.isEmpty()) { qCritical() << "Compiler not found." << conf->value("CXX").toString().trimmed(); +#ifdef Q_OS_WIN + qCritical() << "Remember to call vcvarsall.bat to complete environment setup."; +#endif std::exit(1); } diff --git a/main.cpp b/main.cpp index 9a59ec9..88b717e 100644 --- a/main.cpp +++ b/main.cpp @@ -386,6 +386,9 @@ int main(int argv, char *argc[]) return ret; } + // Check compiler + Compiler::cxx(); + int ret = interpreter(); delete conf; return ret;