diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 00000000..66faa4d1 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,72 @@ +linux: &linux + os: linux + dist: xenial + language: python + python: "3.7" + services: + - docker +osx: &osx + os: osx + language: generic +matrix: + include: + - <<: *linux + env: CONAN_GCC_VERSIONS=4.9 CONAN_ARCHS=armv7hf CONAN_DOCKER_IMAGE=conanio/gcc49-armv7hf + - <<: *linux + env: CONAN_GCC_VERSIONS=5 CONAN_ARCHS=armv7hf CONAN_DOCKER_IMAGE=conanio/gcc5-armv7hf + - <<: *linux + env: CONAN_GCC_VERSIONS=6 CONAN_ARCHS=armv7hf CONAN_DOCKER_IMAGE=conanio/gcc6-armv7hf + - <<: *linux + env: CONAN_GCC_VERSIONS=7 CONAN_ARCHS=armv7hf CONAN_DOCKER_IMAGE=conanio/gcc7-armv7hf + - <<: *linux + env: CONAN_GCC_VERSIONS=8 CONAN_ARCHS=armv7hf CONAN_DOCKER_IMAGE=conanio/gcc8-armv7hf + - <<: *linux + env: CONAN_GCC_VERSIONS=5 CONAN_ARCHS=armv8 CONAN_DOCKER_IMAGE=conanio/gcc5-armv8 + - <<: *linux + env: CONAN_GCC_VERSIONS=6 CONAN_ARCHS=armv8 CONAN_DOCKER_IMAGE=conanio/gcc6-armv8 + - <<: *linux + env: CONAN_GCC_VERSIONS=7 CONAN_ARCHS=armv8 CONAN_DOCKER_IMAGE=conanio/gcc7-armv8 + - <<: *linux + env: CONAN_GCC_VERSIONS=8 CONAN_ARCHS=armv8 CONAN_DOCKER_IMAGE=conanio/gcc8-armv8 + - <<: *linux + env: CONAN_GCC_VERSIONS=4.9 CONAN_DOCKER_IMAGE=conanio/gcc49 + - <<: *linux + env: CONAN_GCC_VERSIONS=5 CONAN_DOCKER_IMAGE=conanio/gcc5 + - <<: *linux + env: CONAN_GCC_VERSIONS=6 CONAN_DOCKER_IMAGE=conanio/gcc6 + - <<: *linux + env: CONAN_GCC_VERSIONS=7 CONAN_DOCKER_IMAGE=conanio/gcc7 + - <<: *linux + env: CONAN_GCC_VERSIONS=8 CONAN_DOCKER_IMAGE=conanio/gcc8 + - <<: *linux + env: CONAN_CLANG_VERSIONS=3.9 CONAN_DOCKER_IMAGE=conanio/clang39 + - <<: *linux + env: CONAN_CLANG_VERSIONS=4.0 CONAN_DOCKER_IMAGE=conanio/clang40 + - <<: *linux + env: CONAN_CLANG_VERSIONS=5.0 CONAN_DOCKER_IMAGE=conanio/clang50 + - <<: *linux + env: CONAN_CLANG_VERSIONS=6.0 CONAN_DOCKER_IMAGE=conanio/clang60 + - <<: *linux + env: CONAN_CLANG_VERSIONS=7.0 CONAN_DOCKER_IMAGE=conanio/clang7 + - <<: *linux + env: CONAN_CLANG_VERSIONS=8 CONAN_DOCKER_IMAGE=conanio/clang8 + - <<: *osx + osx_image: xcode8.3 + env: CONAN_APPLE_CLANG_VERSIONS=8.1 + - <<: *osx + osx_image: xcode9 + env: CONAN_APPLE_CLANG_VERSIONS=9.0 + - <<: *osx + osx_image: xcode9.4 + env: CONAN_APPLE_CLANG_VERSIONS=9.1 + - <<: *osx + osx_image: xcode10.1 + env: CONAN_APPLE_CLANG_VERSIONS=10.0 + +install: + - chmod +x .travis/install.sh + - ./.travis/install.sh + +script: + - chmod +x .travis/run.sh + - ./.travis/run.sh diff --git a/.travis/install.sh b/.travis/install.sh new file mode 100644 index 00000000..37f69269 --- /dev/null +++ b/.travis/install.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +set -e +set -x + +if [[ "$(uname -s)" == 'Darwin' ]]; then + brew update || brew update + brew outdated pyenv || brew upgrade pyenv + brew install pyenv-virtualenv + brew install cmake || brew upgrade cmake || true + + if which pyenv > /dev/null; then + eval "$(pyenv init -)" + fi + + pyenv install 3.7.1 + pyenv virtualenv 3.7.1 conan + pyenv rehash + pyenv activate conan +fi + +pip install conan --upgrade +pip install conan_package_tools + +conan user diff --git a/.travis/run.sh b/.travis/run.sh new file mode 100644 index 00000000..0a3488ee --- /dev/null +++ b/.travis/run.sh @@ -0,0 +1,13 @@ +#!/bin/bash + +set -e +set -x + +if [[ "$(uname -s)" == 'Darwin' ]]; then + if which pyenv > /dev/null; then + eval "$(pyenv init -)" + fi + pyenv activate conan +fi + +python build.py diff --git a/CMakeLists.txt b/CMakeLists.txt index 4ecede47..62b5e790 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,6 +33,11 @@ find_package (Threads REQUIRED) # advance. Use it with discretion. option (BUILD_SHARED_LIBS "Build shared libs" ON) +if(EXISTS ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) + include(${CMAKE_BINARY_DIR}/conanbuildinfo.cmake) + conan_basic_setup() +endif() + set (OPENCL_ICD_LOADER_SOURCES loader/icd.c loader/icd_dispatch.c) diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 00000000..14be8314 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,55 @@ +build: false + +environment: + PYTHON: "C:\\Python37" + + matrix: + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + CONAN_VISUAL_VERSIONS: 12 + CONAN_BUILD_TYPES: Release + CONAN_ARCHS: x86_64 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + CONAN_VISUAL_VERSIONS: 12 + CONAN_BUILD_TYPES: Debug + CONAN_ARCHS: x86 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + CONAN_VISUAL_VERSIONS: 14 + CONAN_BUILD_TYPES: Release + CONAN_ARCHS: x86_64 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + CONAN_VISUAL_VERSIONS: 14 + CONAN_BUILD_TYPES: Release + CONAN_ARCHS: x86 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + CONAN_VISUAL_VERSIONS: 14 + CONAN_BUILD_TYPES: Debug + CONAN_ARCHS: x86_64 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2015 + CONAN_VISUAL_VERSIONS: 14 + CONAN_BUILD_TYPES: Debug + CONAN_ARCHS: x86 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + CONAN_VISUAL_VERSIONS: 15 + CONAN_BUILD_TYPES: Release + CONAN_ARCHS: x86_64 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + CONAN_VISUAL_VERSIONS: 15 + CONAN_BUILD_TYPES: Release + CONAN_ARCHS: x86 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + CONAN_VISUAL_VERSIONS: 15 + CONAN_BUILD_TYPES: Debug + CONAN_ARCHS: x86_64 + - APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 + CONAN_VISUAL_VERSIONS: 15 + CONAN_BUILD_TYPES: Debug + CONAN_ARCHS: x86_64 + +install: + - set PATH=%PYTHON_HOME%;%PYTHON_HOME%/Scripts/;%PATH% + - pip.exe install conan --upgrade + - pip.exe install conan_package_tools + - conan user # It creates the conan data directory + +test_script: +- python build.py diff --git a/build.py b/build.py new file mode 100644 index 00000000..d535b23c --- /dev/null +++ b/build.py @@ -0,0 +1,11 @@ +from cpt.packager import ConanMultiPackager +import datetime + +if __name__ == "__main__": + builder = ConanMultiPackager( + username="khronos", + login_username="khronos", + channel="stable" + ) + builder.add_common_builds() + builder.run() diff --git a/conanfile.py b/conanfile.py new file mode 100644 index 00000000..9adaa522 --- /dev/null +++ b/conanfile.py @@ -0,0 +1,47 @@ +from conans import ConanFile, CMake, tools +import os +import shutil + + +class KhronosopenclicdloaderConan(ConanFile): + name = "khronos-opencl-icd-loader" + version = "20190508" + license = "Apache-2.0" + author = "Khronos Group