Skip to content
Merged
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
11 changes: 11 additions & 0 deletions ninja.lua
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,15 @@ local function compilation_rules(cfg, toolset, pch)
local link = toolset.gettoolname(cfg, iif(cfg.language == "C", "cc", "cxx"))
local rc = toolset.gettoolname(cfg, "rc")

-- all paths need to be relative to the workspace output location,
-- and not relative to the project output location.
-- override the toolset getrelative function to achieve this

local getrelative = p.tools.getrelative
p.tools.getrelative = function(cfg, value)
return p.workspace.getrelative(cfg.workspace, value)
end

local all_cflags = getcflags(toolset, cfg, cfg)
local all_cxxflags = getcxxflags(toolset, cfg, cfg)
local all_ldflags = getldflags(toolset, cfg)
Expand Down Expand Up @@ -426,6 +435,8 @@ local function compilation_rules(cfg, toolset, pch)
p.outln("")
end
end

p.tools.getrelative = getrelative
end

local function custom_command_rule()
Expand Down