-
-
Notifications
You must be signed in to change notification settings - Fork 228
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
68 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
DIR=$(dirname "${BASH_SOURCE[0]}") | ||
. "$DIR"/common.sh | ||
|
||
if [[ "$DC" != ldc* ]]; then | ||
echo "Skipping test, needs LDC" | ||
exit 0 | ||
fi | ||
|
||
# enforce a full build (2 static libs, 1 dynamic one) and collect -v output | ||
output=$("$DUB" build -v -f --root "$DIR"/dynLib-monolith) | ||
|
||
if [[ $(grep -c -- '-fvisibility=hidden' <<<"$output") -ne 3 ]]; then | ||
die $LINENO "Didn't find 3 occurrences of '-fvisibility=hidden' in the verbose dub output!" "$output" | ||
fi |
Empty file.
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
name "dynlib-monolith" | ||
description "A 'monolithic' dynamic library, linking all dependencies statically (except for shared druntime/Phobos) and exporting select symbols explicitly via 'export'" | ||
targetType "dynamicLibrary" | ||
dependency "inner_dep" path="inner_dep" | ||
|
||
# With LDC, `-fvisibility=hidden` is passed down for compiling all dependencies. | ||
dflags "-fvisibility=hidden" platform="ldc" | ||
dflags "-fvisibility=hidden" platform="gdc" | ||
# not supported by DMD | ||
|
||
# With LDC on Windows, code ending up in a DLL is compiled with | ||
# `-fvisibility=public -dllimport=all` by default. So we additionally need | ||
# to override `-dllimport` to use the shared druntime/Phobos DLLs (used by | ||
# default for dynamic libraries), which is also passed down to all deps: | ||
dflags "-dllimport=defaultLibsOnly" platform="windows-ldc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
name "inner_dep" | ||
description "A static library depending on another static library" | ||
targetType "staticLibrary" | ||
dependency "staticlib-simple" path="../../1-staticLib-simple" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module inner_dep.mod; | ||
|
||
void innerDepFunction() | ||
{ | ||
import staticlib.app; | ||
entry(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module library; | ||
|
||
export void foo() | ||
{ | ||
import inner_dep.mod; | ||
innerDepFunction(); | ||
} |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
name "exe-shared-defaultlib" | ||
description "An executable with a statically linked dep, linked against *shared* druntime/Phobos" | ||
targetType "executable" | ||
dependency "staticlib-simple" path="../1-staticLib-simple/" | ||
|
||
# With LDC on Windows, `-link-defaultlib-shared` is passed down for compiling | ||
# staticlib-simple (for an implicit `-dllimport=defaultLibsOnly`). | ||
dflags "-link-defaultlib-shared" platform="ldc" | ||
|
||
# no libphobos2.dll/dylib with DMD on Windows/Mac | ||
dflags "-defaultlib=libphobos2.so" platform="linux-dmd" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module app; | ||
import staticlib.app; | ||
|
||
void main() | ||
{ | ||
entry(); | ||
} |