Closed moteus closed 11 years ago
The version now up does allow any of these fields to be functions, but they will be passed the original arguments to program or shared, etc. Resolution of needs comes early, so there's no way I can pass you a target, sorry. But you can check args.dynamic, should work.
I don't think is good solution. May be should wait add this feature until we can pass target object. For now I can write needs generator and select one of them in lakefile. And what about compiler version. For MSVC i write:
execute_wrapper('cl',nil, function(status, code, f)
if not status then return end
local str = f:read("*l")
if not str then return end
local major, minor, rev, build = string.match(str, "[Cc]ompiler [Vv]ersion%s+(%d+)[.](%d+)[.](%d+)[.](%d+)")
if not(major and minor and rev and build) then return end
MSVC_MAJOR = tonumber(major)
MSVC_MINOR = tonumber(minor)
MSVC_REV = tonumber(rev)
MSVC_BUILD = tonumber(build)
MSVC_VER = ({
[15] = 9;
[16] = 10;
[17] = 12;
})[MSVC_MAJOR]
end)
On Fri, Jan 25, 2013 at 11:37 AM, moteus notifications@github.com wrote:
May be should wait add this feature until we can pass target object.
Well, it's technically hard to pass the target, since the target has not been created yet. Let me think about this.
What specifically do you need that can only come from the target? You do have access to args, and args.dynamic will be available (I will check this)
Another way of saying this is that needs are not dependent on targets
And what about compiler version. For MSVC i write:
OK, that looks like useful code - we already have more than 3.000 lines, another 15 will not make big difference ;)
On Fri, Jan 25, 2013 at 11:47 AM, steve donovan steve.j.donovan@gmail.com wrote:
OK, that looks like useful code - we already have more than 3.000 lines, another 15 will not make big difference ;)
Easy enough - but I see the third number is much larger - is that not the build number, followed by the revision?
If we have several targets with difference static/dinamic options. I have project with 5 dll and 1 exe. And one of dll always use static runtime. May be we can use objects as needs. so we can crate just need generator and register them in lake.
SQLITE3_NEED = lake.need('sqlite3', {dynamic=true})
Easy enough - but I see the third number is much larger - is that not the build number, followed by the revision?
I dont know. I use only MSCV_MAJOR.
added lake.compiler_version()
What if MSVC will contain MS Visual Studio Version 8,9,10? Or add new constatnt MSVC_VER.
If we use static libraries then we have to use specific static library depend on copile options: For example for zlib i use
But if need.lib is function we can define need as: