diff options
Diffstat (limited to 'src/tools/wasm-reduce.cpp')
-rw-r--r-- | src/tools/wasm-reduce.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tools/wasm-reduce.cpp b/src/tools/wasm-reduce.cpp index 8923b5eec..ba9f10264 100644 --- a/src/tools/wasm-reduce.cpp +++ b/src/tools/wasm-reduce.cpp @@ -1033,6 +1033,8 @@ struct Reducer int main(int argc, const char* argv[]) { std::string input, test, working, command; + // By default, look for binaries alongside our own binary. + std::string binDir = Path::getDirName(argv[0]); bool binary = true, deNan = false, verbose = false, debugInfo = false, force = false; Options options("wasm-reduce", @@ -1066,7 +1068,7 @@ int main(int argc, const char* argv[]) { Options::Arguments::One, [&](Options* o, const std::string& argument) { // Add separator just in case - Path::setBinaryenBinDir(argument + Path::getPathSeparator()); + binDir = argument + Path::getPathSeparator(); }) .add("--text", "-S", @@ -1121,10 +1123,13 @@ int main(int argc, const char* argv[]) { Colors::setEnabled(false); } + Path::setBinaryenBinDir(binDir); + std::cerr << "|wasm-reduce\n"; std::cerr << "|input: " << input << '\n'; std::cerr << "|test: " << test << '\n'; std::cerr << "|working: " << working << '\n'; + std::cerr << "|bin dir: " << binDir << '\n'; // get the expected output copy_file(input, test); |