Skip to content

Commit

Permalink
[cmake] Add dx12.hdll to build (#564)
Browse files Browse the repository at this point in the history
  • Loading branch information
tobil4sk authored Sep 10, 2024
1 parent f6175ed commit b711d4d
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 28 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
75 changes: 51 additions & 24 deletions libs/directx/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,24 +1,51 @@
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)
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}
)
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()

0 comments on commit b711d4d

Please sign in to comment.