diff options
author | Jose Quaresma <quaresma.jose@gmail.com> | 2021-02-09 15:55:14 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-09 10:55:14 -0500 |
commit | 8d081127ee28ff5df8123c994c00bc66a57e9e9c (patch) | |
tree | 324837fdfd6960b8bb25f70967a8b784675f323f | |
parent | ac375b4b8f699f26c697fab54348494a9911a7e6 (diff) | |
download | shaderc-8d081127ee28ff5df8123c994c00bc66a57e9e9c.tar.gz |
cmake: add option to skip build the examples (#1170)
Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com>
-rw-r--r-- | CMakeLists.txt | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 5c74cd8..0c8d1ae 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -40,6 +40,16 @@ else() message(STATUS "Configuring Shaderc to avoid building tests.") endif() +option(SHADERC_SKIP_EXAMPLES "Skip building examples" ${SHADERC_SKIP_EXAMPLES}) +if(NOT ${SHADERC_SKIP_EXAMPLES}) + set(SHADERC_ENABLE_EXAMPLES ON) +endif() +if(${SHADERC_ENABLE_EXAMPLES}) + message(STATUS "Configuring Shaderc to build examples.") +else() + message(STATUS "Configuring Shaderc to avoid building examples.") +endif() + option(SHADERC_ENABLE_WERROR_COMPILE "Enable passing -Werror to compiler, if available" ON) set (CMAKE_CXX_STANDARD 11) @@ -107,7 +117,9 @@ add_subdirectory(third_party) add_subdirectory(libshaderc_util) add_subdirectory(libshaderc) add_subdirectory(glslc) -add_subdirectory(examples) +if(${SHADERC_ENABLE_EXAMPLES}) + add_subdirectory(examples) +endif() add_custom_target(build-version ${PYTHON_EXECUTABLE} |