Merge pull request #1240 from WorldofBay/patch-1

allow linking of mixed c++ assemblies
This commit is contained in:
Samuel Surtees 2019-03-12 21:09:33 +10:00 committed by GitHub
commit a413f904d7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 43 additions and 0 deletions

View File

@ -99,6 +99,19 @@
return false
end
-- Can link mixed C++ with native projects
if cfg.language == "C++" then
if cfg.clr == p.ON then
return true
end
end
if target.language == "C++" then
if target.clr == p.ON then
return true
end
end
-- Can't link managed and unmanaged projects
local cfgManaged = project.isdotnet(cfg.project) or (cfg.clr ~= p.OFF)

View File

@ -192,3 +192,33 @@
local r = prepare("all", "fullpath")
test.isequal({}, r)
end
--
-- Mixed and unmanaged projects can link to each other.
--
function suite.canLink_MixedAndNativeCpp()
clr "On"
links { "MyProject2" }
project "MyProject2"
kind "SharedLib"
language "C++"
local r = prepare("all", "fullpath")
test.isequal({ "bin/Debug/MyProject2.lib" }, r)
end
function suite.canLink_NativeAndMixedCpp()
links { "MyProject2" }
project "MyProject2"
kind "SharedLib"
language "C++"
clr "On"
local r = prepare("all", "fullpath")
test.isequal({ "bin/Debug/MyProject2.lib" }, r)
end