Snapcraft can not build flatbuffers

Hi,

snapcraft can not build flatbuffers, because /root/parts//install/usr/include is not include as isystem

[  9%] Building CXX object src/qt/firebase-cpp-sdk/external/src/flatbuffers-build/CMakeFiles/flatbuffers.dir/src/code_generators.cpp.o
In file included from /root/parts/yabasanshiro/build/src/qt/firebase-cpp-sdk/external/src/flatbuffers/include/flatbuffers/util.h:44:0,
                 from /root/parts/yabasanshiro/build/src/qt/firebase-cpp-sdk/external/src/flatbuffers/include/flatbuffers/flexbuffers.h:24,
                 from /root/parts/yabasanshiro/build/src/qt/firebase-cpp-sdk/external/src/flatbuffers/include/flatbuffers/idl.h:26,
                 from /root/parts/yabasanshiro/build/src/qt/firebase-cpp-sdk/external/src/flatbuffers/include/flatbuffers/code_generators.h:22,
                 from /root/parts/yabasanshiro/build/src/qt/firebase-cpp-sdk/external/src/flatbuffers/src/code_generators.cpp:17:
/root/parts/yabasanshiro/install/usr/include/limits.h:124:3: error: #include_next is a GCC extension [-Werror]
 # include_next <limits.h>
   ^~~~~~~~~~~~
cc1plus: all warnings being treated as errors
src/qt/firebase-cpp-sdk/external/src/flatbuffers-build/CMakeFiles/flatbuffers.dir/build.make:62: recipe for target 'src/qt/firebase-cpp-sdk/external/src/flatbuffers-build/CMakeFiles/flatbuffers.dir/src/code_generators.cpp.o' failed
make[2]: *** [src/qt/firebase-cpp-sdk/external/src/flatbuffers-build/CMakeFiles/flatbuffers.dir/src/code_generators.cpp.o] Error 1
CMakeFiles/Makefile2:603: recipe for target 'src/qt/firebase-cpp-sdk/external/src/flatbuffers-build/CMakeFiles/flatbuffers.dir/all' failed
make[1]: *** [src/qt/firebase-cpp-sdk/external/src/flatbuffers-build/CMakeFiles/flatbuffers.dir/all] Error 2
Makefile:151: recipe for target 'all' failed
make: *** [all] Error 2

snapcraft also cannot build this simple test.cpp.

#include <limits.h>
#include <stdio.h>
int main(){ printf("hello"); return 0;}
/usr/bin/c++ -I/root/parts/yabasanshiro/install/usr/include -Wall -pedantic -Werror test.cpp 
In file included from test.cpp:1:0:
/root/parts/yabasanshiro/install/usr/include/limits.h:124:3: error: #include_next is a GCC extension [-Werror]
 # include_next <limits.h>

when compile param changed from -i to -isystem, it can be build.

/usr/bin/c++ -isystem /root/parts/yabasanshiro/install/usr/include -Wall -pedantic -Werror test.cpp 

But in flatbuffers include param is generated by cmake I can not change by hand.

Any help??

my code is https://github.com/devmiyax/yabause/blob/master/snap/snapcraft.yaml

Have you tried the cmake plugin?

The cmake plugin should direct cmake to use the correct include paths. You’re currently using the make plugin instead of cmake.

This should have been fixed (isystem) in the candidate channel for snapcraft which is version 3.11, this version is since today, also on the stable channel

Thank you for your support. it works now.