Skip to content

Commit

Permalink
feat: Test Dub on macOS-14 / arm64
Browse files Browse the repository at this point in the history
  • Loading branch information
Geod24 committed Jan 2, 2025
1 parent 8a89446 commit 560788d
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ jobs:
- { dc: ldc-latest, do_test: true }
- { dc: dmd-master, do_test: true }
- { dc: ldc-master, do_test: true }
# Test on ARM64
- { os: macOS-14, dc: ldc-latest, do_test: true }
exclude:
# Error with those versions:
# ld: multiple errors: symbol count from symbol table and dynamic symbol table differ in [.../dub.o]; address=0x0 points to section(2) with no content in '[...]/osx/lib/libphobos2.a[3177](config_a68_4c3.o)'
Expand Down
12 changes: 11 additions & 1 deletion source/dub/compilers/dmd.d
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,20 @@ config /etc/dmd.conf
version (LDC) unittest {
import std.conv : to;

version (ARM)
enum isARM = true;
version (AArch64)
enum isARM = true;
else
enum isARM = false;

BuildSettings settings;
auto compiler = new DMDCompiler;
auto bp = compiler.determinePlatform(settings, "ldmd2", "x86");
assert(bp.architecture.canFind("x86"), bp.architecture.to!string);
static if (isARM)
assert(bp.architecture.canFind("arm"), bp.architecture.to!string);
else
assert(bp.architecture.canFind("x86"), bp.architecture.to!string);
bp = compiler.determinePlatform(settings, "ldmd2", "");
version (X86) assert(bp.architecture.canFind("x86"), bp.architecture.to!string);
version (X86_64) assert(bp.architecture.canFind("x86_64"), bp.architecture.to!string);
Expand Down

0 comments on commit 560788d

Please sign in to comment.