diff --git a/source/dub/compilers/compiler.d b/source/dub/compilers/compiler.d index c08d664..57b72f8 100644 --- a/source/dub/compilers/compiler.d +++ b/source/dub/compilers/compiler.d @@ -55,7 +55,9 @@ string alternative; } static immutable SpecialFlag[] s_specialFlags = [ - {["-c", "-o-", "-property", "-fproperty", "-w", "-Wall", "-Werr"], "Automatically issued by DUB, do not specify in package.json"}, + {["-c", "-o-"], "Automatically issued by DUB, do not specify in package.json"}, + {[ "-w", "-Wall", "-Werr"], `Use "buildRequirements" to control warning behavior`}, + {["-property", "-fproperty"], "Using this flag may break building of dependencies and it will probably be removed from DMD in the future"}, {["-wi"], `Use the "buildRequirements" field to control warning behavior`}, {["-d", "-de", "-dw"], `Use the "buildRequirements" field to control deprecation behavior`}, {["-of"], `Use "targetPath" and "targetName" to customize the output file`}, @@ -325,7 +327,7 @@ disallowOptimization = 1<<5, /// Avoid optimizations, even in release builds requireBoundsCheck = 1<<6, /// Always perform bounds checks requireContracts = 1<<7, /// Leave assertions and contracts enabled in release builds - relaxProperties = 1<<8, /// Do not enforce strict property handling (-property) + relaxProperties = 1<<8, /// DEPRECATED: Do not enforce strict property handling (-property) noDefaultFlags = 1<<9, /// Do not issue any of the default build flags (e.g. -debug, -w, -property etc.) - use only for development purposes } diff --git a/source/dub/generators/build.d b/source/dub/generators/build.d index 83abc83..792eea4 100644 --- a/source/dub/generators/build.d +++ b/source/dub/generators/build.d @@ -45,7 +45,7 @@ auto buildsettings = settings.buildSettings; m_project.addBuildSettings(buildsettings, settings.platform, settings.config); bool usedefflags = !(buildsettings.requirements & BuildRequirements.noDefaultFlags); - if (usedefflags) buildsettings.addDFlags(["-w", "-property"]); + if (usedefflags) buildsettings.addDFlags(["-w"]); string dflags = environment.get("DFLAGS"); if( dflags.length ){ settings.buildType = "$DFLAGS"; diff --git a/source/dub/generators/rdmd.d b/source/dub/generators/rdmd.d index 8e6f52e..ebfd85d 100644 --- a/source/dub/generators/rdmd.d +++ b/source/dub/generators/rdmd.d @@ -49,7 +49,7 @@ bool usedefflags = !(buildsettings.requirements & BuildRequirements.noDefaultFlags); // do not pass all source files to RDMD, only the main source file buildsettings.sourceFiles = buildsettings.sourceFiles.filter!(s => !s.endsWith(".d"))().array(); - if (usedefflags) buildsettings.addDFlags(["-w", "-property"]); + if (usedefflags) buildsettings.addDFlags(["-w"]); string dflags = environment.get("DFLAGS"); if( dflags ){ settings.buildType = "$DFLAGS"; diff --git a/source/dub/package_.d b/source/dub/package_.d index 73c7108..ed9a4c1 100644 --- a/source/dub/package_.d +++ b/source/dub/package_.d @@ -556,9 +556,16 @@ void warnOnSpecialCompilerFlags(string package_name, string config_name) { auto nodef = false; - foreach (req; this.buildRequirements) - if (req & BuildRequirements.noDefaultFlags) - nodef = true; + auto noprop = false; + foreach (req; this.buildRequirements) { + if (req & BuildRequirements.noDefaultFlags) nodef = true; + if (req & BuildRequirements.relaxProperties) noprop = true; + } + + if (noprop) { + logWarn(`Warning: "buildRequirements": ["relaxProperties"] is deprecated and is now the default behavior. Note that the -property switch will probably be removed in future versions of DMD.`); + logWarn(""); + } if (nodef) { logWarn("Warning: This package uses the \"noDefaultFlags\" build requirement. Please use only for development purposes and not for released packages.");