Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cmake] Add dx12.hdll to build #564

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()