Skip to content

Commit b3625a1

Browse files
Change semantics to add linkerMergeKeep
1 parent 7a3b159 commit b3625a1

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

source/redub/buildapi.d

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,7 @@ private auto save(TRange)(TRange input)
498498
/**
499499
* This version is actually faster than the other one
500500
*/
501-
ref string[] exclusiveMerge(StringRange)(return scope ref string[] a, StringRange b, scope const string[] excludeFromMerge = null)
501+
ref string[] exclusiveMerge(StringRange)(return scope ref string[] a, StringRange b, scope const string[] excludeFromMerge = null, scope const string[] alwaysKeep = null)
502502
{
503503
import std.algorithm.searching : countUntil;
504504
import std.array;
@@ -511,6 +511,11 @@ ref string[] exclusiveMerge(StringRange)(return scope ref string[] a, StringRang
511511
{
512512
if(bV.length == 0) continue;
513513
if(countUntil(excludeFromMerge, bV) != -1) continue;
514+
else if (countUntil(alwaysKeep, bV) != -1)
515+
{
516+
app ~= bV;
517+
continue outer;
518+
}
514519
else foreach(aV; a)
515520
{
516521
if(aV == bV)

source/redub/parsers/base.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ void addFrameworks(ref BuildRequirements req, JSONStringArray frameworks, ParseC
138138
}
139139
void addVersions(ref BuildRequirements req, JSONStringArray vers, ParseConfig c){req.cfg.versions.exclusiveMerge(vers);}
140140
void addDebugVersions(ref BuildRequirements req, JSONStringArray vers, ParseConfig c){req.cfg.debugVersions.exclusiveMerge(vers);}
141-
void addLinkFlags(ref BuildRequirements req, JSONStringArray lFlags, ParseConfig c){req.cfg.linkFlags.exclusiveMerge(lFlags, linkerMergeExceptions);}
141+
void addLinkFlags(ref BuildRequirements req, JSONStringArray lFlags, ParseConfig c){req.cfg.linkFlags.exclusiveMerge(lFlags, null, linkerMergeKeep);}
142142
void addDflags(ref BuildRequirements req, JSONStringArray dFlags, ParseConfig c){req.cfg.dFlags.exclusiveMerge(dFlags);}
143143
void addDependency(
144144
ref BuildRequirements req,
@@ -215,7 +215,7 @@ void addSubConfiguration(
215215
req.dependencies[depIndex].subConfiguration = BuildRequirements.Configuration(subConfigurationName, false);
216216
}
217217

218-
const string[] linkerMergeExceptions = [
218+
const string[] linkerMergeKeep = [
219219
"-l",
220220
"-framework",
221221
"-L",

0 commit comments

Comments
 (0)