Skip to content

Commit

Permalink
improve to nvcc build for ninja
Browse files Browse the repository at this point in the history
  • Loading branch information
waruqi committed Oct 22, 2024
1 parent a7aab9d commit d60ca24
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion xmake/plugins/project/ninja/build_ninja.lua
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,14 @@ function _add_rules_for_compiler_windres(ninjafile, sourcekind, program)
ninjafile:print("")
end

-- add rules for complier (cuda/nvcc)
function _add_rules_for_compiler_nvcc(ninjafile, sourcekind, program)
ninjafile:print("rule %s", sourcekind)
ninjafile:print(" command = %s -c $ARGS $in -o $out", program)
ninjafile:print(" description = compiling.%s $in", config.mode())
ninjafile:print("")
end

-- add rules for complier
function _add_rules_for_compiler(ninjafile)
ninjafile:print("# rules for compiler")
Expand All @@ -203,7 +211,8 @@ function _add_rules_for_compiler(ninjafile)
ml = _add_rules_for_compiler_msvc_ml,
ml64 = _add_rules_for_compiler_msvc_ml,
rc = _add_rules_for_compiler_msvc_rc,
windres = _add_rules_for_compiler_windres
windres = _add_rules_for_compiler_windres,
nvcc = _add_rules_for_compiler_nvcc
}
for sourcekind, _ in pairs(language.sourcekinds()) do
local program, toolname = platform.tool(sourcekind)
Expand Down

0 comments on commit d60ca24

Please sign in to comment.