Closed mattn closed 10 years ago
Something like it would be nice. But the results of the queries should be cached so you don't have to do a search every time you create a new settings object.
Ok, do you mean like follow?
local hasCompilerCL = CommandExists("cl")
local hasCompilerGcc = CommandExists("gcc")
local hasCompilerClang = CommandExists("clang")
...
function SetDefaultDrivers(settings)
-- set default drivers
if family == "windows" and hasCompilerCL then
SetDriversCL(settings)
elseif hasCompilerClang then
SetDriversClang(settings)
else
SetDriversGCC(settings)
end
...
Yes, but I would probably do the check the first time SetDefaultDrivers is executed.
Yes, but I would probably do the check the first time SetDefaultDrivers is executed.
I guess my patch seems to be good than getting all of hasCompilerXXX
.
Or do you mean the cache is result of os.getenv("PATH")
?
No, cache the result of CommandExists for all the compiler first time SetDefaultDrivers is runned.
The CommandExists has another problem when I think about it. On windows the files are called cl.exe etc so it won't be able to find them. You might wanna use ExecuteSilent() inorder to check if the command exists.
Ah, would be nice. I'll revert & push force.
Done
Still need to cache the result the ExecuteSilent, otherwise bam would spawn extra processes each time you create a new settings object.
Done, How about this?
Cool, I'll test it when I get home.
Sorry it took some time, but I've added the change, some what modified to how you did it but should work nicely.
NP
On 12/3/13, Magnus Auvinen notifications@github.com wrote:
Sorry it took some time, but I've added the change, some what modified to how you did it but should work nicely.
Reply to this email directly or view it on GitHub: https://github.com/matricks/bam/pull/50#issuecomment-29660271
I have three compilers c/gcc/clang on my windows. I prefer auto-detect. How about this change?