Skip to content

Commit

Permalink
Update for more toolsets.
Browse files Browse the repository at this point in the history
  • Loading branch information
tritao committed Sep 17, 2024
1 parent d98fb36 commit e0868af
Show file tree
Hide file tree
Showing 8 changed files with 81 additions and 1 deletion.
12 changes: 12 additions & 0 deletions src/tools/clang.lua
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,17 @@
end


--
-- Returns the relative path to passed value for the given project.
-- This can be overriden by actions to allow for more customized relative
-- path behaviors.
--

function clang.getrelative(cfg, value)
return gcc.getrelative(cfg, value)
end


--
-- Returns a list of include file search directories, decorated for
-- the compiler command line.
Expand Down Expand Up @@ -216,6 +227,7 @@
return gcc.getsharedlibarg(cfg)
end


--
-- Build a list of linker flags corresponding to the settings in
-- a particular project configuration.
Expand Down
1 change: 0 additions & 1 deletion src/tools/dotnet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,6 @@ function dotnet.getrelative(cfg, value)
end



--
-- Returns a list of compiler flags, based on the supplied configuration.
--
Expand Down
11 changes: 11 additions & 0 deletions src/tools/snc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,17 @@
end


--
-- Returns the relative path to passed value for the given project.
-- This can be overriden by actions to allow for more customized relative
-- path behaviors.
--

function snc.getrelative(cfg, value)
return gcc.getrelative(cfg, value)
end


--
-- Retrieve the LDFLAGS for a specific configuration.
--
Expand Down
13 changes: 13 additions & 0 deletions tests/tools/test_clang.lua
Original file line number Diff line number Diff line change
Expand Up @@ -122,3 +122,16 @@ function suite.cxxflags_onSanitizeFuzzer()
prepare()
test.contains({ "-fsanitize=fuzzer" }, clang.getcxxflags(cfg))
end

--
-- Check the handling of `getrelative` hook.
--

function suite.onGetRelative()
toolset "clang"
prepare()
local toolset = p.config.toolset(cfg)
print(toolset)
test.isnotnil(toolset.getrelative)
end

12 changes: 12 additions & 0 deletions tests/tools/test_dotnet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,15 @@ function suite.flags_csversion()
csversion "7.2"
test.contains({ "/langversion:7.2" }, dotnet.getflags(cfg))
end


--
-- Check the handling of `getrelative` hook.
--

function suite.onGetRelative()
toolset "dotnet"
prepare()
local toolset = p.config.toolset(cfg)
test.isnotnil(toolset.getrelative)
end
11 changes: 11 additions & 0 deletions tests/tools/test_gcc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1149,3 +1149,14 @@
test.contains({ "-x objective-c++" }, gcc.getcflags(cfg))
test.contains({ "-x objective-c++" }, gcc.getcxxflags(cfg))
end

--
-- Check the handling of `getrelative` hook.
--

function suite.onGetRelative()
toolset "gcc"
prepare()
local toolset = p.config.toolset(cfg)
test.isnotnil(toolset.getrelative)
end
11 changes: 11 additions & 0 deletions tests/tools/test_msc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -759,3 +759,14 @@ end
prepare()
test.isequal({ "/MD", "/Z7" }, msc.getcflags(cfg))
end

--
-- Check the handling of `getrelative` hook.
--

function suite.onGetRelative()
toolset "msc"
prepare()
local toolset = p.config.toolset(cfg)
test.isnotnil(toolset.getrelative)
end
11 changes: 11 additions & 0 deletions tests/tools/test_snc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,14 @@
prepare()
test.isequal({'-include stdafx.h', '-include include/sys.h'}, snc.getforceincludes(cfg))
end

--
-- Check the handling of `getrelative` hook.
--

function suite.onGetRelative()
toolset "snc"
prepare()
local toolset = p.config.toolset(cfg)
test.isnotnil(toolset.getrelative)
end

0 comments on commit e0868af

Please sign in to comment.