Skip to content

Commit

Permalink
update dx cuda-link
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxwellGengYF committed Oct 26, 2024
1 parent 2e42660 commit 0233ea9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
35 changes: 19 additions & 16 deletions src/backends/dx/xmake.lua
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
target("lc-backend-dx")
_config_project({
project_kind = "shared",
batch_size = 8
project_kind = "shared",
batch_size = 8
})
add_deps("lc-runtime", "lc-vstl", "lc-hlsl-builtin")
add_files("**.cpp", "../common/hlsl/*.cpp")
add_headerfiles("**.h", "../common/default_binary_io.h",
"../common/hlsl/*.h")
add_headerfiles("**.h", "../common/default_binary_io.h", "../common/hlsl/*.h")
add_includedirs("./")
add_syslinks("D3D12", "dxgi")
if is_plat("windows") then
add_defines("UNICODE", "_CRT_SECURE_NO_WARNINGS")
add_defines("UNICODE", "_CRT_SECURE_NO_WARNINGS")
end
on_load(function(target)
local cuda_path = os.getenv("CUDA_PATH")
if cuda_path then
target:add("includedirs", path.join(cuda_path, "include/"))
target:add("linkdirs", path.join(cuda_path, "lib/x64/"))
target:add("links", "nvrtc", "cudart", "cuda")
target:add("defines", "LCDX_ENABLE_CUDA")
if is_plat("windows") then
target:add("syslinks", "Cfgmgr32", "Advapi32")
end
end
if get_config("cuda_backend") then
local cuda_path = os.getenv("CUDA_PATH")
if cuda_path then
target:add("includedirs", path.join(cuda_path, "include/"))
target:add("linkdirs", path.join(cuda_path, "lib/x64/"))
target:add("links", "nvrtc_static", "nvrtc-builtins_static", "cudart_static", "cuda")
target:add("defines", "LCDX_ENABLE_CUDA")
if is_plat("windows") then
target:add("syslinks", "Cfgmgr32", "Advapi32")
end
end
end
end)
set_pcxxheader("pch.h")
add_rules('lc_install_sdk', {libnames = {'dx_sdk'}})
add_rules('lc_install_sdk', {
libnames = {'dx_sdk'}
})
add_packages("zlib", {
public = false,
inherit = false
Expand Down

0 comments on commit 0233ea9

Please sign in to comment.