Skip to content

Commit

Permalink
cmake: improve uwp parallelization
Browse files Browse the repository at this point in the history
  • Loading branch information
scribam committed Feb 21, 2024
1 parent 56cad84 commit e6840d8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/uwp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit e6840d8

Please sign in to comment.