diff --git a/.github/workflows/uwp.yml b/.github/workflows/uwp.yml index 3616be7900..8c7450a1b9 100644 --- a/.github/workflows/uwp.yml +++ b/.github/workflows/uwp.yml @@ -15,7 +15,7 @@ jobs: - name: CMake run: | cmake -B build -DCMAKE_BUILD_TYPE=Release -G "Visual Studio 17 2022" -A x64 -DCMAKE_SYSTEM_NAME=WindowsStore -DCMAKE_SYSTEM_VERSION=10.0.22000.0 - cmake --build build --config Release --parallel 2 + cmake --build build --config Release -- /m shell: cmd - uses: ilammy/msvc-dev-cmd@v1 diff --git a/CMakeLists.txt b/CMakeLists.txt index 24a1416594..49f312f2ee 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -186,8 +186,13 @@ elseif(ANDROID) set(CMAKE_ANDROID_STL_TYPE "c++_static") elseif(WIN32) add_executable(${PROJECT_NAME} WIN32 core/emulator.cpp) - if(MSVC) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP") + if(CMAKE_GENERATOR MATCHES "Visual Studio") + if(NOT CMAKE_VS_GLOBALS MATCHES "(^|;)UseMultiToolTask=") + list(APPEND CMAKE_VS_GLOBALS UseMultiToolTask=true) + endif() + if(NOT CMAKE_VS_GLOBALS MATCHES "(^|;)EnforceProcessCountAcrossBuilds=") + list(APPEND CMAKE_VS_GLOBALS EnforceProcessCountAcrossBuilds=true) + endif() set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ${PROJECT_NAME}) endif() elseif(APPLE)