-
Notifications
You must be signed in to change notification settings - Fork 165
Added OpenCL.pc file. #190
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 14 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
88d9a3a
Added OpenCL.pc file.
Kerilk 276b236
Updated pkg-config support to only be deacitvated when MSVC is used.
Kerilk f3ffcfe
Update OpenCL.pc.in
Kerilk 88d6914
Add CI for pkg-config for Linux.
Kerilk 34a5955
Added CI for pkg-config for MacOS.
Kerilk 47fcebb
Fix typo.
Kerilk b7afcf4
Add consume pkg-config test for Linux.
Kerilk 72f8e04
Attempt to fix old CMake (ugly...).
Kerilk a30ba05
Revert "Attempt to fix old CMake (ugly...)."
Kerilk 2df9bf0
Attempt fix.
Kerilk d6483fb
Attempt MacOS.
Kerilk 99cb45c
Merge pull request #3 from Kerilk/pkg-config2
Kerilk 344484c
Add hopefully correct pkg-config / CMake integration.
Kerilk 566354f
Update OpenCL.pc.in
Kerilk fdc82ea
Update OpenCL.pc.in
Kerilk 3b1b58a
Add Headers to PKG_CONFIG_PATH and remove symlink to headers.
Kerilk File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,10 @@ | ||
| prefix=@CMAKE_INSTALL_PREFIX@ | ||
| exec_prefix=${prefix} | ||
| libdir=@OPENCL_LIBDIR_PC@ | ||
|
|
||
| Name: OpenCL | ||
| Description: Khronos OpenCL ICD Loader | ||
| Requires: OpenCL-Headers | ||
| Version: 3.0 | ||
| Libs: -L${libdir} -lOpenCL | ||
| Cflags: -I${includedir} | ||
Kerilk marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| # This module provides function for joining paths | ||
| # known from from most languages | ||
| # | ||
| # Original license: | ||
| # SPDX-License-Identifier: (MIT OR CC0-1.0) | ||
| # Explicit permission given to distribute this module under | ||
| # the terms of the project as described in /LICENSE.rst. | ||
| # Copyright 2020 Jan Tojnar | ||
| # https://github.com/jtojnar/cmake-snips | ||
| # | ||
| # Modelled after Python’s os.path.join | ||
| # https://docs.python.org/3.7/library/os.path.html#os.path.join | ||
| # Windows not supported | ||
| function(join_paths joined_path first_path_segment) | ||
| set(temp_path "${first_path_segment}") | ||
| foreach(current_segment IN LISTS ARGN) | ||
| if(NOT ("${current_segment}" STREQUAL "")) | ||
| if(IS_ABSOLUTE "${current_segment}") | ||
| set(temp_path "${current_segment}") | ||
| else() | ||
| set(temp_path "${temp_path}/${current_segment}") | ||
| endif() | ||
| endif() | ||
| endforeach() | ||
| set(${joined_path} "${temp_path}" PARENT_SCOPE) | ||
| endfunction() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| cmake_minimum_required(VERSION 3.1) | ||
| find_package(PkgConfig REQUIRED) | ||
|
|
||
| project(PkgConfigTest | ||
| LANGUAGES C | ||
| ) | ||
|
|
||
| pkg_check_modules(OPENCL REQUIRED OpenCL) | ||
|
|
||
| if(CMAKE_VERSION VERSION_LESS 3.12) | ||
| link_directories("${OPENCL_LIBRARY_DIRS}") | ||
| endif() | ||
|
|
||
| add_executable(${PROJECT_NAME} | ||
| ../pkgconfig.c | ||
| ) | ||
|
|
||
| target_include_directories(${PROJECT_NAME} | ||
| PRIVATE | ||
| ${OPENCL_INCLUDE_DIRS} | ||
| ) | ||
|
|
||
| if(CMAKE_VERSION VERSION_LESS 3.12) | ||
| target_link_libraries(${PROJECT_NAME} | ||
| PRIVATE | ||
| ${OPENCL_LIBRARIES} | ||
| ) | ||
| else() | ||
| target_link_libraries(${PROJECT_NAME} | ||
| PRIVATE | ||
| ${OPENCL_LINK_LIBRARIES} | ||
| ) | ||
| endif() | ||
|
|
||
| target_compile_options(${PROJECT_NAME} | ||
| PRIVATE | ||
| ${OPENCL_CFLAGS_OTHER} | ||
| ) | ||
|
|
||
| target_compile_definitions(${PROJECT_NAME} | ||
| PRIVATE | ||
| CL_TARGET_OPENCL_VERSION=120 | ||
| ) | ||
|
|
||
| include(CTest) | ||
|
|
||
| add_test( | ||
| NAME ${PROJECT_NAME} | ||
| COMMAND ${PROJECT_NAME} | ||
| ) | ||
|
|
||
| set_tests_properties(${PROJECT_NAME} | ||
| PROPERTIES | ||
| ENVIRONMENT "OCL_ICD_FILENAMES=${DRIVER_STUB_PATH}" | ||
| ) |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
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!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This mimics what
ocl-icddoes here: https://github.com/OCL-dev/ocl-icd/blob/master/OpenCL.pc.in where @OPENCL_VERSION@ is currently evaluated to3.0Indeed