A user reports two build issues on OS X. An outdate SDL version and missing reference to math library in
FCollada.
Details
The reporter confirmed that guidance in the ticket addressed his issue with the build. I
independently reproduced the error and verified that guidance in the ticket addresses the issue. T
The FCollada changes should be verified against other OSes.
Diff Detail
- Repository
- rP 0 A.D. Public Repository
- Branch
- trac-6797
- Lint
Lint OK - Unit
No Unit Test Coverage - Build Status
Buildable 22206 Build 54255: arc lint + arc unit
Event Timeline
Thanks for the patch, glad someone who can reproduce the issues picking this up.
Updating sdl is a valid workaround and probably desirable on it's own, still removing the offending -Werror might be preferable or this issue will crop up sooner or later again.
If this is your first contribution you should also add yourself to the contributors file.
libraries/source/fcollada/src/FCollada/FUtils/Platforms.h | ||
---|---|---|
131–132 | isinf isn't used internally, so just removing the definition here should work |
I have tried with headers only but I get `'cmath.h' file not found. An old issue at https://github.com/actions/runner-images/issues/2274 has some pointers but I given comments from @sera, I'll see about removing the definition instead of trying to track this down.
cmath is a C++ library (cstdio, climits, etc), C pair is math.h (stdio.h, limits.h, etc).
Updating sdl is a valid workaround and probably desirable on it's own, still removing the offending -Werror might be preferable or this issue will crop up sooner or later again.
For more context a similar comment is made in the original issue:
SDL adds "-Wdeclaration-after-statement -Werror=declaration-after-statement" to CFLAGS, so it's not about the C standard used but that likely this diagnostic became supported on recent Apple clang (what I suspect is used here) and so now the build fails.
Updating SDL2 certainly isn't bad but sed-ing / patching out all forced Werror should be done anyway.
Do I need to address the above for this patch to be accepted?
If you are comfortable in patching out Werror then go ahead, otherwise the patch LGTM, tho can't test it as I don't have a mac.
Also you should add yourself to binaries/data/mods/public/gui/credits/texts/programming.json
I had this same issue building 0ad.
The patch allows me to build all the necessary libraries, but I am left with the following error when i run update_workspaces.sh.
==== Building zip-lib (release) ==== ==== Building lua-lib (release) ==== ==== Building zlib-lib (release) ==== Creating obj/Release/zlib-lib adler32.c mkstemp.c compress.c ../../contrib/libzip/mkstemp.c:76:8: error: call to undeclared function 'getpid'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] pid = getpid(); ^ 1 error generated. make[1]: *** [obj/Release/zip-lib/mkstemp.o] Error 1 make: *** [zip-lib] Error 2 make: *** Waiting for unfinished jobs.... crc32.c deflate.c gzclose.c gzlib.c gzread.c gzwrite.c infback.c inffast.c inflate.c inftrees.c trees.c uncompr.c zutil.c Linking zlib-lib ERROR: Premake build failed
Yes. I am seeing exactly this as well and I have not figured it out yet. I have opened a new ticket #6847 to track this next issue.
@real_tabasco_sauce I have now resolved this error in https://code.wildfiregames.com/D5093.
- Instead of adding cmath to fix Trac #6797, remove unused isinf definition.
- Added jpshack to contributors file.
Would be good to have Stan's opinion on this, I believe he's the most up-to-date on the Fcollada 'port' that we essentially maintain.
The SDL upgrade looks reasonable to me, but it's one of the more 'dangerous' libraries to upgrade so will need to test this.
I think the Fcollada fix is okay, we could ask the guy maintaining the rdb fork what he thinks about it.
If @vladislavbelov thinks it's okay too I have no objections.
Regarding the SDL is this the minimum working version?
We should check whether they did not add a lot of flags to turn off new features that might interfere with the game. Also work started on SDl3