On a windows build, add a ccache.exe manifest which enables long path awareness in Windows 10+.
Fixes #1595.
add_subdirectory(src/third_party)
add_subdirectory(src/ccache)
+# Win32 version library
+if(WIN32)
+ add_library(ccache_win32_manifest OBJECT "${CMAKE_CURRENT_BINARY_DIR}/version.rc")
+ set_property(TARGET ccache_win32_manifest PROPERTY INCLUDE_DIRECTORIES "")
+endif()
+
+
#
# ccache executable
#
add_executable(ccache src/ccache/main.cpp)
target_link_libraries(ccache PRIVATE standard_settings standard_warnings ccache_framework)
+if(WIN32)
+ if(MSVC)
+ target_link_options(ccache PUBLIC "/MANIFEST:NO")
+ endif()
+ target_link_libraries(ccache PRIVATE ccache_win32_manifest)
+endif()
#
# Documentation
${CMAKE_SOURCE_DIR}/cmake/version.cpp.in
${CMAKE_BINARY_DIR}/src/ccache/version.cpp
@ONLY)
+
+if(WIN32)
+
+ if(CCACHE_VERSION MATCHES "^([0-9]+)\.([0-9]+)\.([0-9]+)\$")
+ set(CCACHE_RCVERSION_MAJOR "${CMAKE_MATCH_1}")
+ set(CCACHE_RCVERSION_MINOR "${CMAKE_MATCH_2}")
+ set(CCACHE_RCVERSION_PATCH "${CMAKE_MATCH_3}")
+ set(CCACHE_RCVERSION ${CCACHE_RCVERSION_MAJOR},${CCACHE_RCVERSION_MINOR},${CCACHE_RCVERSION_PATCH},0)
+ else()
+ set(CCACHE_RCVERSION 0,0,0,0)
+ endif()
+
+
+ configure_file(
+ ${CMAKE_SOURCE_DIR}/cmake/version.rc.in
+ ${CMAKE_BINARY_DIR}/version.rc
+ @ONLY)
+
+ configure_file(
+ ${CMAKE_SOURCE_DIR}/cmake/ccache.exe.manifest.in
+ ${CMAKE_BINARY_DIR}/ccache.exe.manifest
+ @ONLY)
+endif()
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3">
+ <asmv3:application xmlns="urn:schemas-microsoft-com:asm.v3">
+ <asmv3:windowsSettings xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
+ <ws2:longPathAware>true</ws2:longPathAware>
+ </asmv3:windowsSettings>
+ </asmv3:application>
+</assembly>
--- /dev/null
+#include <winres.h>
+
+CREATEPROCESS_MANIFEST_RESOURCE_ID RT_MANIFEST "ccache.exe.manifest"
+
+VS_VERSION_INFO VERSIONINFO
+FILEVERSION @CCACHE_RCVERSION@
+PRODUCTVERSION @CCACHE_RCVERSION@
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4"
+ BEGIN
+ VALUE "InternalName", "ccache\0"
+ VALUE "LegalCopyright", "This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.\0"
+ VALUE "OriginalFilename", "ccache.exe\0"
+ VALUE "ProductName", "Ccache\0"
+ VALUE "ProductVersion", "@CCACHE_VERSION@\0"
+ VALUE "FileDescription", "@CMAKE_PROJECT_DESCRIPTION@\0"
+ VALUE "FileVersion", "@CCACHE_VERSION@\0"
+ END
+ END
+
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x409, 1252
+ END
+END