Skip to content

Commit

Permalink
Add documentation for building upstream dependencies
Browse files Browse the repository at this point in the history
Fix libtinfow include
  • Loading branch information
MrCyjaneK committed Feb 19, 2025
1 parent 65608c0 commit 1758973
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 1 deletion.
3 changes: 2 additions & 1 deletion contrib/depends/toolchain.cmake.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
cmake_minimum_required(VERSION 3.13) # Ensure CMake version supports CMP0077
cmake_policy(SET CMP0077 NEW) # Ensure 'option' honors normal variables
cmake_policy(SET CMP0148 OLD) # Use FindPythonInterp

# Set the system name to one of Android, Darwin, iOS, FreeBSD, Linux, or Windows
SET(CMAKE_SYSTEM_NAME @depends@)
Expand Down Expand Up @@ -27,7 +28,7 @@ SET(ENV{PKG_CONFIG_PATH} @prefix@/lib/pkgconfig)
SET(Readline_ROOT_DIR @prefix@)
SET(Readline_INCLUDE_DIR @prefix@/include)
SET(Readline_LIBRARY @prefix@/lib/libreadline.a)
SET(Terminfo_LIBRARY @prefix@/lib/libtinfo.a)
SET(Terminfo_LIBRARY @prefix@/lib/libtinfow.a)

SET(UNBOUND_INCLUDE_DIR @prefix@/include)
SET(UNBOUND_LIBRARIES @prefix@/lib/libunbound.a)
Expand Down
1 change: 1 addition & 0 deletions docs/Writerside/in.tree
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,5 @@
<toc-element topic="Windows.md"/>
<toc-element topic="macOS.md"/>
</toc-element>
<toc-element topic="Building-Upstream.md"/>
</instance-profile>
35 changes: 35 additions & 0 deletions docs/Writerside/topics/Building-Upstream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Building Upstream

monero_c contains its own fork of contrib/depends system that is independent of monero, wownero or zano. In order to use said build system one needs to:

```
pushd contrib/depends
env -i \
PATH="$PATH" \
CC=gcc CXX=g++ \
make -j$(nproc) HOST=aarch64-apple-darwin
popd
```

Then, get path to your desired toolchain.cmake

```
TOOLCHAIN_FILE=${PWD}/contrib/depends/aarch64-apple-darwin/share/toolchain.cmake
```
And finally use that as part of cmake invocation, for example to compile monero you can do the following:

```
pushd monero
mkdir -p build/aarch64-apple-darwin
cd $_
cmake \
-DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE" \
-DBUILD_TESTS=ON \
../..
```

From there you can build targets such as wallet_api

```
make wallet_api -j$(nproc)
```

0 comments on commit 1758973

Please sign in to comment.