ValveSoftware / voglperf

Benchmarking tool for Linux OpenGL games. Spews frame information, logs frametimes.
Other
201 stars 31 forks source link

Fix linking on Gentoo #10

Closed dscharrer closed 10 years ago

dscharrer commented 10 years ago

For the lib32 paths: If you pass -m32 in {C,CXX}FLAGS environment variables or pass it in -DCMAKE_{C,CXX}_FLAGS on the command-line, CMake would automatically detect a 32-bit build and disables searching in lib64 paths. The same is accomplished by setting the FIND_LIBRARY_USE_LIB64_PATHS global property.

However, it still doesn't search in lib32 variants, only the generic lib directories. As lib contains 64-bit libraries on some distributions this will fail.

Curiously, CMake sometimes magically transforms /usr/lib/libfoobar.so paths into -lfoobar before generating the makefile, which will allow the linker to find the correct library. This didn't happen here for me.

There is a CMake bug report with a patch for this but it seems to have been abandoned.