mirror of
https://github.com/charles-lunarg/vk-bootstrap.git
synced 2024-11-22 07:24:34 +00:00
add cmake options to hide warnings if is not main project
This commit is contained in:
parent
8e61b2d81c
commit
a5036f2368
@ -1,6 +1,7 @@
|
||||
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
|
||||
project(VulkanBootstrap)
|
||||
|
||||
option(VK_BOOTSTRAP_DISABLE_WARNINGS "Enable warnings as errors during compilation" OFF)
|
||||
option(VK_BOOTSTRAP_WERROR "Enable warnings as errors during compilation" OFF)
|
||||
|
||||
add_library(vk-bootstrap-vulkan-headers INTERFACE)
|
||||
@ -42,7 +43,8 @@ else()
|
||||
set(VK_BOOTSTRAP_COMPILER_CLANGPP 0)
|
||||
endif()
|
||||
|
||||
target_compile_options(vk-bootstrap-compiler-warnings
|
||||
if(NOT VK_BOOTSTRAP_DISABLE_WARNINGS)
|
||||
target_compile_options(vk-bootstrap-compiler-warnings
|
||||
INTERFACE
|
||||
$<$<OR:$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>,${VK_BOOTSTRAP_COMPILER_CLANGPP}>:
|
||||
-Wall
|
||||
@ -53,7 +55,7 @@ target_compile_options(vk-bootstrap-compiler-warnings
|
||||
/W4>
|
||||
)
|
||||
|
||||
if(VK_BOOTSTRAP_WERROR)
|
||||
if(VK_BOOTSTRAP_WERROR)
|
||||
target_compile_options(vk-bootstrap-compiler-warnings
|
||||
INTERFACE
|
||||
$<$<OR:$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>,${VK_BOOTSTRAP_COMPILER_CLANGPP}>:
|
||||
@ -61,6 +63,7 @@ if(VK_BOOTSTRAP_WERROR)
|
||||
$<$<CXX_COMPILER_ID:MSVC>:
|
||||
/WX>
|
||||
)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
target_include_directories(vk-bootstrap PUBLIC
|
||||
|
Loading…
Reference in New Issue
Block a user