Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions prj/NAppTarget.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -386,11 +386,9 @@ function(nap_resource_packs targetName targetType nrcMode dir _resFiles _resIncl
endif()

# Reference the manifest file (required by MinGW)
if (NOT ${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
# https://geekthis.net/post/visual-styles-in-win32-api-c-gcc-mingw/
set(MANIFEST_FILE "${NAPPGUI_ROOT_PATH}/prj/templates/Application.manifest")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/res.rc "1 24 \"${MANIFEST_FILE}\"\n")
endif()
# https://geekthis.net/post/visual-styles-in-win32-api-c-gcc-mingw/
set(MANIFEST_FILE "${NAPPGUI_ROOT_PATH}/prj/templates/Application.manifest")
file(APPEND ${CMAKE_CURRENT_BINARY_DIR}/res.rc "1 24 \"${MANIFEST_FILE}\"\n")

set(globalRes ${globalRes} ${CMAKE_CURRENT_BINARY_DIR}/res.rc)
endif()
Expand Down Expand Up @@ -797,6 +795,11 @@ function(nap_link_with_libraries targetName targetType firstLevelDepends)
target_link_libraries(${targetName} comctl32 uxtheme)
endif()

# Disable default MSVC manifest
if (${CMAKE_CXX_COMPILER_ID} STREQUAL MSVC)
target_link_options(${targetName} PRIVATE /MANIFEST:NO)
endif()

elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux")
# Target should link with math always
target_link_libraries(${targetName} "m")
Expand Down
10 changes: 8 additions & 2 deletions prj/templates/Application.manifest
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" xmlns:asmv3="urn:schemas-microsoft-com:asm.v3" manifestVersion="1.0">
<assemblyIdentity version="1.0.0.0" processorArchitecture="*" name="nappgui.application" type="win32" />
<description>Your application description here.</description>
<dependency>
<dependentAssembly>
<assemblyIdentity type="win32" name="Microsoft.Windows.Common-Controls" version="6.0.0.0" processorArchitecture="*" publicKeyToken="6595b64144ccf1df" language="*" />
</dependentAssembly>
</dependency>
</assembly>
<asmv3:application>
<asmv3:windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>