ImHex
ImHex copied to clipboard
fix: macOS cmake build error
Fixes macOS cmake build error. #910
Hey! Thank you. Did you check if building actually works with AppleClang now? For a very long time it was massively outdated and didn't support half of the features I've been using on other platforms which is why you need to compile everything using gcc
Hi, I tried to compile. make is giving many errors like compiler flag errors and C++20 language feature errors. I removed the compiler flags '-s' strip and some other flags to test.. One last error I am getting is:
In file included from /Users/manoj/Workspace/ImHex/lib/external/pattern_language/lib/source/pl/core/token.cpp:1:
/Users/manoj/Workspace/ImHex/lib/external/pattern_language/lib/include/pl/core/token.hpp:221:32: error: constexpr function's return type 'pl::core::Token' is not a literal type
constexpr inline Token createToken(const core::Token::Type type, const core::Token::ValueTypes &value) {
^
/Users/manoj/Workspace/ImHex/lib/external/pattern_language/lib/include/pl/core/token.hpp:215:20: note: 'Token' is not literal because it has data member 'value' of non-literal type 'pl::core::Token::ValueTypes' (aka 'variant<pl::core::Token::Keyword, pl::core::Token::Identifier, pl::core::Token::Operator, pl::core::Token::Literal, pl::core::Token::ValueType, pl::core::Token::Separator, pl::core::Token::DocComment>')
ValueTypes value;
^
1 error generated.
make[2]: *** [lib/external/pattern_language/lib/CMakeFiles/libpl.dir/source/pl/core/token.cpp.o] Error 1
make[1]: *** [lib/external/pattern_language/lib/CMakeFiles/libpl.dir/all] Error 2
make: *** [all] Error 2
Yeah that's the issues I was talking about. Apple Clang is currently based on LLVM 13 afaik and some of the features I'm using in ImHex require either GCC 12 or later or Clang 15 or later.
I might add support for AppleClang in the future when it caught up a little bit but until then, please use GCC on macOS (you can use the homebrew install script from the /dist folder) to build ImHex