Fix lib-Prefixless OpenCL library linking

This commit is contained in:
BtbN 2022-12-03 01:14:46 +01:00
parent 6eab5153f5
commit ab4299b595

View file

@ -22,7 +22,10 @@ ffbuild_dockerbuild() {
mkdir build && cd build mkdir build && cd build
cmake -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" -DOPENCL_ICD_LOADER_HEADERS_DIR="$FFBUILD_PREFIX"/include -DOPENCL_ICD_LOADER_BUILD_SHARED_LIBS=OFF -DOPENCL_ICD_LOADER_DISABLE_OPENCLON12=ON -DOPENCL_ICD_LOADER_PIC=ON -DOPENCL_ICD_LOADER_BUILD_TESTING=OFF -DBUILD_TESTING=OFF .. cmake -DCMAKE_TOOLCHAIN_FILE="$FFBUILD_CMAKE_TOOLCHAIN" -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="$FFBUILD_PREFIX" \
-DOPENCL_ICD_LOADER_HEADERS_DIR="$FFBUILD_PREFIX"/include -DOPENCL_ICD_LOADER_BUILD_SHARED_LIBS=OFF \
-DOPENCL_ICD_LOADER_DISABLE_OPENCLON12=ON -DOPENCL_ICD_LOADER_PIC=ON \
-DOPENCL_ICD_LOADER_BUILD_TESTING=OFF -DBUILD_TESTING=OFF ..
make -j$(nproc) make -j$(nproc)
make install make install
@ -34,12 +37,13 @@ ffbuild_dockerbuild() {
echo "Name: OpenCL" >> OpenCL.pc echo "Name: OpenCL" >> OpenCL.pc
echo "Description: OpenCL ICD Loader" >> OpenCL.pc echo "Description: OpenCL ICD Loader" >> OpenCL.pc
echo "Version: 9999" >> OpenCL.pc echo "Version: 9999" >> OpenCL.pc
echo "Libs: -L\${libdir} -lOpenCL" >> OpenCL.pc
echo "Cflags: -I\${includedir}" >> OpenCL.pc echo "Cflags: -I\${includedir}" >> OpenCL.pc
if [[ $TARGET == linux* ]]; then if [[ $TARGET == linux* ]]; then
echo "Libs: -L\${libdir} -lOpenCL" >> OpenCL.pc
echo "Libs.private: -ldl" >> OpenCL.pc echo "Libs.private: -ldl" >> OpenCL.pc
elif [[ $TARGET == win* ]]; then elif [[ $TARGET == win* ]]; then
echo "Libs: -L\${libdir} -l:OpenCL.a" >> OpenCL.pc
echo "Libs.private: -lole32 -lshlwapi -lcfgmgr32" >> OpenCL.pc echo "Libs.private: -lole32 -lshlwapi -lcfgmgr32" >> OpenCL.pc
fi fi