cginternals / glbinding

A C++ binding for the OpenGL API, generated using the gl.xml specification.
https://glbinding.org
MIT License
831 stars 93 forks source link

Missing -lpthread #327

Open yurivict opened 2 years ago

yurivict commented 2 years ago

On FreeBSD 13 version 3.1.0 breaks:

[ 16% 5/6] : && /usr/bin/c++ -O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer -O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer -fstack-protector-strong source/tools/glmeta/CMakeFiles/glmeta.dir/main.cpp.o -o glmeta  -Wl,-rpath,/disk-samsung/freebsd-ports/graphics/glbinding/work/.build:  libglbinding-aux.so.3.1.0  libglbinding.so.3.1.0 && :
FAILED: glmeta 
: && /usr/bin/c++ -O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer -O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer -fstack-protector-strong source/tools/glmeta/CMakeFiles/glmeta.dir/main.cpp.o -o glmeta  -Wl,-rpath,/disk-samsung/freebsd-ports/graphics/glbinding/work/.build:  libglbinding-aux.so.3.1.0  libglbinding.so.3.1.0 && :
ld: error: libglbinding-aux.so.3.1.0: undefined reference to pthread_create [--no-allow-shlib-undefined]
c++: error: linker command failed with exit code 1 (use -v to see invocation)
scheibel commented 2 years ago

Thanks for reporting. It seems as if we need to update our condition when to add pthread to the list of linked libraries (cf. https://github.com/cginternals/glbinding/blob/master/cmake/CompileOptions.cmake#L157). What is the value of CMAKE_SYSTEM_NAME on your system? I assume it should be FreeBSD?

yurivict commented 2 years ago

FreeBSD