From: Biswapriyo Nath Date: Mon, 24 Aug 2020 20:15:53 +0000 (+0530) Subject: CMake: Check MSVC while deciding MSVC_VERSION X-Git-Tag: upstream/1.2.179~68 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d23e1ea399617e4ddbb0bc0ac8abb4f7b47ace1f;p=platform%2Fupstream%2FVulkan-Tools.git CMake: Check MSVC while deciding MSVC_VERSION --- diff --git a/cube/CMakeLists.txt b/cube/CMakeLists.txt index ef05db1..b3fce38 100644 --- a/cube/CMakeLists.txt +++ b/cube/CMakeLists.txt @@ -70,8 +70,8 @@ endif() if(WIN32) add_definitions(-DVK_USE_PLATFORM_WIN32_KHR -DWIN32_LEAN_AND_MEAN) - if(NOT MSVC_VERSION LESS 1900) - # Enable control flow guard + if(MSVC AND NOT MSVC_VERSION LESS 1900) + # If MSVC, Enable control flow guard message(STATUS "Building vkcube with control flow guard") add_compile_options("$<$:/guard:cf>") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /guard:cf") diff --git a/vulkaninfo/CMakeLists.txt b/vulkaninfo/CMakeLists.txt index b922e2a..6627b7d 100644 --- a/vulkaninfo/CMakeLists.txt +++ b/vulkaninfo/CMakeLists.txt @@ -86,8 +86,8 @@ endif() if(WIN32) target_compile_definitions(vulkaninfo PUBLIC -DVK_USE_PLATFORM_WIN32_KHR -DWIN32_LEAN_AND_MEAN -D_CRT_SECURE_NO_WARNINGS -DVK_NO_PROTOTYPES) - if(NOT MSVC_VERSION LESS 1900) - # Enable control flow guard + if(MSVC AND NOT MSVC_VERSION LESS 1900) + # If MSVC, Enable control flow guard message(STATUS "Building vulkaninfo with control flow guard") add_compile_options("$<$:/guard:cf>") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /guard:cf")