-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathdub.sdl
25 lines (22 loc) · 1.78 KB
/
dub.sdl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
name "sqlite3d"
description "SQLite as a D package"
license "public domain"
copyright "The SQLite library, as well as this package are in the public domain"
targetType "library"
extraDependecyFiles "sqlite3.c"
# Build with MSVC on Windows
preBuildCommands "cl /nologo /Ox /MT /c ${SQLITE3D_PACKAGE_DIR}/sqlite3.c /Fo:sqlite3-${ARCH}.obj" platform="windows"
sourceFiles "sqlite3-${ARCH}.obj" platform="windows"
libs "kernel32" platform="windows"
# Use Clang on all other systems
# Linux
preBuildCommands "clang -c ${SQLITE3D_PACKAGE_DIR}/sqlite3.c --target=i386 -fPIC -o sqlite3-${PLATFORM}-${ARCH}.o" platform="linux-x86"
preBuildCommands "clang -c ${SQLITE3D_PACKAGE_DIR}/sqlite3.c --target=x86_64 -fPIC -o sqlite3-${PLATFORM}-${ARCH}.o" platform="linux-x86_64"
preBuildCommands "clang -c ${SQLITE3D_PACKAGE_DIR}/sqlite3.c --target=arm64 -fPIC -o sqlite3-${PLATFORM}-${ARCH}.o" platform="linux-aarch64"
# macOS
preBuildCommands "xcrun clang -isysroot \"`xcrun --show-sdk-path`\" -c \"${SQLITE3D_PACKAGE_DIR}/sqlite3.c\" --target=x86_64-apple-darwin -fPIC -o sqlite3-${PLATFORM}-${ARCH}.o" platform="osx-x86_64"
preBuildCommands "xcrun clang -isysroot \"`xcrun --show-sdk-path`\" -c \"${SQLITE3D_PACKAGE_DIR}/sqlite3.c\" --target=arm64-apple-darwin -fPIC -o sqlite3-${PLATFORM}-${ARCH}.o" platform="osx-aarch64"
# iOS
preBuildCommands "xcrun clang -isysroot \"`xcrun --show-sdk-path --sdk iphonesimulator`\" -c \"${SQLITE3D_PACKAGE_DIR}/sqlite3.c\" --target=x86_64-apple-ios-simulator -fPIC -o sqlite3-${PLATFORM}-${ARCH}.o" platform="ios-x86_64"
preBuildCommands "xcrun clang -isysroot \"`xcrun --show-sdk-path --sdk iphoneos`\" -c \"${SQLITE3D_PACKAGE_DIR}/sqlite3.c\" --target=arm64-apple-ios -fPIC -o sqlite3-${PLATFORM}-${ARCH}.o" platform="ios-aarch64"
sourceFiles "sqlite3-${PLATFORM}-${ARCH}.o" platform="posix"