diff --git a/driver/ldmd.cpp b/driver/ldmd.cpp index 339b7db3..344155d5 100644 --- a/driver/ldmd.cpp +++ b/driver/ldmd.cpp @@ -732,6 +732,7 @@ void buildCommandLine(std::vector& r, const Params& p) if (p.allowDeprecated) r.push_back("-d"); if (p.compileOnly) r.push_back("-c"); if (p.coverage) warning("Coverage report generation not yet supported by LDC."); + if (p.emitSharedLib) r.push_back("-shared"); if (p.pic) r.push_back("-relocation-model=pic"); if (p.emitMap) warning("Map file generation not yet supported by LDC."); if (!p.multiObj) r.push_back("--singleobj"); @@ -764,6 +765,7 @@ void buildCommandLine(std::vector& r, const Params& p) if (p.emitStaticLib) r.push_back("-lib"); if (p.noFloat) warning("-nofloat is ignored by LDC."); if (p.quiet) r.push_back("-quiet"); // Undocumented. + if (p.release) r.push_back("-release"); // Also disables boundscheck. if (p.noBoundsChecks) r.push_back("-disable-boundscheck"); if (p.emitUnitTests) r.push_back("-unittest"); pushSwitches("-I=", p.modulePaths, r); diff --git a/tests/d2/CMakeLists.txt b/tests/d2/CMakeLists.txt index 733571ff..e72298a2 100644 --- a/tests/d2/CMakeLists.txt +++ b/tests/d2/CMakeLists.txt @@ -18,10 +18,13 @@ get_property(ldmd_path TARGET ldmd2 PROPERTY LOCATION) add_test(NAME dmd-testsuite-debug WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests/d2/dmd-testsuite - COMMAND make RESULTS_DIR=${CMAKE_BINARY_DIR}/dmd-testsuite-debug DMD=${ldmd_path} DFLAGS="-gc" MODEL=${DMD_TEST_MODEL} quick + COMMAND make RESULTS_DIR=${CMAKE_BINARY_DIR}/dmd-testsuite-debug DMD=${ldmd_path} DFLAGS=-gc MODEL=${DMD_TEST_MODEL} quick ) +# Would like to specify the "-release" flag here, but some of the tests (e.g. +# 'testdstress') depend on contracts and invariants being active. Need a solution +# integrated with d_do_test. add_test(NAME dmd-testsuite-release WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}/tests/d2/dmd-testsuite - COMMAND make RESULTS_DIR=${CMAKE_BINARY_DIR}/dmd-testsuite-release DMD=${ldmd_path} DFLAGS=-O3\ -release MODEL=${DMD_TEST_MODEL} quick + COMMAND make RESULTS_DIR=${CMAKE_BINARY_DIR}/dmd-testsuite-release DMD=${ldmd_path} DFLAGS=-O3 MODEL=${DMD_TEST_MODEL} quick )