templates: Move Windows-only files into dedicated folder

This commit is contained in:
Michael Fabian 'Xaymar' Dirks 2022-09-03 20:06:33 +02:00
parent 7f1ae7f9f1
commit 4382ad469f
5 changed files with 18 additions and 19 deletions

View file

@ -902,11 +902,10 @@ if(D_PLATFORM_WINDOWS) # Windows Support
set(PROJECT_LEGAL_TRADEMARKS_2 "")
configure_file(
"templates/version.rc.in"
"templates/windows/version.rc.in"
"generated/version.rc"
@ONLY
)
LIST(APPEND PROJECT_TEMPLATES "templates/version.rc.in")
LIST(APPEND PROJECT_TEMPLATES "templates/windows/version.rc.in")
LIST(APPEND PROJECT_PRIVATE_GENERATED "${PROJECT_BINARY_DIR}/generated/version.rc")
endif()
@ -1976,18 +1975,6 @@ set_target_properties(${PROJECT_NAME} PROPERTIES
VERSION ${PROJECT_VERSION}
)
# Delay-Loading on Microsoft Visual C++
if(D_PLATFORM_WINDOWS)
foreach(DELAYLOAD ${PROJECT_LIBRARIES_DELAYED})
get_target_property(_lf ${PROJECT_NAME} LINK_FLAGS)
if(NOT _lf)
set(_lf "")
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "${_lf} /DELAYLOAD:${DELAYLOAD}")
add_link_options("/DELAYLOAD:${DELAYLOAD}")
endforeach()
endif()
# Enable Qt if needed
if(Qt5_FOUND OR Qt6_FOUND)
set_target_properties(${PROJECT_NAME} PROPERTIES
@ -1999,6 +1986,18 @@ if(Qt5_FOUND OR Qt6_FOUND)
)
endif()
# Windows exclusive changes
if(D_PLATFORM_WINDOWS)
foreach(DELAYLOAD ${PROJECT_LIBRARIES_DELAYED})
get_target_property(_lf ${PROJECT_NAME} LINK_FLAGS)
if(NOT _lf)
set(_lf "")
endif()
set_target_properties(${PROJECT_NAME} PROPERTIES LINK_FLAGS "${_lf} /DELAYLOAD:${DELAYLOAD}")
add_link_options("/DELAYLOAD:${DELAYLOAD}")
endforeach()
endif()
# MacOS: Disable automatic Code Signing in Xcode
if(D_PLATFORM_MAC)
set_target_properties(${PROJECT_NAME} PROPERTIES
@ -2338,12 +2337,12 @@ if(STANDALONE)
list(JOIN ISS_CODESIGN_CMD_SHA2 " " ISS_CODESIGN_CMD_SHA2)
configure_file(
"templates/installer-signed.iss.in"
"templates/windows/installer-signed.iss.in"
"installer.iss"
)
else()
configure_file(
"templates/installer.iss.in"
"templates/windows/installer.iss.in"
"installer.iss"
)
endif()

View file

@ -72,7 +72,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "@ISS_FILES_DIR@/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "@PROJECT_SOURCE_DIR@/templates/msvc-redist-helper.exe"; DestDir: "{app}"; DestName: "msvc-redist-helper.exe"; Flags: ignoreversion dontcopy noencryption
Source: "@PROJECT_SOURCE_DIR@/templates/windows/msvc-redist-helper.exe"; DestDir: "{app}"; DestName: "msvc-redist-helper.exe"; Flags: ignoreversion dontcopy noencryption
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]

View file

@ -66,7 +66,7 @@ Name: "english"; MessagesFile: "compiler:Default.isl"
[Files]
Source: "@ISS_FILES_DIR@/*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "@PROJECT_SOURCE_DIR@/templates/msvc-redist-helper.exe"; DestDir: "{app}"; DestName: "msvc-redist-helper.exe"; Flags: ignoreversion dontcopy noencryption
Source: "@PROJECT_SOURCE_DIR@/templates/windows/msvc-redist-helper.exe"; DestDir: "{app}"; DestName: "msvc-redist-helper.exe"; Flags: ignoreversion dontcopy noencryption
; NOTE: Don't use "Flags: ignoreversion" on any shared system files
[Icons]