From 4382ad469f39bb10df6893255416abe7b27233ee Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 3 Sep 2022 20:06:33 +0200 Subject: [PATCH] templates: Move Windows-only files into dedicated folder --- CMakeLists.txt | 33 +++++++++--------- .../{ => windows}/installer-signed.iss.in | 2 +- templates/{ => windows}/installer.iss.in | 2 +- .../{ => windows}/msvc-redist-helper.exe | Bin templates/{ => windows}/version.rc.in | 0 5 files changed, 18 insertions(+), 19 deletions(-) rename templates/{ => windows}/installer-signed.iss.in (98%) rename templates/{ => windows}/installer.iss.in (98%) rename templates/{ => windows}/msvc-redist-helper.exe (100%) rename templates/{ => windows}/version.rc.in (100%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 280a0c9..ae8e93e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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() diff --git a/templates/installer-signed.iss.in b/templates/windows/installer-signed.iss.in similarity index 98% rename from templates/installer-signed.iss.in rename to templates/windows/installer-signed.iss.in index a80214b..b034a31 100644 --- a/templates/installer-signed.iss.in +++ b/templates/windows/installer-signed.iss.in @@ -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] diff --git a/templates/installer.iss.in b/templates/windows/installer.iss.in similarity index 98% rename from templates/installer.iss.in rename to templates/windows/installer.iss.in index 9b2cc81..9250eaa 100644 --- a/templates/installer.iss.in +++ b/templates/windows/installer.iss.in @@ -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] diff --git a/templates/msvc-redist-helper.exe b/templates/windows/msvc-redist-helper.exe similarity index 100% rename from templates/msvc-redist-helper.exe rename to templates/windows/msvc-redist-helper.exe diff --git a/templates/version.rc.in b/templates/windows/version.rc.in similarity index 100% rename from templates/version.rc.in rename to templates/windows/version.rc.in