Closed Kyle-Falconer closed 5 years ago
Interesting, which version of Clang (or Xcode) are you using? It looks like some more warnings were added that didn't exist in older versions. I'll take a look later today
Same thing here, although I didn't touch the 3rd_party lib.
MacOS High Sierra (not Mojave), thus Xcode is Version 10.1 (10B61).
> clang --version
Apple LLVM version 10.0.0 (clang-1000.11.45.5)
Target: x86_64-apple-darwin17.7.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
> brew info llvm
llvm: stable 8.0.0 (bottled), HEAD [keg-only]
Next-gen compiler infrastructure
https://llvm.org/
/usr/local/Cellar/llvm/8.0.0_1 (6,807 files, 3.4GB)
Can I silence/ignore the extra-semi-stmt
?
Can I silence/ignore the extra-semi-stmt?
Yeah, my solution would be to add that warning to the list of ignored warnings in the top-level CMake
file (see here ). Any warnings that only occur in 3rd-party code can also be disabled in src/base/warnings.hpp
.
The "defaulted constructor deleted" sounds more like I should fix it in the code itself
When I fixed the constructor issue and semicolons, the build did complete.
However, I also had issues unzipping the 4duke.zip (from 3drealms.com) file using macOS. I had to use Windows to extract both files, then copy the extracted files back to my mac.
With all this done, the program was able to run.
Adding -Wextra-semi-stmt
to the src/base/warnings.hpp
helped go past the warning, but another occurred, before reaching 49%, which mentions macOS 10.14 (I'm on 10.13.6).
I'm guessing Mojave is a minimum requirement then.
...
[ 32%] Building CXX object src/CMakeFiles/rigel_core.dir/game_logic/ai/bomber_plane.cpp.o
In file included from /Users/avioli/repos/RigelEngine/src/game_logic/ai/bomber_plane.cpp:19:
/Users/avioli/repos/RigelEngine/src/base/match.hpp:40:10: error: call to unavailable function 'visit': introduced in macOS 10.14
return std::visit(
^~~~~~~~~~
/Users/avioli/repos/RigelEngine/src/game_logic/ai/bomber_plane.cpp:108:9: note: in instantiation of function template
specialization 'rigel::base::match<std::__1::variant<rigel::game_logic::behaviors::BomberPlane::FlyingIn,
rigel::game_logic::behaviors::BomberPlane::DroppingBomb, rigel::game_logic::behaviors::BomberPlane::FlyingOut> &, (lambda at
/Users/avioli/repos/RigelEngine/src/game_logic/ai/bomber_plane.cpp:109:5), (lambda at
/Users/avioli/repos/RigelEngine/src/game_logic/ai/bomber_plane.cpp:129:5), (lambda at
/Users/avioli/repos/RigelEngine/src/game_logic/ai/bomber_plane.cpp:144:5)>' requested here
base::match(mState,
^
/usr/local/Cellar/llvm/8.0.0_1/bin/../include/c++/v1/variant:1535:26: note: candidate function [with _Visitor =
rigel::base::detail::overloaded<(lambda at /Users/avioli/repos/RigelEngine/src/game_logic/ai/bomber_plane.cpp:109:5),
(lambda at /Users/avioli/repos/RigelEngine/src/game_logic/ai/bomber_plane.cpp:129:5), (lambda at
/Users/avioli/repos/RigelEngine/src/game_logic/ai/bomber_plane.cpp:144:5)>, _Vs =
<std::__1::variant<rigel::game_logic::behaviors::BomberPlane::FlyingIn,
rigel::game_logic::behaviors::BomberPlane::DroppingBomb, rigel::game_logic::behaviors::BomberPlane::FlyingOut> &>] has been
explicitly made unavailable
constexpr decltype(auto) visit(_Visitor&& __visitor, _Vs&&... __vs) {
^
1 error generated.
make[2]: *** [src/CMakeFiles/rigel_core.dir/game_logic/ai/bomber_plane.cpp.o] Error 1
make[1]: *** [src/CMakeFiles/rigel_core.dir/all] Error 2
make: *** [all] Error 2
Re unzipping - you can open a terminal in macOS and do unzip 4duke.zip
and it will unzip it just fine.
@avioli
I'm guessing Mojave is a minimum requirement then.
Only if you want to build with Xcode's clang. I was building it successfully on Sierra when using Clang 7.0.0 from Homebrew.
But you need to make sure CMake picks up the right Clang and standard library, by doing the following before you run CMake:
export CC=/usr/local/opt/llvm/bin/clang
export CXX="$CC++"
export CPPFLAGS="-I/usr/local/opt/llvm/include"
export LDFLAGS="-L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib"
Rather than disabling warnings, you should stop using -Werror
in your default build target and leave it for a development build target. If someone is using a different compiler than yours they'll always get one or two warnings that you didn't and they won't be able to build it. I get that you don't want to have warnings in your code, but this is counterproductive.
@AntonioND I disagree, warnings on other compilers are a sign for me that my warning coverage is incomplete, and I'd prefer to know about new warnings so I can either fix my code (like I did in https://github.com/lethal-guitar/RigelEngine/pull/366/commits/998440ded4b93472d3cf5cad467c8a3b9e32ee23) or decide to ignore them.
That being said, I do see that it would be useful to optionally compile without -Werror
. It should be fairly straight-forward to add an option to CMake to do that - I'll look into it.
If you leave the project unattended for a few weeks, GCC or Clang are updated with new warnings, and I try to compile your game with the newest version, I won't be able to do it because of -Werror
. That alone is a good enough reason to not enable it by default.
If there are new warnings, it's great to know it so that they can be fixed. But what if I don't have a GitHub account and I can't report the issue here? What if I have no idea about programming and I just want to play, and I follow your instructions only to see that it doesn't build? There are just to many situations in which this can be a problem. It's better to leave the option disabled by default.
What if I have no idea about programming and I just want to play, and I follow your instructions only to see that it doesn't build?
For that situation, pre-compiled binaries are the solution. I already do that for Windows (see Releases), but still need to do it for Mac and Linux.
Yeah the lack of pre-compiled binaries for macOS is what made me try building it myself.
But you can't easily create Linux binaries that run everywhere.
But you can't easily create Linux binaries that run everywhere.
No, but you can provide one for the most common distros, like Debian and Fedora. It just takes time and a bit of effort to set this up using CI/CD. However, if someone's using Linux, surely they'd be able to follow the instructions needed to compile their own.
Exactly, it is a pain to maintain binaries for different distros, and that's why it should be as easy as possible to build it. -Werror
gets in the way of that.
I'm following the instructions in the readme for macOS and I get the following error about a redundant semicolon in glm:
Once I modify the glm code to fix the issue, I get a new error: