Skip to content

Commit

Permalink
Add glslang (ruslo#1475)
Browse files Browse the repository at this point in the history
  • Loading branch information
jhs67 authored and ruslo committed Jun 15, 2018
1 parent f999b22 commit 7c804a9
Show file tree
Hide file tree
Showing 5 changed files with 84 additions and 0 deletions.
1 change: 1 addition & 0 deletions cmake/configs/default.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,7 @@ hunter_default_version(glm VERSION 0.9.8.5)
hunter_default_version(globjects VERSION 1.1.0-p0)
hunter_default_version(glog VERSION 0.3.5-p2)
hunter_default_version(glproto VERSION 1.4.17)
hunter_default_version(glslang VERSION 7.7.2767-p0)
hunter_default_version(gst_plugins_bad VERSION 1.10.4)
hunter_default_version(gst_plugins_base VERSION 1.10.4)
hunter_default_version(gst_plugins_good VERSION 1.10.4)
Expand Down
40 changes: 40 additions & 0 deletions cmake/projects/glslang/hunter.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Copyright (c) 2016-2018, Ruslan Baratov
# All rights reserved.

# !!! DO NOT PLACE HEADER GUARDS HERE !!!

include(hunter_add_version)
include(hunter_cacheable)
include(hunter_download)
include(hunter_pick_scheme)
include(hunter_cmake_args)

hunter_add_version(
PACKAGE_NAME
glslang
VERSION
7.7.2767-p0
URL
"https://github.com/hunter-packages/glslang/archive/v7.7.2767-p0.tar.gz"
SHA1
44d6157e5bf6005f1f611bcea323488e6268d9c9
)

if(IOS)
hunter_cmake_args(
glslang
CMAKE_ARGS
ENABLE_HLSL=OFF
ENABLE_GLSLANG_BINARIES=OFF
)
else()
hunter_cmake_args(
glslang
CMAKE_ARGS
ENABLE_HLSL=OFF
)
endif()

hunter_pick_scheme(DEFAULT url_sha1_cmake)
hunter_cacheable(glslang)
hunter_download(PACKAGE_NAME glslang)
21 changes: 21 additions & 0 deletions docs/packages/pkg/glslang.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
.. spelling::

glslang

.. index::
single: graphics ; glslang

.. _pkg.glslang:

glslang
=======

- `Official <https://github.com/KhronosGroup/glslang>`__
- `Hunterized <https://github.com/hunter-packages/glslang>`__
- `Example <https://github.com/ruslo/hunter/blob/master/examples/glslang/CMakeLists.txt>`__
- Added by `Jon Spencer <https://github.com/jhs67>`__ (`pr-1475 <https://github.com/ruslo/hunter/pull/1475>`__)

.. literalinclude:: /../examples/glslang/CMakeLists.txt
:language: cmake
:start-after: # DOCUMENTATION_START {
:end-before: # DOCUMENTATION_END }
18 changes: 18 additions & 0 deletions examples/glslang/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2016-2018, Ruslan Baratov
# All rights reserved.

cmake_minimum_required(VERSION 3.0)

# Emulate HunterGate:
# * https://github.com/hunter-packages/gate
include("../common.cmake")

project(download-glslang)

# DOCUMENTATION_START {
hunter_add_package(glslang)
find_package(glslang CONFIG REQUIRED)

add_executable(boo boo.cpp)
target_link_libraries(boo PUBLIC glslang::glslang)
# DOCUMENTATION_END }
4 changes: 4 additions & 0 deletions examples/glslang/boo.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#include <glslang/Public/ShaderLang.h>

int main() {
}

0 comments on commit 7c804a9

Please sign in to comment.