Skip to content

Commit

Permalink
Windows resource/manifest fixes
Browse files Browse the repository at this point in the history
* Report correct Windows architecture for the build in the manifest
* Output processed .rc/.manifest in the CMake binary dir to prevent
  potential issues with the files conflicting if cross compiling melonDS
  on the same Windows machine
* Make the original file name actually make sense
  • Loading branch information
nadiaholmquist committed Nov 6, 2022
1 parent 659b721 commit ca19ea1
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 6 deletions.
4 changes: 2 additions & 2 deletions res/melon.rc.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#define VFT_APP 0x00000001L

//this will set your .exe icon
100 ICON MOVEABLE PURE LOADONCALL DISCARDABLE "res/melon.ico"
100 ICON MOVEABLE PURE LOADONCALL DISCARDABLE "${CMAKE_SOURCE_DIR}/res/melon.ico"

//include version information in .exe, modify these values to match your needs
1 VERSIONINFO
Expand All @@ -20,7 +20,7 @@ FILETYPE VFT_APP
VALUE "InternalName", "SDnolem"
VALUE "LegalCopyright", "2016-2022 melonDS team"
VALUE "LegalTrademarks", ""
VALUE "OriginalFilename", "zafkflzdasd.exe"
VALUE "OriginalFilename", "melonDS.exe"
VALUE "ProductName", "melonDS"
VALUE "ProductVersion", "${melonDS_VERSION}"
}
Expand Down
4 changes: 2 additions & 2 deletions res/xp.manifest
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
manifestVersion="1.0">
<assemblyIdentity
name="Exe.Apps.Project"
processorArchitecture="amd64"
processorArchitecture="${WIN32_ARCHITECTURE}"
version="1.0.0.0"
type="win32"/>
<description>Project</description>
Expand All @@ -14,7 +14,7 @@
type="win32"
name="Microsoft.Windows.Common-Controls"
version="6.0.0.0"
processorArchitecture="amd64"
processorArchitecture="${WIN32_ARCHITECTURE}"
publicKeyToken="6595b64144ccf1df"
language="*"
/>
Expand Down
14 changes: 12 additions & 2 deletions src/frontend/qt_sdl/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,18 @@ if (UNIX)
elseif (WIN32)
option(PORTABLE "Make a portable build that looks for its configuration in the current directory" ON)

configure_file("${CMAKE_SOURCE_DIR}/res/melon.rc.in" "${CMAKE_SOURCE_DIR}/melon.rc")
target_sources(melonDS PUBLIC "${CMAKE_SOURCE_DIR}/melon.rc")
configure_file("${CMAKE_SOURCE_DIR}/res/melon.rc.in" "${CMAKE_BINARY_DIR}/res/melon.rc")
target_sources(melonDS PUBLIC "${CMAKE_BINARY_DIR}/res/melon.rc")

if (${ARCHITECTURE} STREQUAL x86_64)
set(WIN32_ARCHITECTURE amd64)
elseif (${ARCHITECTURE} STREQUAL x86)
set(WIN32_ARCHITECTURE x86)
elseif (${ARCHITECTURE} MATCHES "ARM(64)?")
string(TOLOWER "${ARCHITECTURE}" WIN32_ARCHITECTURE)
endif()

configure_file("${CMAKE_SOURCE_DIR}/res/xp.manifest.in" "${CMAKE_BINARY_DIR}/res/xp.manifest")

target_link_libraries(melonDS PRIVATE ws2_32 iphlpapi)
set_target_properties(melonDS PROPERTIES LINK_FLAGS_DEBUG "-mconsole")
Expand Down

0 comments on commit ca19ea1

Please sign in to comment.