From 1007bd7c2bf2d692ef9a4032b3246271aaf89009 Mon Sep 17 00:00:00 2001 From: Russell Yanofsky Date: Tue, 16 Feb 2021 19:14:38 -0500 Subject: [PATCH] gen.cpp: Check local includes before install includes Fix "make check" if previous incompatible version of libmultiprocess is installed and "make install" hasn't been run yet to update it. Carl Dong reported this issue in https://github.com/chaincodelabs/libmultiprocess/issues/44 and confirmed the fix in https://github.com/chaincodelabs/libmultiprocess/issues/44#issuecomment-781658244 --- src/mp/gen.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mp/gen.cpp b/src/mp/gen.cpp index 4a0c1ccf..36ba16a8 100644 --- a/src/mp/gen.cpp +++ b/src/mp/gen.cpp @@ -598,6 +598,9 @@ int main(int argc, char** argv) auto fs = kj::newDiskFilesystem(); auto cwd = fs->getCurrentPath(); #endif + for (size_t i = 4; i < argc; ++i) { + import_paths.push_back(argv[i]); + } for (const char* path : {CMAKE_INSTALL_PREFIX "/include", capnp_PREFIX "/include"}) { #ifdef HAVE_KJ_FILESYSTEM KJ_IF_MAYBE(dir, fs->getRoot().tryOpenSubdir(cwd.evalNative(path))) { import_paths.emplace_back(path); } @@ -605,9 +608,6 @@ int main(int argc, char** argv) import_paths.emplace_back(path); #endif } - for (size_t i = 4; i < argc; ++i) { - import_paths.push_back(argv[i]); - } Generate(argv[1], argv[2], argv[3], {import_paths.data(), import_paths.size()}); return 0; }