cmake: Update cross-platform build project management for Windows

Enables creation of x64 and x86 child projects when building on ARM64
and decouples functionality from legacy_check function
This commit is contained in:
PatTheMav
2025-02-08 17:00:33 +01:00
committed by Ryan Foster
parent 25fbaf7bb8
commit df97bddd87
11 changed files with 155 additions and 19 deletions
@@ -105,7 +105,16 @@ target_link_libraries(
)
if(OBS_PARENT_ARCHITECTURE STREQUAL CMAKE_VS_PLATFORM_NAME)
if(CMAKE_VS_PLATFORM_NAME STREQUAL x64)
if(CMAKE_VS_PLATFORM_NAME STREQUAL ARM64)
add_custom_command(
TARGET obs-virtualcam-module
POST_BUILD
COMMAND "${CMAKE_COMMAND}" --build ${CMAKE_SOURCE_DIR}/build_x64 --config $<CONFIG> -t obs-virtualcam-module
COMMENT "Build x64 obs-virtualcam-module"
)
endif()
if(CMAKE_VS_PLATFORM_NAME MATCHES "(ARM64|x64)")
add_custom_command(
TARGET obs-virtualcam-module
POST_BUILD
@@ -117,7 +126,9 @@ if(OBS_PARENT_ARCHITECTURE STREQUAL CMAKE_VS_PLATFORM_NAME)
add_dependencies(win-dshow obs-virtualcam-module)
endif()
if(CMAKE_VS_PLATFORM_NAME STREQUAL x64)
if(CMAKE_VS_PLATFORM_NAME STREQUAL ARM64)
set(_OUTPUT_NAME virtualcam-module-arm64)
elseif(CMAKE_VS_PLATFORM_NAME STREQUAL x64)
set(_OUTPUT_NAME virtualcam-module64)
else()
set(_OUTPUT_NAME virtualcam-module32)
@@ -0,0 +1,8 @@
LIBRARY obs-virtualcam-module-arm64.dll
EXPORTS
DllMain PRIVATE
DllGetClassObject PRIVATE
DllCanUnloadNow PRIVATE
DllRegisterServer PRIVATE
DllUnregisterServer PRIVATE
DllInstall PRIVATE