Skip to content
Permalink
Browse files

MDEV-12207 Include windows compatibility manifest into executable to …

…make GetVersionEx work correctly
  • Loading branch information...
vaintroub committed Mar 8, 2017
1 parent f65c9f8 commit 65ef8ec8aafc09c4bee91e170aa2a9c0e0668a8f
Showing with 30 additions and 0 deletions.
  1. +8 −0 cmake/mysql_add_executable.cmake
  2. +22 −0 cmake/win_compatibility.manifest
@@ -38,6 +38,14 @@ FUNCTION (MYSQL_ADD_EXECUTABLE)

SET(sources ${ARG_DEFAULT_ARGS})
ADD_VERSION_INFO(${target} EXECUTABLE sources)

IF(MSVC)
# Add compatibility manifest, to fix GetVersionEx on Windows 8.1 and later
IF (CMAKE_VERSION VERSION_GREATER 3.3)
SET(sources ${sources} ${PROJECT_SOURCE_DIR}/cmake/win_compatibility.manifest)
ENDIF()
ENDIF()

ADD_EXECUTABLE(${target} ${ARG_WIN32} ${ARG_MACOSX_BUNDLE} ${ARG_EXCLUDE_FROM_ALL} ${sources})
# tell CPack where to install
IF(NOT ARG_EXCLUDE_FROM_ALL)
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="utf-8"?>
<asmv1:assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv1="urn:schemas-microsoft-com:asm.v1" xmlns:asmv2="urn:schemas-microsoft-com:asm.v2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows Vista and Windows Server 2008 -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>

<!-- Windows 7 and Windows Server 2008 R2 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>

<!-- Windows 8 and Windows Server 2012 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>

<!-- Windows 8.1 and Windows Server 2012 R2 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>

<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>

</application>
</compatibility>
</asmv1:assembly>

0 comments on commit 65ef8ec

Please sign in to comment.
You can’t perform that action at this time.