Skip to content

Commit

Permalink
Use fmt/std to format std::path (#543)
Browse files Browse the repository at this point in the history
  • Loading branch information
Moisan authored Aug 24, 2023
1 parent 40e8156 commit 4ef4e43
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions source/citnames/source/semantic/Semantic.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,7 @@
#include "semantic/Semantic.h"

#include <fmt/format.h>

namespace fmt {

template <>
struct formatter<fs::path> : formatter<std::string> {};
}
#include <fmt/std.h>

namespace cs::semantic {

Expand Down

3 comments on commit 4ef4e43

@novusnota
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Moisan @rizsotto Hey, this change causes build problems on Ubuntu 20.04 in WSL: fatal error: fmt/std.h: No such file or directory

Logs:

Scanning dependencies of target wrapper
[ 81%] Building CXX object citnames/CMakeFiles/citnames_a.dir/source/semantic/Semantic.cc.o
[ 83%] Building CXX object intercept/CMakeFiles/wrapper.dir/source/report/wrapper/main.cc.o
[ 84%] Building CXX object citnames/CMakeFiles/citnames_a.dir/source/semantic/ToolAny.cc.o
/home/user/.local/src/Bear/source/citnames/source/semantic/Semantic.cc:23:10: fatal error: fmt/std.h: No such file or directory
   23 | #include <fmt/std.h>
      |          ^~~~~~~~~~~
compilation terminated.
make[5]: *** [citnames/CMakeFiles/citnames_a.dir/build.make:102: citnames/CMakeFiles/citnames_a.dir/source/semantic/Semantic.cc.o] Error 1
make[5]: *** Waiting for unfinished jobs....
[ 84%] Built target intercept_a
[ 86%] Linking CXX executable wrapper
[ 86%] Built target wrapper
make[4]: *** [CMakeFiles/Makefile2:625: citnames/CMakeFiles/citnames_a.dir/all] Error 2
make[3]: *** [Makefile:130: all] Error 2
make[2]: *** [CMakeFiles/BearSource.dir/build.make:115: subprojects/Stamp/BearSource/BearSource-build] Error 2
make[1]: *** [CMakeFiles/Makefile2:182: CMakeFiles/BearSource.dir/all] Error 2
make: *** [Makefile:152: all] Error 2

Commit just prior to this one builds fine ¯\_(ツ)_/¯

@rizsotto
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the fmt library version on your machine @novusnota ?

@novusnota
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rizsotto fmt (GNU coreutils) 8.30. Yeah, seems like Bear didn't build the version 10 from third_party/, but did use local one. My bad then :)

Please sign in to comment.