Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update D module to VS2019 and latest D compiler options. #1298

Merged
merged 1 commit into from
Jun 3, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 33 additions & 41 deletions modules/d/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,67 +16,59 @@ to your project definition and populate with .d files.
C and C++ projects that include .d files will also support some of the API below. Any API tagged with (D/C/C++) works in D and C/C++ projects. Any API tagged with (C/C++) only works for .d files in C/C++ projects.

### APIs ###
## D ##

* [flags](https://github.com/premake/premake-dlang/wiki/flags)
* AllInstantiate
* CodeCoverage
* Deprecated
* Color
* Documentation
* GenerateHeader
* GenerateJSON
* GenerateMap
* NoBoundsCheck
* IgnorePragma
* LowMem
* Main
* PerformSyntaxCheckOnly
* Profile
* ProfileGC
* Quiet
* RetainPaths
* SeparateCompilation
* ShowCommandLine
* ShowDependencies
* ShowGC
* ShowTLS
* StackFrame
* StackStomp
* SymbolsLikeC
* UnitTest
* UseLDC
* Verbose
* [versionconstants](https://github.com/premake/premake-dlang/wiki/versionconstants)
* [versionlevel](https://github.com/premake/premake-dlang/wiki/versionlevel)
* boundscheck ("type") [Off, SafeOnly, On]
* compilationmodel ("model") [ Project, Package, File ]
* checkaction
* computetargets
* [debugconstants](https://github.com/premake/premake-dlang/wiki/debugconstants)
* [debuglevel](https://github.com/premake/premake-dlang/wiki/debuglevel)
* dependenciesfile ("filename")
* deprecatedfeatures ("feature") [ Error, Info, Allow ]
* [docdir](https://github.com/premake/premake-dlang/wiki/docdir)
* [docname](https://github.com/premake/premake-dlang/wiki/docname)
* [headerdir](https://github.com/premake/premake-dlang/wiki/headerdir)
* [headername](https://github.com/premake/premake-dlang/wiki/headername)

## C/C++ ##

* [flags](https://github.com/premake/premake-dlang/wiki/flags)
* CodeCoverage
* UnitTest
* Verbose
* Profile
* ProfileGC
* StackFrame
* StackStomp
* AllTemplateInst
* BetterC
* Main
* ShowCommandLine
* ShowTLS
* ShowGC
* IgnorePragma
* ShowDependencies
* [versionconstants](https://github.com/premake/premake-dlang/wiki/versionconstants)
* [debugconstants](https://github.com/premake/premake-dlang/wiki/debugconstants)
* [docdir](https://github.com/premake/premake-dlang/wiki/docdir)
* [docname](https://github.com/premake/premake-dlang/wiki/docname)
* [headerdir](https://github.com/premake/premake-dlang/wiki/headerdir)
* [headername](https://github.com/premake/premake-dlang/wiki/headername)
* dependenciesfile ("filename")
* jsonfile ("filename")
* importpaths { "paths" }
* stringimportpaths { "paths" }
* compilationmodel ("model") [ Project, Package, File ]
* importdirs { "paths" }
* [inlining](https://github.com/premake/premake-core/wiki/inlining)
* jsonfile ("filename")
* importdirs
* [optimize](https://github.com/premake/premake-core/wiki/optimize)
* preview
* revert
* runtime ("type") [ Debug, Release ]
* staticruntime ("state") [ on, off ]
* [optimize](https://github.com/premake/premake-core/wiki/optimize)
* [inlining](https://github.com/premake/premake-core/wiki/inlining)
* boundscheck ("type") [Off, SafeOnly, On]
* deprecatedfeatures ("feature") [ Error, Info, Allow ]
* stringimportdirs { "paths" }
* transition
* [versionconstants](https://github.com/premake/premake-dlang/wiki/versionconstants)
* [versionlevel](https://github.com/premake/premake-dlang/wiki/versionlevel)

### Example ###

The contents of your premake5.lua file would be:
Expand Down
174 changes: 101 additions & 73 deletions modules/d/_preload.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,25 +24,24 @@
api.addAllowed("floatingpoint", "None")
api.addAllowed("flags", {
"CodeCoverage",
"Deprecated", -- DEPRECATED
"Color",
"Documentation",
"GenerateHeader",
"GenerateJSON",
"GenerateMap",
"NoBoundsCheck", -- DEPRECATED
"LowMem",
"Profile",
"Quiet",
-- "Release", // Note: We infer this flag from config.isDebugBuild()
"RetainPaths",
"SeparateCompilation", -- DEPRECATED
"SymbolsLikeC",
"UnitTest",
-- These are used by C++/D mixed $todo move them somewhere else? "flags2" "Dflags"?
-- [Code Generation Flags]
"UseLDC",
"ProfileGC",
"StackFrame",
"StackStomp",
"AllTemplateInst",
"AllInstantiate",
"BetterC",
"Main",
"PerformSyntaxCheckOnly",
Expand All @@ -61,18 +60,54 @@
--

api.register {
name = "versionconstants",
name = "boundscheck",
scope = "config",
kind = "list:string",
tokens = true,
kind = "string",
allowed = {
"Default",
"Off",
"On",
"SafeOnly",
},
}

api.register {
name = "versionlevel",
name = "compilationmodel",
scope = "config",
kind = "integer",
kind = "string",
allowed = {
"Default",
"File",
"Package", -- TODO: this doesn't work with gmake!!
"Project",
},
}

api.register {
name = "checkaction",
scope = "config",
kind = "string",
allowed = {
"Default",
"D",
"C",
"Halt",
"Context",
},
}

api.register {
name = "computetargets",
scope = "config",
kind = "list:string",
}

-- api.register {
-- name = "debugcode",
-- scope = "config",
-- kind = "string",
-- }

api.register {
name = "debugconstants",
scope = "config",
Expand All @@ -86,6 +121,25 @@
kind = "integer",
}

api.register {
name = "dependenciesfile",
scope = "config",
kind = "path",
tokens = true,
}

api.register {
name = "deprecatedfeatures",
scope = "config",
kind = "string",
allowed = {
"Default",
"Allow",
"Warn",
"Error",
},
}

api.register {
name = "docdir",
scope = "config",
Expand Down Expand Up @@ -114,22 +168,11 @@
tokens = true,
}

-- api.register {
-- name = "debugcode",
-- scope = "config",
-- kind = "string",
-- }

api.register {
name = "compilationmodel",
name = "jsonfile",
scope = "config",
kind = "string",
allowed = {
"Default",
"File",
"Package", -- TODO: this doesn't work with gmake!!
"Project",
},
kind = "path",
tokens = true,
}

api.register {
Expand All @@ -140,48 +183,62 @@
}

api.register {
name = "stringimportdirs",
name = "preview",
scope = "config",
kind = "list:path",
tokens = true,
kind = "list:string",
allowed = {
"dip25",
"dip1000",
"dip1008",
"fieldwise",
"markdown",
"fixAliasThis",
"intpromote",
"dtorfields",
},
}

api.register {
name = "deprecatedfeatures",
name = "revert",
scope = "config",
kind = "string",
kind = "list:string",
allowed = {
"Default",
"Allow",
"Warn",
"Error",
"dip25",
"import",
},
}

api.register {
name = "boundscheck",
name = "stringimportdirs",
scope = "config",
kind = "string",
kind = "list:path",
tokens = true,
}

api.register {
name = "transition",
scope = "config",
kind = "list:string",
allowed = {
"Default",
"Off",
"On",
"SafeOnly",
"field",
"checkimports",
"complex",
"tls",
"vmarkdown",
},
}

api.register {
name = "dependenciesfile",
name = "versionconstants",
scope = "config",
kind = "path",
kind = "list:string",
tokens = true,
}

api.register {
name = "jsonfile",
name = "versionlevel",
scope = "config",
kind = "path",
tokens = true,
kind = "integer",
}

--
Expand All @@ -201,35 +258,6 @@
}


--
-- Deprecate old stuff
--

api.deprecateValue("flags", "SeparateCompilation", 'Use `compilationmodel "File"` instead',
function(value)
compilationmodel "File"
end,
function(value)
compilationmodel "Default"
end)

api.deprecateValue("flags", "Deprecated", 'Use `deprecatedfeatures "Allow"` instead',
function(value)
deprecatedfeatures "Allow"
end,
function(value)
deprecatedfeatures "Default"
end)

api.deprecateValue("flags", "NoBoundsCheck", 'Use `boundscheck "Off"` instead',
function(value)
boundscheck "Off"
end,
function(value)
boundscheck "Default"
end)


--
-- Decide when to load the full module
--
Expand Down
Loading