diff --git a/source/dub/compilers/buildsettings.d b/source/dub/compilers/buildsettings.d index e909c4f..ef7ee14 100644 --- a/source/dub/compilers/buildsettings.d +++ b/source/dub/compilers/buildsettings.d @@ -82,6 +82,12 @@ return ret; } + /** + * Merges $(LREF bs) onto `this` BuildSettings instance. This is called for + * sourceLibrary dependencies when they are included in the build to be + * merged into the root package build settings as well as configuring + * targets for different build types such as release or unittest-cov. + */ void add(in BuildSettings bs) { addDFlags(bs.dflags); @@ -89,6 +95,7 @@ addLibs(bs.libs); addLinkerFiles(bs.linkerFiles); addSourceFiles(bs.sourceFiles); + addInjectSourceFiles(bs.injectSourceFiles); addCopyFiles(bs.copyFiles); addExtraDependencyFiles(bs.extraDependencyFiles); addVersions(bs.versions); @@ -105,6 +112,17 @@ addPostBuildCommands(bs.postBuildCommands); addPreRunCommands(bs.preRunCommands); addPostRunCommands(bs.postRunCommands); + addEnvironments(bs.environments); + addBuildEnvironments(bs.buildEnvironments); + addRunEnvironments(bs.runEnvironments); + addPreGenerateEnvironments(bs.preGenerateEnvironments); + addPostGenerateEnvironments(bs.postGenerateEnvironments); + addPreBuildEnvironments(bs.preBuildEnvironments); + addPostBuildEnvironments(bs.postBuildEnvironments); + addPreRunEnvironments(bs.preRunEnvironments); + addPostRunEnvironments(bs.postRunEnvironments); + addRequirements(bs.requirements); + addOptions(bs.options); } void addDFlags(in string[] value...) { dflags = chain(dflags, value.dup).uniq.array; } diff --git a/test/4-describe-data-1-list.sh b/test/4-describe-data-1-list.sh index 630b609..58f5293 100755 --- a/test/4-describe-data-1-list.sh +++ b/test/4-describe-data-1-list.sh @@ -122,16 +122,18 @@ # --data=requirements echo "allowWarnings" >> "$expected_file" echo "disallowInlining" >> "$expected_file" -#echo "requireContracts" >> "$expected_file" # Not sure if this (from a sourceLib dependency) should be missing from the result +echo "requireContracts" >> "$expected_file" echo >> "$expected_file" # --data=options echo "debugMode" >> "$expected_file" -echo "releaseMode" >> "$expected_file" +# releaseMode is not included, even though it's specified, because the requireContracts requirement drops it echo "debugInfo" >> "$expected_file" +echo "stackStomping" >> "$expected_file" echo "warnings" >> "$expected_file" -#echo "stackStomping" >> "$expected_file" # Not sure if this (from a sourceLib dependency) should be missing from the result if ! diff "$expected_file" "$temp_file"; then + echo "Result:" + cat "$temp_file" die $LINENO 'The project data did not match the expected output!' fi diff --git a/test/4-describe-data-2-dmd.sh b/test/4-describe-data-2-dmd.sh index bf3c1da..7d994dc 100755 --- a/test/4-describe-data-2-dmd.sh +++ b/test/4-describe-data-2-dmd.sh @@ -72,10 +72,10 @@ echo -n "'$CURR_DIR/describe-dependency-2/some-path/dummy.d' " >> "$expected_file" # --data=options echo -n "-debug " >> "$expected_file" -echo -n "-release " >> "$expected_file" +# releaseMode is not included, even though it's specified, because the requireContracts requirement drops it echo -n "-g " >> "$expected_file" +echo -n "-gx " >> "$expected_file" echo -n "-wi" >> "$expected_file" -#echo -n "-gx " >> "$expected_file" # Not sure if this (from a sourceLib dependency) should be missing from the result echo "" >> "$expected_file" if ! diff "$expected_file" "$temp_file"; then