From d1ddc6ee077493e55f760d977493b9782a855f29 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sun, 4 Dec 2016 20:16:05 +0000 Subject: [PATCH] Win32: fix inclusion of manifest, to get back visual styles. This commit fixes four issues: * Instead of WRITE,APPEND, resource.rc was generated using WRITE,WRITE, which erased #include and prevented any symbolic definitions (like RT_MANIFEST) from working. This silently included them using a string type instead, which did nothing. * WINVER is bumped to Win7, since that's what we target now. * Index of RT_MANIFEST is changed to 2, since that's what it has to be when ISOLATION_AWARE_ENABLED is defined. * Platform is not restricted to X86 in manifest, since there is no point in doing so. --- CMakeLists.txt | 3 ++- res/CMakeLists.txt | 9 +++++---- res/win32/manifest.xml | 4 ++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 82e76696..8837fb58 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -228,7 +228,8 @@ if(WIN32) -D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS - -D_WIN32_WINNT=0x500 + -DWINVER=0x0601 + -D_WIN32_WINNT=0x0601 -D_WIN32_IE=_WIN32_WINNT -DISOLATION_AWARE_ENABLED -DWIN32 diff --git a/res/CMakeLists.txt b/res/CMakeLists.txt index 216b4276..d5c50bcb 100644 --- a/res/CMakeLists.txt +++ b/res/CMakeLists.txt @@ -6,8 +6,9 @@ if(WIN32) ${CMAKE_CURRENT_BINARY_DIR}/win32/versioninfo.rc) set(rc_file ${CMAKE_CURRENT_BINARY_DIR}/resources.rc) - file(WRITE ${rc_file} "// Autogenerated; do not edit\n#include\n") - file(WRITE ${rc_file} "#include \"${CMAKE_CURRENT_BINARY_DIR}/win32/versioninfo.rc\"\n") + file(WRITE ${rc_file} "// Autogenerated; do not edit\n") + file(APPEND ${rc_file} "#include \n") + file(APPEND ${rc_file} "#include \"${CMAKE_CURRENT_BINARY_DIR}/win32/versioninfo.rc\"\n") function(add_resource name) set(source ${CMAKE_CURRENT_SOURCE_DIR}/${name}) @@ -116,8 +117,8 @@ endfunction() # Second, register all resources. if(WIN32) - add_resource(win32/icon.ico 4000 ICON) - add_resource(win32/manifest.xml APP_MANIFEST RT_MANIFEST) + add_resource(win32/icon.ico 4000 ICON) + add_resource(win32/manifest.xml 2 RT_MANIFEST) elseif(APPLE) add_iconset (cocoa/AppIcon.iconset) add_xib (cocoa/MainMenu.xib) diff --git a/res/win32/manifest.xml b/res/win32/manifest.xml index 22a78cc8..82834364 100644 --- a/res/win32/manifest.xml +++ b/res/win32/manifest.xml @@ -2,7 +2,7 @@ @@ -18,7 +18,7 @@ type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" - processorArchitecture="X86" + processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" />