Skip to content

Commit

Permalink
Fix durango
Browse files Browse the repository at this point in the history
  • Loading branch information
walbourn committed Feb 19, 2025
1 parent 7daacf3 commit b68ca18
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ project (DirectXTex
HOMEPAGE_URL "https://go.microsoft.com/fwlink/?LinkId=248926"
LANGUAGES CXX)

if(DEFINED XBOX_CONSOLE_TARGET)
set(CMAKE_CXX_STANDARD_LIBRARIES "")
endif()

option(BUILD_TOOLS "Build tex command-line tools" ON)

option(BUILD_SHARED_LIBS "Build DirectXTex as a shared library" OFF)
Expand Down Expand Up @@ -238,6 +242,8 @@ if(WIN32 AND BUILD_SHARED_LIBS)
target_link_libraries(${PROJECT_NAME} PRIVATE xgameplatform.lib xg_xs.lib xmem.lib)
elseif(XBOX_CONSOLE_TARGET MATCHES "xboxone")
target_link_libraries(${PROJECT_NAME} PRIVATE xgameplatform.lib xg_x.lib xmem.lib)
elseif(XBOX_CONSOLE_TARGET MATCHES "durango")
target_link_libraries(${PROJECT_NAME} PRIVATE kernelx.lib xg_x.lib combase.lib)
endif()
else()
add_library(${PROJECT_NAME} ${LIBRARY_SOURCES} ${LIBRARY_HEADERS})
Expand Down
2 changes: 2 additions & 0 deletions build/CompilerAndLinker.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -200,12 +200,14 @@ if(DEFINED XBOX_CONSOLE_TARGET)
message(FATAL_ERROR "Legacy Xbox One XDK required to build for Durango.")
endif()
list(APPEND COMPILER_DEFINES WINAPI_FAMILY=WINAPI_FAMILY_TV_TITLE _XBOX_ONE _TITLE MONOLITHIC=1)
list(APPEND LINKER_SWITCHES /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:ole32.lib /NODEFAULTLIB:oldnames.lib)
else()
CHECK_INCLUDE_FILE_CXX(gxdk.h GXDK_HEADER)
if(NOT GXDK_HEADER)
message(FATAL_ERROR "Microsoft GDK with Xbox Extensions required to build for Xbox. See https://aka.ms/gdkx")
endif()
list(APPEND COMPILER_DEFINES WINAPI_FAMILY=WINAPI_FAMILY_GAMES)
list(APPEND LINKER_SWITCHES /NODEFAULTLIB:kernel32.lib /NODEFAULTLIB:oldnames.lib)
if(XBOX_CONSOLE_TARGET STREQUAL "scarlett")
CHECK_INCLUDE_FILE_CXX(d3d12_xs.h D3D12XS_HEADER)
if(NOT D3D12XS_HEADER)
Expand Down
2 changes: 1 addition & 1 deletion build/DirectXTex.rc.in
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#include <winres.h>
#include <winver.h>

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
Expand Down

0 comments on commit b68ca18

Please sign in to comment.