forked from pyrite-dev/pmake
fix
This commit is contained in:
parent
4437941405
commit
831c207d25
3 changed files with 8 additions and 5 deletions
|
|
@ -140,7 +140,9 @@ function make(output) {
|
|||
|
||||
const self = targets.filter(target_filter)[0];
|
||||
const objs = self.sources.map(pmake.compiler.output);
|
||||
const libs = pmake.libs(self).join(" ");
|
||||
const libs = pmake.libs(self, null, true).join(" ");
|
||||
|
||||
console.log(libs);
|
||||
|
||||
mk.write("\n");
|
||||
|
||||
|
|
|
|||
|
|
@ -133,21 +133,22 @@ pmake.libdirs = function(target) {
|
|||
return target.libdirs.concat(targets.map(libdirs).flat());
|
||||
};
|
||||
|
||||
pmake.libs = function(target, if_str) {
|
||||
pmake.libs = function(target, if_str, nostr) {
|
||||
function libs(x) {
|
||||
if(x instanceof pmake.LibraryProject) {
|
||||
function recursion(x) {
|
||||
if(x instanceof pmake.LibraryProject) {
|
||||
return pmake.libs(x, if_str);
|
||||
} else {
|
||||
} else if(!nostr) {
|
||||
return [ x ];
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
const r = x.libraries.map(recursion).flat().concat([ x.base + "/" + pmake.compiler.output(x) ]);
|
||||
|
||||
return r;
|
||||
} else if((typeof x) == "string") {
|
||||
} else if((typeof x) == "string" && !nostr) {
|
||||
return [ x ];
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ static duk_ret_t js_fs_glob(duk_context* self) {
|
|||
if(glob(duk_to_string(self, i), 0, NULL, &g) == 0) {
|
||||
int j;
|
||||
|
||||
for(j = 0; j < g.gl_matchc; j++) {
|
||||
for(j = 0; j < g.gl_pathc; j++) {
|
||||
duk_push_string(self, g.gl_pathv[j]);
|
||||
duk_put_prop_index(self, arr, c);
|
||||
c++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue