Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,14 @@ jobs:
cd $GITHUB_WORKSPACE/build/downstream/sdk ;
$CTEST_EXE --output-on-failure

- name: Test pkg-config --cflags
shell: bash
run: PKG_CONFIG_PATH="$GITHUB_WORKSPACE/install/lib/pkgconfig" pkg-config OpenCL --cflags | grep -q "\-I$GITHUB_WORKSPACE/install/include"

- name: Test pkg-config --libs
shell: bash
run: PKG_CONFIG_PATH="$GITHUB_WORKSPACE/install/lib/pkgconfig" pkg-config OpenCL --libs | grep -q "\-L$GITHUB_WORKSPACE/install/lib -lOpenCL"




Expand Down Expand Up @@ -266,3 +274,11 @@ jobs:
cd $GITHUB_WORKSPACE/build/downstream/sdk;
$CTEST_EXE --output-on-failure -C Release;
$CTEST_EXE --output-on-failure -C Debug;

- name: Test pkg-config --cflags
shell: bash
run: PKG_CONFIG_PATH="$GITHUB_WORKSPACE/install/lib/pkgconfig" pkg-config OpenCL --cflags | grep -q "\-I$GITHUB_WORKSPACE/install/include"

- name: Test pkg-config --libs
shell: bash
run: PKG_CONFIG_PATH="$GITHUB_WORKSPACE/install/lib/pkgconfig" pkg-config OpenCL --libs | grep -q "\-L$GITHUB_WORKSPACE/install/lib -lOpenCL"
10 changes: 9 additions & 1 deletion .github/workflows/macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -93,4 +93,12 @@ jobs:
if: matrix.GEN == 'Ninja Multi-Config'
shell: bash
run: |
cmake --build $GITHUB_WORKSPACE/build --config Release --target install
cmake --build $GITHUB_WORKSPACE/build --config Release --target install

- name: Test pkg-config --cflags
shell: bash
run: PKG_CONFIG_PATH="$GITHUB_WORKSPACE/install/lib/pkgconfig" pkg-config OpenCL --cflags | grep -q "\-I$GITHUB_WORKSPACE/install/include"

- name: Test pkg-config --libs
shell: bash
run: PKG_CONFIG_PATH="$GITHUB_WORKSPACE/install/lib/pkgconfig" pkg-config OpenCL --libs | grep -q "\-L$GITHUB_WORKSPACE/install/lib -lOpenCL"
8 changes: 8 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -211,3 +211,11 @@ install (TARGETS OpenCL
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})

if (NOT MSVC)
configure_file(OpenCL.pc.in OpenCL.pc @ONLY)
set(pkg_config_location ${CMAKE_INSTALL_LIBDIR}/pkgconfig)
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/OpenCL.pc
DESTINATION ${pkg_config_location})
endif()
10 changes: 10 additions & 0 deletions OpenCL.pc.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${exec_prefix}/@CMAKE_INSTALL_LIBDIR@
includedir=${prefix}/@CMAKE_INSTALL_INCLUDEDIR@

Name: OpenCL
Description: Khronos OpenCL ICD Loader
Version: 3.0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirming: It's OK if this version number is different than our SOVERSION?

If so, this is another place that would be great to automate with #182!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirming: It's OK if this version number is different than our SOVERSION?

This mimics what ocl-icd does here: https://github.com/OCL-dev/ocl-icd/blob/master/OpenCL.pc.in where @OPENCL_VERSION@ is currently evaluated to 3.0

If so, this is another place that would be great to automate with #182!

Indeed

Libs: -L${libdir} -lOpenCL
Cflags: -I${includedir}