You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-22Lines changed: 34 additions & 22 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,47 +33,59 @@ This is a Swift rewrite and modernisation of [martinrybak/SQLClient](https://git
33
33
| tvOS | 16.0 |
34
34
| Xcode | 15.0 |
35
35
| Swift | 5.9 |
36
+
| PKG-Config | 0.29+ (macOS) |
36
37
| FreeTDS | 1.0 (1.5 recommended) |
37
38
38
39
---
39
40
40
41
## Installation
41
42
42
-
### Swift Package Manager
43
+
> **Note for macOS:** If you encounter compilation errors like `'sybdb.h' file not found`, you need to configure `pkg-config` to correctly link your FreeTDS installation. See [PKG-Config Configuration](#pkg-config-configuration) below.
Or in Xcode: **File → Add Package Dependencies…** and enter the repository URL.
57
+
**iOS / custom build:** Use a pre-compiled `libsybdb.a` (e.g. from [FreeTDS-iOS](https://github.com/patchhf/FreeTDS-iOS)) and link it manually in your Xcode target under **Build Phases → Link Binary With Libraries**, along with `libiconv.tbd`.
58
+
59
+
### PKG-Config Configuration (macOS)
61
60
62
-
### Install FreeTDS
61
+
For systems that do not natively include `pkg-config` or where Homebrew does not provide a `.pc` file for FreeTDS (common on macOS), extra steps are required.
63
62
64
-
SQLClient-Swift wraps FreeTDS — you need the native library present at build time.
63
+
**1. Install pkg-config**
65
64
66
-
**macOS (Homebrew):**
67
65
```bash
68
-
brew install freetds
66
+
brew install pkg-config
69
67
```
70
68
71
-
**Linux (apt):**
69
+
**2. Configure freetds.pc**
70
+
71
+
A `freetds.pc` file is provided in the `ci/` folder of this repository. You need to make this file available to `pkg-config`.
**iOS / custom build:** Use a pre-compiled `libsybdb.a` (e.g. from [FreeTDS-iOS](https://github.com/patchhf/FreeTDS-iOS)) and link it manually in your Xcode target under **Build Phases → Link Binary With Libraries**, along with `libiconv.tbd`.
79
+
**Option B: Copy to system path**
80
+
Copy the file to your system's pkg-config directory:
81
+
```bash
82
+
cp ci/freetds.pc /usr/local/lib/pkgconfig/
83
+
```
84
+
85
+
**Note on Intel vs Apple Silicon:**
86
+
The provided `ci/freetds.pc` is configured for Apple Silicon (`/opt/homebrew`). If you are on an **Intel Mac**, edit the `prefix` line in the file:
0 commit comments