Fix issues when building with gcc on linux #220
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I was trying to build Dobby with gcc on a linux system and ran into multiple issues.
The first issue is due to the use of
__has_feature
, which is only defined in llvm, and gcc will throw an error when preprocessing that keyword. I got it fixed by defining it to 0 when no defined by the compiler, which is in commit 582a3e9.Then, there are two libraries defined for Darwin only but got accidentally built without checking the platform. This is fixed by adding a if statement to the CMake definition, which is in commit 5e9770d.
The example got a dependency on pthread, but it is not linked by cmake by default (at least not with gcc). I added a dependency in fe2bf6d.
While fixing these, I also noticed the issue reported in #217. This is due to how logging is enabled here:
Dobby/external/logging/logging/logging.h
Lines 147 to 158 in 6f065cf
The
LOG_FUNCTION_IMPL
will only be overidden whenLOGGING_DISABLE
is defined. But it isn't even whenDOBBY_DEBUG
is set toOFF
. This is fixed by the else branch in e8de563