diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java | 8 | ||||
-rw-r--r-- | src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java index c31f6ab688..061e6fea73 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CcBinary.java @@ -185,9 +185,11 @@ public abstract class CcBinary implements RuleConfiguredTargetFactory { // if cc_binary includes "linkshared=1", then gcc will be invoked with // linkopt "-shared", which causes the result of linking to be a shared // library. In this case, the name of the executable target should end - // in ".so". - PathFragment binaryPath = - new PathFragment(ruleContext.getTarget().getName() + OsUtils.executableExtension()); + // in ".so" or "dylib" or ".dll". + PathFragment binaryPath = new PathFragment(ruleContext.getTarget().getName()); + if (!isLinkShared(ruleContext)) { + binaryPath = new PathFragment(binaryPath.getPathString() + OsUtils.executableExtension()); + } Artifact binary = ruleContext.getPackageRelativeArtifact( binaryPath, ruleContext.getConfiguration().getBinDirectory()); CppLinkAction.Builder linkActionBuilder = diff --git a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java index c3bd853ff6..ef6e7a1570 100644 --- a/src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java +++ b/src/main/java/com/google/devtools/build/lib/rules/cpp/CppFileTypes.java @@ -116,7 +116,7 @@ public final class CppFileTypes { }; - public static final FileType SHARED_LIBRARY = FileType.of(".so", ".dylib"); + public static final FileType SHARED_LIBRARY = FileType.of(".so", ".dylib", ".dll"); public static final FileType INTERFACE_SHARED_LIBRARY = FileType.of(".ifso"); public static final FileType LINKER_SCRIPT = FileType.of(".ld", ".lds", ".ldscript"); // Matches shared libraries with version names in the extension, i.e. |