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)
|
cmake_minimum_required(VERSION 3.10 FATAL_ERROR)
|
||||||
project(VulkanBootstrap)
|
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)
|
option(VK_BOOTSTRAP_WERROR "Enable warnings as errors during compilation" OFF)
|
||||||
|
|
||||||
add_library(vk-bootstrap-vulkan-headers INTERFACE)
|
add_library(vk-bootstrap-vulkan-headers INTERFACE)
|
||||||
@ -42,25 +43,27 @@ else()
|
|||||||
set(VK_BOOTSTRAP_COMPILER_CLANGPP 0)
|
set(VK_BOOTSTRAP_COMPILER_CLANGPP 0)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_compile_options(vk-bootstrap-compiler-warnings
|
if(NOT VK_BOOTSTRAP_DISABLE_WARNINGS)
|
||||||
INTERFACE
|
|
||||||
$<$<OR:$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>,${VK_BOOTSTRAP_COMPILER_CLANGPP}>:
|
|
||||||
-Wall
|
|
||||||
-Wextra
|
|
||||||
-Wconversion
|
|
||||||
-Wsign-conversion>
|
|
||||||
$<$<CXX_COMPILER_ID:MSVC>:
|
|
||||||
/W4>
|
|
||||||
)
|
|
||||||
|
|
||||||
if(VK_BOOTSTRAP_WERROR)
|
|
||||||
target_compile_options(vk-bootstrap-compiler-warnings
|
target_compile_options(vk-bootstrap-compiler-warnings
|
||||||
INTERFACE
|
INTERFACE
|
||||||
$<$<OR:$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>,${VK_BOOTSTRAP_COMPILER_CLANGPP}>:
|
$<$<OR:$<CXX_COMPILER_ID:AppleClang>,$<CXX_COMPILER_ID:GNU>,${VK_BOOTSTRAP_COMPILER_CLANGPP}>:
|
||||||
-pedantic-errors>
|
-Wall
|
||||||
|
-Wextra
|
||||||
|
-Wconversion
|
||||||
|
-Wsign-conversion>
|
||||||
$<$<CXX_COMPILER_ID:MSVC>:
|
$<$<CXX_COMPILER_ID:MSVC>:
|
||||||
/WX>
|
/W4>
|
||||||
)
|
)
|
||||||
|
|
||||||
|
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}>:
|
||||||
|
-pedantic-errors>
|
||||||
|
$<$<CXX_COMPILER_ID:MSVC>:
|
||||||
|
/WX>
|
||||||
|
)
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
target_include_directories(vk-bootstrap PUBLIC
|
target_include_directories(vk-bootstrap PUBLIC
|
||||||
|
Loading…
Reference in New Issue
Block a user