1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2026-01-16 00:00:54 +00:00

Merge branch 'long-long-path' into 'master'

Support long paths on Windows

See merge request OpenMW/openmw!5054
This commit is contained in:
AnyOldName3 2026-01-07 18:46:13 +00:00
commit 8f2c9982ec
21 changed files with 69 additions and 7 deletions

View file

@ -13,3 +13,7 @@ if (BUILD_WITH_CODE_COVERAGE)
target_compile_options(openmw_detournavigator_navmeshtilescache_benchmark PRIVATE --coverage)
target_link_libraries(openmw_detournavigator_navmeshtilescache_benchmark gcov)
endif()
if (WIN32)
target_sources(openmw_detournavigator_navmeshtilescache_benchmark PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/other-apps.manifest)
endif()

View file

@ -13,3 +13,7 @@ if (BUILD_WITH_CODE_COVERAGE)
target_compile_options(openmw_esm_refid_benchmark PRIVATE --coverage)
target_link_libraries(openmw_esm_refid_benchmark gcov)
endif()
if (WIN32)
target_sources(openmw_esm_refid_benchmark PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/other-apps.manifest)
endif()

View file

@ -16,3 +16,7 @@ if (BUILD_WITH_CODE_COVERAGE)
target_compile_options(openmw_settings_access_benchmark PRIVATE --coverage)
target_link_libraries(openmw_settings_access_benchmark gcov)
endif()
if (WIN32)
target_sources(openmw_settings_access_benchmark PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/other-apps.manifest)
endif()

View file

@ -13,6 +13,10 @@ target_link_libraries(bsatool
components
)
if (WIN32)
target_sources(bsatool PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/other-apps.manifest)
endif()
if (BUILD_WITH_CODE_COVERAGE)
target_compile_options(bsatool PRIVATE --coverage)
target_link_libraries(bsatool gcov)

View file

@ -10,6 +10,10 @@ target_link_libraries(openmw-bulletobjecttool
components
)
if (WIN32)
target_sources(openmw-bulletobjecttool PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/other-apps.manifest)
endif()
if (BUILD_WITH_CODE_COVERAGE)
target_compile_options(openmw-bulletobjecttool PRIVATE --coverage)
target_link_libraries(openmw-bulletobjecttool gcov)

View file

@ -107,6 +107,10 @@ target_link_libraries(components-tests
components
)
if (WIN32)
target_sources(components-tests PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/other-apps.manifest)
endif()
# Fix for not visible pthreads functions for linker with glibc 2.15
if (UNIX AND NOT APPLE)
target_link_libraries(components-tests ${CMAKE_THREAD_LIBS_INIT})

View file

@ -20,6 +20,10 @@ target_link_libraries(esmtool
components
)
if (WIN32)
target_sources(esmtool PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/other-apps.manifest)
endif()
if (BUILD_WITH_CODE_COVERAGE)
target_compile_options(esmtool PRIVATE --coverage)
target_link_libraries(esmtool gcov)

View file

@ -37,6 +37,10 @@ target_link_libraries(openmw-essimporter
components
)
if (WIN32)
target_sources(openmw-essimporter PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/other-apps.manifest)
endif()
if (BUILD_WITH_CODE_COVERAGE)
target_compile_options(openmw-essimporter PRIVATE --coverage)
target_link_libraries(openmw-essimporter gcov)

View file

@ -74,6 +74,10 @@ target_link_libraries(openmw-launcher
target_link_libraries(openmw-launcher Qt::Widgets Qt::Core Qt::Svg)
if (WIN32)
target_sources(openmw-launcher PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/other-apps.manifest)
endif()
if (BUILD_WITH_CODE_COVERAGE)
target_compile_options(openmw-launcher PRIVATE --coverage)
target_link_libraries(openmw-launcher gcov)

View file

@ -18,6 +18,10 @@ target_link_libraries(openmw-iniimporter
components
)
if (WIN32)
target_sources(openmw-iniimporter PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/other-apps.manifest)
endif()
if (WIN32)
INSTALL(TARGETS openmw-iniimporter RUNTIME DESTINATION ".")
endif(WIN32)

View file

@ -20,6 +20,10 @@ target_link_libraries(openmw-navmeshtool-lib
components
)
if (WIN32)
target_sources(openmw-navmeshtool PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/other-apps.manifest)
endif()
if (BUILD_WITH_CODE_COVERAGE)
target_compile_options(openmw-navmeshtool PRIVATE --coverage)
target_link_libraries(openmw-navmeshtool gcov)

View file

@ -12,6 +12,10 @@ target_link_libraries(niftest
components
)
if (WIN32)
target_sources(niftest PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/other-apps.manifest)
endif()
if (BUILD_WITH_CODE_COVERAGE)
target_compile_options(niftest PRIVATE --coverage)
target_link_libraries(niftest gcov)

View file

@ -247,7 +247,7 @@ target_link_libraries(openmw-cs-lib
target_link_libraries(openmw-cs-lib Qt::Widgets Qt::Core Qt::Network Qt::OpenGL Qt::OpenGLWidgets Qt::Svg)
if (WIN32)
target_sources(openmw-cs PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/openmw-cs.exe.manifest)
target_sources(openmw-cs PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/other-apps.manifest)
endif()
if (WIN32 AND BUILD_OPENCS)

View file

@ -17,6 +17,10 @@ target_link_libraries(openmw-cs-tests PRIVATE
GMock::GMock
)
if (WIN32)
target_sources(openmw-cs-tests PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/other-apps.manifest)
endif()
if (UNIX AND NOT APPLE)
target_link_libraries(openmw-cs-tests PRIVATE ${CMAKE_THREAD_LIBS_INIT})
endif()

View file

@ -35,6 +35,10 @@ if (UNIX AND NOT APPLE)
target_link_libraries(openmw-tests ${CMAKE_THREAD_LIBS_INIT})
endif()
if (WIN32)
target_sources(openmw-tests PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/other-apps.manifest)
endif()
if (BUILD_WITH_CODE_COVERAGE)
target_compile_options(openmw-tests PRIVATE --coverage)
target_link_libraries(openmw-tests gcov)

View file

@ -78,6 +78,10 @@ if (OPENMW_USE_UNSHIELD)
target_link_libraries(openmw-wizard ${LIBUNSHIELD_LIBRARIES})
endif()
if (WIN32)
target_sources(openmw-wizard PRIVATE ${CMAKE_SOURCE_DIR}/files/windows/other-apps.manifest)
endif()
if(DPKG_PROGRAM)
INSTALL(TARGETS openmw-wizard RUNTIME DESTINATION games COMPONENT openmw-wizard)
endif()

View file

@ -178,7 +178,7 @@ namespace Crash
{
executablePath.resize(executablePath.size() + MAX_PATH);
copied = GetModuleFileNameW(nullptr, executablePath.data(), static_cast<DWORD>(executablePath.size()));
} while (copied >= executablePath.size());
} while (GetLastError() == ERROR_INSUFFICIENT_BUFFER);
executablePath.resize(copied);
writePathToShm(mShm->mStartup.mDumpDirectoryPath, dumpPath);

View file

@ -275,9 +275,6 @@ namespace Crash
return;
}
if (utf16Path.length() > MAX_PATH)
utf16Path = LR"(\\?\)" + utf16Path;
HANDLE hCrashLog = CreateFileW(utf16Path.c_str(), GENERIC_READ | GENERIC_WRITE, 0, nullptr, CREATE_ALWAYS,
FILE_ATTRIBUTE_NORMAL, nullptr);
if (hCrashLog == NULL || hCrashLog == INVALID_HANDLE_VALUE)

View file

@ -40,6 +40,9 @@ namespace Crash
HANDLE mSignalApp;
HANDLE mSignalMonitor;
HANDLE mShmMutex;
// the size defines are in UTF-16 code units, and lots of things use more UTF-8 code units, so this may
// explode with really long non-ASCII paths
// we can't switch to wchar_t as when we've made this struct bigger in the past, things exploded
char mDumpDirectoryPath[MAX_LONG_PATH];
char mCrashDumpFileName[MAX_FILENAME];
char mFreezeDumpFileName[MAX_FILENAME];

View file

@ -10,8 +10,9 @@
</security>
</trustInfo>
<application xmlns="urn:schemas-microsoft-com:asm.v3">
<windowsSettings xmlns:ws="http://schemas.microsoft.com/SMI/2005/WindowsSettings">
<ws:dpiAware>True</ws:dpiAware>
<windowsSettings xmlns:ws="http://schemas.microsoft.com/SMI/2005/WindowsSettings" xmlns:ws2="http://schemas.microsoft.com/SMI/2016/WindowsSettings">
<ws:dpiAware>true</ws:dpiAware>
<ws2:longPathAware>true</ws2:longPathAware>
</windowsSettings>
</application>
</assembly>

View file

@ -4,6 +4,7 @@
<asmv3:windowsSettings>
<dpiAware xmlns="http://schemas.microsoft.com/SMI/2005/WindowsSettings">true</dpiAware>
<dpiAwareness xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">PerMonitorV2</dpiAwareness>
<longPathAware xmlns="http://schemas.microsoft.com/SMI/2016/WindowsSettings">true</longPathAware>
</asmv3:windowsSettings>
</asmv3:application>
</assembly>