commit 03cfeae00a345400e6b06afcf07bc0b38c9702ce
Author: Georg Baum <b...@lyx.org>
Date:   Fri Jul 1 22:05:55 2016 +0200

    Make LyX compiled by MSVC 2015 run on Vista again
    
    Patch and tests from Dima Ruinskiy, comments by me. For details see 
discussion
    in bug 10186.
---
 CMakeLists.txt |    6 +++++-
 1 files changed, 5 insertions(+), 1 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index cf0e708..667f76e 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -755,10 +755,14 @@ if(WIN32)
                set(WIN32_CONSOLE WIN32)
        endif()
        if(MSVC)
-               add_definitions(-D_CRT_SECURE_NO_DEPRECATE 
-D_CRT_NONSTDC_NO_DEPRECATE -DNOMINMAX)
+               # -DPSAPI_VERSION=1 is needed to run on vista (bug 10186)
+               add_definitions(-D_CRT_SECURE_NO_DEPRECATE 
-D_CRT_NONSTDC_NO_DEPRECATE -DNOMINMAX -DPSAPI_VERSION=1)
                # disable checked iterators for msvc release builds to get 
maximum speed
                set(CMAKE_CXX_FLAGS_RELEASE  "${CMAKE_CXX_FLAGS_RELEASE} 
/D_SECURE_SCL=0")
        else()
+               # -DPSAPI_VERSION=1 is not needed for mingw, since the mingw 
psapi.h
+               # does not use it and always declares the vista compatible API.
+               # If this ever changes then -DPSAPI_VERSION might be needed 
here as well. 
                add_definitions(-DWINVER=0x0500)
        endif()
 endif()

Reply via email to