Skip to content

Commit

Permalink
[cmake] Add dx12.hdll to build
Browse files Browse the repository at this point in the history
Also remove FindDirectX.cmake, as directx should now be found in
the Windows SDK.
  • Loading branch information
tobil4sk committed Sep 25, 2022
1 parent d6c2899 commit c9abdcc
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 154 deletions.
5 changes: 1 addition & 4 deletions libs/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@ function(set_as_hdll target)
endfunction()

if(WIN32)
option(WITH_DIRECTX "Build directx.hdll." ON)
if(WITH_DIRECTX)
add_subdirectory(directx)
endif()
add_subdirectory(directx)
endif()

option(WITH_FMT "Build fmt.hdll." ON)
Expand Down
73 changes: 49 additions & 24 deletions libs/directx/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,49 @@
find_package(DirectX)

add_library(directx.hdll SHARED
directx.cpp
gamecontroller.c
window.c
)

set_as_hdll(directx)

target_link_libraries(directx.hdll
libhl
d3d11
dxgi
d3dcompiler
xinput9_1_0
dinput8
)

install(
TARGETS
directx.hdll
DESTINATION ${HDLL_DESTINATION}
)
option(WITH_DIRECTX "Build directx.hdll." ON)

if(WITH_DIRECTX)
add_library(directx.hdll SHARED
directx.cpp
gamecontroller.c
window.c
)

set_as_hdll(directx)

target_link_libraries(directx.hdll
libhl
d3d11
dxgi
d3dcompiler
xinput9_1_0
dinput8
)

install(
TARGETS
directx.hdll
DESTINATION ${HDLL_DESTINATION}
)
endif()

option(WITH_DX12 "Build dx12.hdll." ON)

if(WITH_DX12)
add_library(dx12.hdll SHARED
dx12.cpp
)

set_as_hdll(dx12)

target_link_libraries(dx12.hdll
libhl
D3D12
dxgi
dxcompiler
)

install(
TARGETS
dx12.hdll
DESTINATION ${HDLL_DESTINATION}
)
endif()
126 changes: 0 additions & 126 deletions other/cmake/FindDirectX.cmake

This file was deleted.

0 comments on commit c9abdcc

Please sign in to comment.