Skip to content

Commit

Permalink
Merge pull request #1504 from sifive/update-wake-format-auto-for-clos…
Browse files Browse the repository at this point in the history
…er-match

Update wake-format's search libdir to match wake's libdir
  • Loading branch information
colinschmidt authored Jan 22, 2024
2 parents b4c1d46 + 034b3e2 commit 238e886
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tools/wake-format/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include <stdio.h>
#include <wcl/doc.h>
#include <wcl/filepath.h>

#include <fstream>
#include <iostream>
Expand All @@ -35,6 +36,7 @@
#include "parser/syntax.h"
#include "parser/wakefiles.h"
#include "util/diagnostic.h"
#include "util/execpath.h"
#include "util/file.h"
#include "wcl/diff.h"
#include "wcl/xoshiro_256.h"
Expand Down Expand Up @@ -199,7 +201,9 @@ int main(int argc, char **argv) {
user_warn = fopen("/dev/null", "w");
if (auto_find_files) {
bool ok = true;
wakefiles = find_all_wakefiles(ok, true, false, ".", ".", user_warn);
// Use the standard libdir to more closely match wake discovery
std::string libdir = wcl::make_canonical(find_execpath() + "/../share/wake/lib");
wakefiles = find_all_wakefiles(ok, true, false, libdir, ".", user_warn);
if (!ok) {
std::cerr << "Failed to automatically discover wake files" << std::endl;
exit(EXIT_FAILURE);
Expand Down

0 comments on commit 238e886

Please sign in to comment.