Skip to content

Commit

Permalink
Merge pull request xbmc#24910 from thexai/windows-cmake
Browse files Browse the repository at this point in the history
[Windows] a few CMake updates
  • Loading branch information
thexai authored Mar 28, 2024
2 parents e70f0d8 + 8d88bdb commit bba94b9
Showing 1 changed file with 3 additions and 13 deletions.
16 changes: 3 additions & 13 deletions cmake/scripts/windows/ArchSetup.cmake
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Minimum SDK version we support
set(VS_MINIMUM_SDK_VERSION 10.0.14393.0)
set(VS_MINIMUM_SDK_VERSION 10.0.18362.0)

if(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION VERSION_LESS VS_MINIMUM_SDK_VERSION)
message(FATAL_ERROR "Detected Windows SDK version is ${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}.\n"
Expand Down Expand Up @@ -90,8 +90,7 @@ link_directories(${DEPENDS_PATH}/lib)

# Additional libraries
list(APPEND DEPLIBS bcrypt.lib d3d11.lib DInput8.lib DSound.lib winmm.lib Mpr.lib Iphlpapi.lib WS2_32.lib
PowrProf.lib setupapi.lib Shlwapi.lib dwmapi.lib dxguid.lib DelayImp.lib version.lib
crypt32.lib)
PowrProf.lib setupapi.lib Shlwapi.lib dwmapi.lib dxguid.lib DelayImp.lib)

# NODEFAULTLIB option
set(_nodefaultlibs_RELEASE libcmt)
Expand All @@ -104,8 +103,7 @@ foreach(_lib ${_nodefaultlibs_DEBUG})
endforeach()

# DELAYLOAD option
set(_delayloadlibs zlib.dll libmariadb.dll libxslt.dll dnssd.dll dwmapi.dll sqlite3.dll
d3dcompiler_47.dll)
set(_delayloadlibs libmariadb.dll libxslt.dll dnssd.dll dwmapi.dll sqlite3.dll d3dcompiler_47.dll)
foreach(_lib ${_delayloadlibs})
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /DELAYLOAD:\"${_lib}\"")
endforeach()
Expand All @@ -120,12 +118,4 @@ set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} /DEBUG /OP

if(CMAKE_GENERATOR MATCHES "Visual Studio")
set_property(GLOBAL PROPERTY USE_FOLDERS ON)

# Generate a batch file that opens Visual Studio with the necessary env variables set.
file(WRITE ${CMAKE_BINARY_DIR}/kodi-sln.bat
"@echo off\n"
"set KODI_HOME=%~dp0\n"
"set PATH=%~dp0\\system\n"
"set PreferredToolArchitecture=x64\n"
"start %~dp0\\${PROJECT_NAME}.sln")
endif()

0 comments on commit bba94b9

Please sign in to comment.