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 <windows.h> 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.
pull/135/head
whitequark 2016-12-04 20:16:05 +00:00
parent 6989a3d068
commit d1ddc6ee07
3 changed files with 9 additions and 7 deletions

View File

@ -228,7 +228,8 @@ if(WIN32)
-D_CRT_SECURE_NO_DEPRECATE -D_CRT_SECURE_NO_DEPRECATE
-D_CRT_SECURE_NO_WARNINGS -D_CRT_SECURE_NO_WARNINGS
-D_SCL_SECURE_NO_WARNINGS -D_SCL_SECURE_NO_WARNINGS
-D_WIN32_WINNT=0x500 -DWINVER=0x0601
-D_WIN32_WINNT=0x0601
-D_WIN32_IE=_WIN32_WINNT -D_WIN32_IE=_WIN32_WINNT
-DISOLATION_AWARE_ENABLED -DISOLATION_AWARE_ENABLED
-DWIN32 -DWIN32

View File

@ -6,8 +6,9 @@ if(WIN32)
${CMAKE_CURRENT_BINARY_DIR}/win32/versioninfo.rc) ${CMAKE_CURRENT_BINARY_DIR}/win32/versioninfo.rc)
set(rc_file ${CMAKE_CURRENT_BINARY_DIR}/resources.rc) set(rc_file ${CMAKE_CURRENT_BINARY_DIR}/resources.rc)
file(WRITE ${rc_file} "// Autogenerated; do not edit\n#include<windows.h>\n") file(WRITE ${rc_file} "// Autogenerated; do not edit\n")
file(WRITE ${rc_file} "#include \"${CMAKE_CURRENT_BINARY_DIR}/win32/versioninfo.rc\"\n") file(APPEND ${rc_file} "#include <windows.h>\n")
file(APPEND ${rc_file} "#include \"${CMAKE_CURRENT_BINARY_DIR}/win32/versioninfo.rc\"\n")
function(add_resource name) function(add_resource name)
set(source ${CMAKE_CURRENT_SOURCE_DIR}/${name}) set(source ${CMAKE_CURRENT_SOURCE_DIR}/${name})
@ -116,8 +117,8 @@ endfunction()
# Second, register all resources. # Second, register all resources.
if(WIN32) if(WIN32)
add_resource(win32/icon.ico 4000 ICON) add_resource(win32/icon.ico 4000 ICON)
add_resource(win32/manifest.xml APP_MANIFEST RT_MANIFEST) add_resource(win32/manifest.xml 2 RT_MANIFEST)
elseif(APPLE) elseif(APPLE)
add_iconset (cocoa/AppIcon.iconset) add_iconset (cocoa/AppIcon.iconset)
add_xib (cocoa/MainMenu.xib) add_xib (cocoa/MainMenu.xib)

View File

@ -2,7 +2,7 @@
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0"> <assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity <assemblyIdentity
version="1.0.0.0" version="1.0.0.0"
processorArchitecture="X86" processorArchitecture="*"
name="JonathanWesthues.3dCAD.SolveSpace" name="JonathanWesthues.3dCAD.SolveSpace"
type="win32" type="win32"
/> />
@ -18,7 +18,7 @@
type="win32" type="win32"
name="Microsoft.Windows.Common-Controls" name="Microsoft.Windows.Common-Controls"
version="6.0.0.0" version="6.0.0.0"
processorArchitecture="X86" processorArchitecture="*"
publicKeyToken="6595b64144ccf1df" publicKeyToken="6595b64144ccf1df"
language="*" language="*"
/> />