Skip to content

Commit e3d8e2f

Browse files
committed
Build and Link: Xcode screenshots
1 parent dce3108 commit e3d8e2f

File tree

5 files changed

+28
-4
lines changed

5 files changed

+28
-4
lines changed

css/libgit2.css

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1976,3 +1976,7 @@ tbody tr:last-child {
19761976
th, td {
19771977
padding: .5em 1em;
19781978
}
1979+
1980+
img {
1981+
max-width: 100%;
1982+
}

docs/guides/build-and-link/index.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,32 @@ You'll need to include `git2.h`, and link to the binaries you built previously.
6969
If you built libgit2 as a DLL (the default), you can bundle the produced DLL with your project, and use the `git2.dll` import library to have the linker load the DLL for you.
7070
Or you can write your own calls to `LoadLibrary`.
7171

72+
***TODO: Screenshots (add include path, library path, .lib)***
73+
7274
If libgit2 is built as a static library, just link in the `git2.lib` file.
7375

76+
## XCode
77+
78+
Your search paths will need to be modified to include the location of the libgit2 headers and binaries.
79+
In Xcode 5, open the project node, open the `Build Settings` tab, make sure all settings are shown, and look for `Header Search Paths`:
80+
81+
[![Xcode Screenshot](xcode-headers.png)](xcode-headers.png)
82+
83+
If you're working from a source distribution, the include path to add is `/path/to/libgit2/include`, and the library path is `/path/to/libgit2/build`.
84+
You can add this to the target or the entire project.
85+
86+
Next you'll have to link to the right binary library.
87+
Switch to the "Build Phases" tab, and under `Link Binary With Libraries`, click the "+":
88+
89+
[![XCode Screenshot](xcode-link1.png)](xcode-link1.png)
90+
91+
Then select "Add Other…":
92+
93+
[![Xcode Screenshot](xcode-link2.png)](xcode-link2.png)
94+
95+
Browse to the location where the libgit2 binaries are located (if you're working from source, this is `/path/to/libgit2/build`), select the `libgit2.dylib` file, and click OK.
96+
97+
7498
## Makefiles
7599

76100
The binaries that are output from the build are dependent on the build system you're using.
@@ -84,7 +108,3 @@ CFLAGS += -I/path/to/libgit2/include
84108
LDFLAGS += -L/path/to/libgit2/binaries
85109
LIBRARIES += -lgit2
86110
```
87-
88-
## XCode
89-
90-
***TODO***
115 KB
Loading
81.3 KB
Loading
57.3 KB
Loading

0 commit comments

Comments
 (0)