micro-gl icon indicating copy to clipboard operation
micro-gl copied to clipboard

"add_subdirectory(/path/to/microgl)" is not usable

Open Azq2 opened this issue 1 year ago • 4 comments

Please, remove examples from root CMakeLists.txt, because it's broke build process:

example_blocks_3d_raster.cpp:(.text+0x1323): undefined reference to `SDL_Init'
/usr/bin/ld: example_blocks_3d_raster.cpp:(.text+0x1353): undefined reference to `SDL_CreateWindow'
/usr/bin/ld: example_blocks_3d_raster.cpp:(.text+0x1373): undefined reference to `SDL_CreateRenderer'
/usr/bin/ld: example_blocks_3d_raster.cpp:(.text+0x13ac): undefined reference to `SDL_CreateTexture'
/usr/bin/ld: example_blocks_3d_raster.cpp:(.text+0x146e): undefined reference to `SDL_PollEvent'
/usr/bin/ld: example_blocks_3d_raster.cpp:(.text+0x1510): undefined reference to `SDL_UpdateTexture'
/usr/bin/ld: example_blocks_3d_raster.cpp:(.text+0x151c): undefined reference to `SDL_RenderClear'
/usr/bin/ld: example_blocks_3d_raster.cpp:(.text+0x1536): undefined reference to `SDL_RenderCopy'
/usr/bin/ld: example_blocks_3d_raster.cpp:(.text+0x1542): undefined reference to `SDL_RenderPresent'
/usr/bin/ld: example_blocks_3d_raster.cpp:(.text+0x1563): undefined reference to `SDL_DestroyWindow'
/usr/bin/ld: example_blocks_3d_raster.cpp:(.text+0x1568): undefined reference to `SDL_Quit'

Azq2 avatar Nov 03 '23 23:11 Azq2

@Azq2 We actually use it as part of the CI and build testing in the cloud. There might be an issue with this example, i will test it

HendrixString avatar Nov 04 '23 13:11 HendrixString

@Azq2 We actually use it as part of the CI and build testing in the cloud. There might be an issue with this example, i will test it

I use microgl in embedded projects with cross compiling. In my problem find_package() finds SDL2 headers from the host package libsdl2-dev which is for amd64. But I build my project for arm-linux-gnueabi with a "libc only" environment.

Maybe this is more my problem and I should simply turn off pkg-config in cmake. But, I think if(DEFINED SDL2_FOUND) is not enough for skipping tests.

Maybe one of these variants is cleaner for the library users:

  1. Tests are disabled by default, but can be enabled with option.
  2. Tests are enabled by default, but can be disabled with option.

Azq2 avatar Nov 04 '23 22:11 Azq2

Hi @Azq2 I get it. Do you have a proposition ? Maybe adding a flag through cmake to add examples ? I am open to that

HendrixString avatar Nov 06 '23 16:11 HendrixString

  1. Tests are enabled by default, but can be disabled with option.

I prefer with this one, to make sure the micro-gl is usable and reliable.

diamant3 avatar Jun 19 '24 00:06 diamant3