Giter VIP home page Giter VIP logo

Comments (3)

CyberShadow avatar CyberShadow commented on July 22, 2024 1

Please try this patch:

From 0b0c1d5e1973da30910a52f88022f79479fca7dc Mon Sep 17 00:00:00 2001
From: Vladimir Panteleev <[email protected]>
Date: Sun, 30 Apr 2023 06:25:17 +0000
Subject: [PATCH] rdmd: Support -shared in the same way as -lib

---
 rdmd.d | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/rdmd.d b/rdmd.d
index d02cacc..5eeb373 100755
--- a/rdmd.d
+++ b/rdmd.d
@@ -27,6 +27,7 @@ version (Posix)
     enum objExt = ".o";
     enum binExt = "";
     enum libExt = ".a";
+    enum dllExt = ".so";
     enum altDirSeparator = "";
 }
 else version (Windows)
@@ -34,6 +35,7 @@ else version (Windows)
     enum objExt = ".obj";
     enum binExt = ".exe";
     enum libExt = ".lib";
+    enum dllExt = ".dll";
     enum altDirSeparator = "/";
 }
 else
@@ -242,10 +244,15 @@ int main(string[] args)
 
     bool obj = compilerFlags.canFind("-c");
     bool lib = compilerFlags.canFind("-lib");
-    string outExt = lib ? libExt : obj ? objExt : binExt;
+    bool dll = compilerFlags.canFind("-shared");
+    string outExt =
+        dll ? dllExt :
+        lib ? libExt :
+        obj ? objExt :
+        binExt;
 
-    // Assume --build-only for -c and -lib.
-    buildOnly |= obj || lib;
+    // Assume --build-only for -c / -lib / -shared.
+    buildOnly |= obj || lib || dll;
 
     // --build-only implies the user would like a binary in the program's directory
     if (buildOnly && !exe.ptr)
@@ -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") &&
                 args[i - 1] != "--eval")
         {
             return i;
-- 
2.40.0

from tools.

AndrejMitrovic avatar AndrejMitrovic commented on July 22, 2024

Seems to do the trick!

@CyberShadow could you PR this?

from tools.

CyberShadow avatar CyberShadow commented on July 22, 2024

OK, here it is: #458

from tools.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.