Procházet zdrojové kódy

Merge topic 'mingw-host-system-version'

5a919e6601 cmake: Fix CMAKE_HOST_SYSTEM_VERSION when built for MinGW

Acked-by: Kitware Robot <[email protected]>
Merge-request: !11112
Brad King před 1 měsícem
rodič
revize
a17394f334

+ 5 - 1
Source/CMakeLists.txt

@@ -979,7 +979,11 @@ if(WIN32)
 
     # Add a manifest file to executables on Windows to allow for
     # GetVersion to work properly on Windows 8 and above.
-    target_sources(ManifestLib INTERFACE cmake.version.manifest)
+    if(MSVC)
+      target_sources(ManifestLib INTERFACE cmake.version.manifest)
+    else()
+      target_sources(ManifestLib INTERFACE cmake.version.manifest.rc)
+    endif()
   endif()
 endif()
 

+ 7 - 0
Source/cmake.version.manifest

@@ -20,4 +20,11 @@
       <ws2:longPathAware>true</ws2:longPathAware>
     </asmv3:windowsSettings>
   </asmv3:application>
+  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
+    <security>
+      <requestedPrivileges>
+        <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
+      </requestedPrivileges>
+    </security>
+  </trustInfo>
 </assembly>

+ 2 - 0
Source/cmake.version.manifest.rc

@@ -0,0 +1,2 @@
+#include <winuser.h>
+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "cmake.version.manifest"