diff options
Diffstat (limited to 'xmake/modules/core/tools/ldc2.lua')
| -rw-r--r-- | xmake/modules/core/tools/ldc2.lua | 30 |
1 files changed, 21 insertions, 9 deletions
diff --git a/xmake/modules/core/tools/ldc2.lua b/xmake/modules/core/tools/ldc2.lua index 9cf9fd48b..d564281c4 100644 --- a/xmake/modules/core/tools/ldc2.lua +++ b/xmake/modules/core/tools/ldc2.lua @@ -11,28 +11,40 @@ -- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -- See the License for the specific language governing permissions and -- limitations under the License. --- +-- -- Copyright (C) 2015-2020, TBOOX Open Source Group. -- --- @author ruki +-- @author ruki, BarrOff -- @file ldc2.lua -- --- inherit dmd +-- imports inherit("dmd") -- init it function init(self) - - -- init super - _super.init(self) + + -- init arflags + self:set("dcarflags", "-lib") -- init shflags - self:set("dcshflags", "-shared") + self:set("dcshflags", "-shared", "--relocation-model=pic") - -- init cxflags for the kind: shared - self:set("shared.dcflags", "") + -- init dcflags for the kind: shared + self:set("shared.dcflags", "--relocation-model=pic") end +-- make the optimize flag +function nf_optimize(self, level) + local maps = + { + fast = "-O" + , faster = "-O --release" + , fastest = "-O --release --boundscheck=off" + , smallest = "-O --release --boundscheck=off" + , aggressive = "-O --release --boundscheck=off" + } + return maps[level] +end |
