Skip to content

Commit 868a246

Browse files
committed
Proper MSVC version for dav1d
1 parent 6e4d255 commit 868a246

2 files changed

Lines changed: 19 additions & 1 deletion

File tree

cmake/dependency.dav1d.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ if (MSVC)
4040
DEPENDEES configure
4141
DEPENDERS build
4242
COMMAND echo "Build Debug"
43-
COMMAND ${MESON_EXECUTABLE} setup ${CMAKE_BINARY_DIR}/dav1d/build_debug --backend vs2022 --buildtype debug
43+
COMMAND ${MESON_EXECUTABLE} setup ${CMAKE_BINARY_DIR}/dav1d/build_debug --backend ${MSVC_NAME} --buildtype debug
4444
--default-library static -Denable_tools=false -Denable_tests=false --prefix ${CMAKE_BINARY_DIR}/dav1d/install
4545
COMMAND ${CMAKE_VS_MSBUILD_COMMAND} ${CMAKE_BINARY_DIR}/dav1d/build_debug/dav1d.sln
4646
COMMAND ${CMAKE_VS_MSBUILD_COMMAND} ${CMAKE_BINARY_DIR}/dav1d/build_debug/RUN_INSTALL.vcxproj

cmake/external_project_common.cmake

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,24 @@ cmake_minimum_required(VERSION 3.28) # for FetchContent's EXCLUDE_FROM_ALL
88
if(NOT _EXTERNAL_PROJECT_INCLUDE_GUARD_)
99
set(_EXTERNAL_PROJECT_INCLUDE_GUARD_ ON)
1010

11+
12+
if(MSVC)
13+
if(MSVC_VERSION GREATER_EQUAL 1950)
14+
set(MSVC_NAME "vs2026")
15+
elseif(MSVC_VERSION GREATER_EQUAL 1930)
16+
set(MSVC_NAME "vs2022")
17+
elseif(MSVC_VERSION GREATER_EQUAL 1920)
18+
set(MSVC_NAME "vs2019")
19+
elseif(MSVC_VERSION GREATER_EQUAL 1910)
20+
set(MSVC_NAME "vs2017")
21+
elseif(MSVC_VERSION GREATER_EQUAL 1900)
22+
set(MSVC_NAME "vs2015")
23+
else()
24+
message("Unsupported MSVC version: ${MSVC_VERSION}")
25+
endif()
26+
endif()
27+
28+
1129
include(FetchContent)
1230
include(ExternalProject)
1331

0 commit comments

Comments
 (0)