Cleanup: Windows Manifest usage.

We had a manifest file, but it was seemingly not used, some
settings were done using linker pragmas, some of them visual
studio would set by default for us, others where not set at all.

This patch changes:

- Single manifest file where we can maintain all settings in
a single location, removal of any linker pragmas related to
the manifest.

- Compatibly settings for win vista - win10, without this any
call to any of the GetVersion and related functions (GetVersionEx,
VerifyVersionInfo, IsWindowsXxxx) will by default say we are
on vista and OS specific optimizations in external libraries may
be missed.

-Rather than having it in the .RC file in an #ifdef which may
or may not trigger depending on the build tool used, we tell
cmake to treat it as a source file and it will do the right
thing for both the ninja and visual studio generators.

Differential Revision: https://developer.blender.org/D6136

Reviewers: brecht
This commit is contained in:
Ray Molenkamp
2019-12-05 12:15:04 -07:00
parent 9febff7e14
commit 61a02a7aa1
4 changed files with 28 additions and 8 deletions

View File

@@ -28,12 +28,6 @@
# define _WIN32_IE 0x0501 /* shipped before XP, so doesn't impose additional requirements */
#endif
/* clang-format off */
#pragma comment(linker,"\"/manifestdependency:type='win32' \
name='Microsoft.Windows.Common-Controls' version='6.0.0.0' \
processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
/* clang-format on */
#include <commctrl.h>
#include <shlobj.h>
#include <tlhelp32.h>

View File

@@ -7,4 +7,30 @@
</requestedPrivileges>
</security>
</trustInfo>
<compatibility xmlns="urn:schemas-microsoft-com:compatibility.v1">
<application>
<!-- Windows 10 -->
<supportedOS Id="{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}"/>
<!-- Windows 8.1 -->
<supportedOS Id="{1f676c76-80e1-4239-95bb-83d0f6d0da78}"/>
<!-- Windows 8 -->
<supportedOS Id="{4a2f28e3-53b9-4441-ba9c-d69d4a4a6e38}"/>
<!-- Windows 7 -->
<supportedOS Id="{35138b9a-5d96-4fbd-8e2d-a2440225f93a}"/>
<!-- Windows Vista -->
<supportedOS Id="{e2011457-1546-43c5-a5fe-008deee3d3f0}"/>
</application>
</compatibility>
<dependency>
<dependentAssembly>
<assemblyIdentity
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="*"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
</dependentAssembly>
</dependency>
</assembly>

View File

@@ -7,7 +7,6 @@
#define STRINGIFY_(x) #x
#define STRINGIFY(x) STRINGIFY_(x)
#define BLEN_VER_RC_STR STRINGIFY(BLEN_VER_RC_STR_M)
1 RT_MANIFEST "blender.exe.manifest"
#endif
APPICON ICON DISCARDABLE "winblender.ico"

View File

@@ -149,6 +149,7 @@ if(WIN32 AND NOT UNIX)
list(APPEND SRC
${CMAKE_SOURCE_DIR}/release/windows/icons/winblender.rc
${CMAKE_SOURCE_DIR}/release/windows/icons/blender.exe.manifest
)
endif()