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

rdmd: Support -shared in the same way as -lib #458

Merged
merged 2 commits into from
May 1, 2023

Conversation

CyberShadow
Copy link
Member

@CyberShadow CyberShadow commented May 1, 2023

@dlang-bot
Copy link
Contributor

Thanks for your pull request, @CyberShadow!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + tools#458"

rdmd.d Outdated
@@ -27,13 +27,15 @@ version (Posix)
enum objExt = ".o";
enum binExt = "";
enum libExt = ".a";
enum dllExt = ".so";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be .dylib when built on Mac, otherwise looks good

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, fixed.

rdmd.d Outdated
@@ -360,7 +367,7 @@ size_t indexOfProgram(string[] args)
{
auto arg = args[i];
if (!arg.startsWith('-', '@') &&
!arg.endsWith(".obj", ".o", ".lib", ".a", ".def", ".map", ".res") &&
!arg.endsWith(".obj", ".o", ".lib", ".a", ".dll", ".so", ".def", ".map", ".res") &&
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto

@@ -0,0 +1,3 @@
rdmd supports `-shared`

rdmd now understands DMD's `-shared` switch, and sets the default output file name appropriately (`.dll` or `so` depending on the platform), in the same way as `-lib`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I missed one on the changelog too, not that it really matters.

Feel free to merge when green.

@dlang-bot dlang-bot merged commit dfe32a6 into dlang:master May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RDMD should use platform shared library file extension for file name if -shared is used
4 participants