floooh / sokol

minimal cross-platform standalone C headers
https://floooh.github.io/sokol-html5
zlib License
6.82k stars 475 forks source link

unexpected test build errors in Ubuntu 22.04 #863

Closed parallastra closed 1 year ago

parallastra commented 1 year ago

very new, just getting started with this library, please excuse my lack of understanding, but getting unexpected errors when building the tests in Ubuntu 22.04.

In file included from /home/elk/repos/sokol/tests/compile/sokol_app.c:2:
./sokol/tests/compile/../../sokol_app.h:1907:10: error: #error ("sokol_app.h: unknown 3D API selected for Linux, must be SOKOL_GLCORE33, SOKOL_GLES3")
 1907 |         #error("sokol_app.h: unknown 3D API selected for Linux, must be SOKOL_GLCORE33, SOKOL_GLES3")
In file included from /home/elk/repos/sokol/tests/compile/sokol_app.cc:2:
./sokol/tests/compile/../../sokol_app.h:1907:10: error: #error ("sokol_app.h: unknown 3D API selected for Linux, must be SOKOL_GLCORE33, SOKOL_GLES3")
 1907 |         #error("sokol_app.h: unknown 3D API selected for Linux, must be SOKOL_GLCORE33, SOKOL_GLES3")

what is odd is that the tests appear to build and run as expected:

[==========] 315 test cases ran.
[  PASSED  ] 315 tests.

here is my build process

git clone https://github.com/floooh/sokol.git
cd sokol/
mkdir build
cd build
cmake ../tests/
make -i
floooh commented 1 year ago

If you want to run the tests, just use test_linux.sh script, this uses the right configuration options.

cmake configuration for the tests happens via cmake presets (see https://cmake.org/cmake/help/latest/manual/cmake-presets.7.html) which can be found in the CMakePresets.json file.

Note that building the tests won't help much if you want to use the sokol headers in your own projects, for that, see the sokol samples (https://github.com/floooh/sokol-samples), or have a look at the https://github.com/floooh/pacman.c CMakeLists.txt file.

parallastra commented 1 year ago

thanks for helping put the missing piece in place