-
-
Notifications
You must be signed in to change notification settings - Fork 459
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve cmake quality #307
Conversation
rawbby
commented
Jan 27, 2021
•
edited
Loading
edited
- added cmake compile options
- added cmake compile warnings
- raised cmake version to 3.5
- rewritten cmake code to be more idiomatic
- added files manually to improve IDE functionalities
The cmake works fine on my machine. (win 10 - 64bit - MSVC 2019) |
The cmake file looks clean, but there is a significant version bump (2.8 -> 3.16). I would rather not require a newer cmake version if it is not strictly required. Did a quick check on the cmake version on my mac and a few linux VMs: |
3.5.1 is a really old version of cmake in my oppinion. The code should work with lower versions of cmake out of the box, but most projects set a higher cmake version to improve user experience. |
I am not sure whats the problem with apple clang :-( |
(outsider comment) |
@rawbby After a more thorough read of the logs, it seems like you may need to enable C++ 2011 somewhere in the build. I haven't checked if you have or not, though. @SanderMertens Correct me if I am wrong, but I think the C++ API is intended to target the 2011 version. |
My half of a fix is outdated. Sorry for the intrusion. However, there seems to be a missing |
Agreed, Xenial will reach end of life this April, so I'm fine with a version >3.5 if it brings real advantages. I don't care so much about the code of the Flecs cmake file as it's just a write once thing, but if there are real benefits for cmake users I'd be happy to consider. The default on Bionic seems to be 3.10.2 though, and it won't reach end of life until April 2023, so I don't think we should aim higher than 3.10.2 for now. Bionic will still be in use in many places, and upgrading cmake on Linux is super annoying: https://askubuntu.com/questions/355565/how-do-i-install-the-latest-version-of-cmake-from-the-command-line Can you list what the improvements are for users would be of upgrading to a newer version? My guess is that the compiler errors are caused because you're either not targeting (at least) C++11 or that you're missing the
A regular build (without all warnings enabled) looks like this:
|
@codylico was right. There was a header file missing in vector.h but that was not the problem. |
So I see things like the below, which made me guess that for some reason (compiler options, etc.) Apple Clang isn't handling the macros properly. I have no idea how to fix, though.
|
@SanderMertens can you confirm that building the c++ examples worked for you on a mac os machine? |
All the clang-warnings CI tests are passing. They're not executed on macOS, but the C++ parser is the same. I just tried it with clang (v11.0.3) on my macOS machine and it also compiles. These are the compiler flags that bake uses:
|
@SanderMertens are there any changes you want to be made? From my side the code is fine for now :) |
Looks good! Thanks a lot :) |
Sorry, but I suggest to revert several modifications which have lead to lot of issues while trying to add a recipe of flecs in conan package manager:
|