diff options
author | Kaiyi Li <kaiyili@google.com> | 2021-02-07 10:26:13 -0800 |
---|---|---|
committer | Kaiyi Li <kaiyili@google.com> | 2021-02-09 08:48:07 -0800 |
commit | 1f6758c4fa07fee8ece736eadd59cc311c435df4 (patch) | |
tree | 7b7d2ea27487a6b137951e0039af1bd8834faec5 /CMakeLists.txt | |
parent | 9b3a0d8a960dc9f4926f64d897e4ee18b41362dc (diff) | |
download | vulkan-cereal-1f6758c4fa07fee8ece736eadd59cc311c435df4.tar.gz |
Fix building warnings on Windows
Massively reduce the compile warning on Windows. There should be only 7
warnings I am not sure how to handle.
* 5 warnings are in third_party
* 1 warning is related to our mixed use of C11 and C++ in
gfxstream-generic-apigen which makes clang complain that the '/std:c++17'
compiler argument is not used.
* 1 warning in VkDecoder.cpp. ppObjectTableEntries is used
uninitialized. This file is generated, and I am not familiar with the
codegen enough to fix this warning.
In addition, this fix seems to fix the frame ordering issue for me with
host native Vulkan swapchain.
Test: build on Windows, see only 7 warnings
Change-Id: I45f10d3bacc16df6924610ef84bf42b3ca885111
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r-- | CMakeLists.txt | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 72385b5f..06d38880 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,13 @@ endif() add_compile_definitions(GLM_FORCE_RADIANS) add_compile_definitions(GLM_FORCE_DEFAULT_ALIGNED_GENTYPES) +if (MSVC) + # ask msvc not to warn not secure C ISO functions + add_compile_definitions(_CRT_SECURE_NO_WARNINGS) + # ask msvc not to warn non C ISO POSIX functions + add_compile_definitions(_CRT_NONSTDC_NO_DEPRECATE) +endif() + # Uncomment for ASAN support # set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fno-omit-frame-pointer -fsanitize=address") # set (CMAKE_LINKER_FLAGS "${CMAKE_LINKER_FLAGS} -fno-omit-frame-pointer -fsanitize=address") |