forked from ruslo/hunter
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8fd279a
commit 11085e0
Showing
5 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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 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,34 @@ | ||
# Copyright (c) 2016-2019, Ruslan Baratov | ||
# Copyright (c) 2019, Mathieu-Andre Chiasson | ||
# All rights reserved. | ||
|
||
# !!! DO NOT PLACE HEADER GUARDS HERE !!! | ||
|
||
include(hunter_add_version) | ||
include(hunter_cacheable) | ||
include(hunter_cmake_args) | ||
include(hunter_download) | ||
include(hunter_pick_scheme) | ||
|
||
hunter_add_version( | ||
PACKAGE_NAME | ||
shaderc | ||
VERSION | ||
2019.0-p1 | ||
URL | ||
"https://github.com/cpp-pm/shaderc/archive/v2019.0-p1.tar.gz" | ||
SHA1 | ||
f48923e2d92b0ef1629eaa323918a5c58d69e3c9 | ||
) | ||
|
||
hunter_cmake_args( | ||
shaderc | ||
CMAKE_ARGS | ||
SHADERC_ENABLE_SHARED_CRT=ON # 'ON' means 'do nothing'. Hunter users should control /MD[d] vs /MT[d] via a cmake toolchain files instead. | ||
SHADERC_ENABLE_SPVC=ON # Required for projects such as Google Dawn | ||
SHADERC_SKIP_TESTS=ON | ||
) | ||
|
||
hunter_pick_scheme(DEFAULT url_sha1_cmake) | ||
hunter_cacheable(shaderc) | ||
hunter_download(PACKAGE_NAME shaderc) |
This file contains 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,22 @@ | ||
.. spelling:: | ||
|
||
shaderc | ||
|
||
.. index:: | ||
single: compiler ; shaderc | ||
single: graphics ; shaderc | ||
|
||
.. _pkg.shaderc: | ||
|
||
shaderc | ||
======= | ||
|
||
- `Official <https://github.com/google/shaderc>`__ | ||
- `Hunterized <https://github.com/cpp-pm/shaderc>`__ | ||
- `Example <https://github.com/cpp-pm/hunter/blob/master/examples/shaderc/CMakeLists.txt>`__ | ||
- Added by `Mathieu-Andre Chiasson <https://github.com/mchiasson>`__ (`pr-N <https://github.com/ruslo/hunter/pull/N>`__) | ||
|
||
.. literalinclude:: /../examples/shaderc/CMakeLists.txt | ||
:language: cmake | ||
:start-after: # DOCUMENTATION_START { | ||
:end-before: # DOCUMENTATION_END } |
This file contains 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,18 @@ | ||
# Copyright (c) 2016-2019, Ruslan Baratov | ||
# All rights reserved. | ||
|
||
cmake_minimum_required(VERSION 3.2) | ||
|
||
# Emulate HunterGate: | ||
# * https://github.com/hunter-packages/gate | ||
include("../common.cmake") | ||
|
||
project(download-shaderc) | ||
|
||
# DOCUMENTATION_START { | ||
hunter_add_package(shaderc) | ||
find_package(shaderc CONFIG REQUIRED) | ||
|
||
add_executable(boo boo.cpp) | ||
target_link_libraries(boo PUBLIC shaderc::shaderc) | ||
# DOCUMENTATION_END } |
This file contains 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,9 @@ | ||
#include <shaderc/shaderc.hpp> | ||
#include <cstring> | ||
|
||
int main() { | ||
shaderc::Compiler compiler; | ||
const char* test_program = "void main() {}"; | ||
shaderc::SpvCompilationResult res = compiler.CompileGlslToSpv(test_program, strlen(test_program), shaderc_glsl_vertex_shader, "shader"); | ||
return res.GetCompilationStatus(); | ||
} |