diff --git a/src/citron/CMakeLists.txt b/src/citron/CMakeLists.txt index c78d36b09..2c05e7360 100644 --- a/src/citron/CMakeLists.txt +++ b/src/citron/CMakeLists.txt @@ -497,6 +497,12 @@ endif() if (WIN32 AND QT_VERSION VERSION_GREATER_EQUAL 6) set(CITRON_EXE_DIR "$") add_custom_command(TARGET citron POST_BUILD COMMAND ${WINDEPLOYQT_EXECUTABLE} "${CITRON_EXE_DIR}/citron.exe" --dir "${CITRON_EXE_DIR}" --libdir "${CITRON_EXE_DIR}" --plugindir "${CITRON_EXE_DIR}/plugins" --no-compiler-runtime --no-opengl-sw --no-system-d3d-compiler --no-translations --verbose 0) + + # Create the "user" directory for portable mode + add_custom_command(TARGET citron POST_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory "${CITRON_EXE_DIR}/user" + COMMENT "Creating portable user directory" + ) endif() if (CITRON_USE_BUNDLED_QT) @@ -525,7 +531,12 @@ if (ARCHITECTURE_x86_64 OR ARCHITECTURE_arm64) endif() if (CITRON_USE_PRECOMPILED_HEADERS) - target_precompile_headers(citron PRIVATE precompiled_headers.h) + # Disable PCH for MSVC 14.44+ due to __builtin_assume_aligned conflict + if (NOT (MSVC AND MSVC_VERSION GREATER_EQUAL 1944)) + target_precompile_headers(citron PRIVATE precompiled_headers.h) + else() + message(STATUS "Precompiled headers disabled for citron due to MSVC 14.44+ compatibility issue") + endif() endif() create_target_directory_groups(citron) diff --git a/src/citron_cmd/CMakeLists.txt b/src/citron_cmd/CMakeLists.txt index b0b3aa1b1..a49dfedd1 100644 --- a/src/citron_cmd/CMakeLists.txt +++ b/src/citron_cmd/CMakeLists.txt @@ -81,6 +81,14 @@ if (MSVC) copy_citron_SDL_deps(citron-cmd) endif() +# Create the "user" directory for portable mode on Windows +if(WIN32) + add_custom_command(TARGET citron-cmd POST_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory "$/user" + COMMENT "Creating portable user directory for citron-cmd" + ) +endif() + if (CITRON_USE_PRECOMPILED_HEADERS) target_precompile_headers(citron-cmd PRIVATE precompiled_headers.h) endif() diff --git a/src/dedicated_room/CMakeLists.txt b/src/dedicated_room/CMakeLists.txt index 67651eec8..431674992 100644 --- a/src/dedicated_room/CMakeLists.txt +++ b/src/dedicated_room/CMakeLists.txt @@ -46,6 +46,14 @@ if(UNIX AND NOT APPLE) install(TARGETS citron-room) endif() +# Create the "user" directory for portable mode on Windows +if(WIN32) + add_custom_command(TARGET citron-room POST_BUILD + COMMAND ${CMAKE_COMMAND} -E make_directory "$/user" + COMMENT "Creating portable user directory for citron-room" + ) +endif() + if (CITRON_USE_PRECOMPILED_HEADERS) target_precompile_headers(citron-room PRIVATE precompiled_headers.h) endif()