Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 53 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ jobs:
make -j3 wallet cryptonote_protocol
cd ../../../../

- name: Build monero-cpp
- name: Build monero-cpp shared library
run: |
mkdir -p build
cd build
Expand All @@ -68,12 +68,28 @@ jobs:
make -j3
cd ..

- name: Upload artifacts
- name: Upload monero-cpp shared library
uses: actions/upload-artifact@v7
with:
name: libmonero-cpp-linux-amd64
path: build/libmonero-cpp.so

- name: Build monero-cpp static library
run: |
rm -rf build
mkdir -p build
cd build
cmake -DSTATIC=ON ..
cmake --build .
make -j3
cd ..

- name: Upload monero-cpp static library
uses: actions/upload-artifact@v7
with:
name: libmonero-cpp-linux-amd64-static
path: build/libmonero-cpp.a

windows:
name: windows
runs-on: windows-latest
Expand Down Expand Up @@ -140,7 +156,7 @@ jobs:
../../
make wallet cryptonote_protocol

- name: Build monero-cpp
- name: Build monero-cpp shared library
shell: msys2 {0}
run: |
mkdir -p build
Expand All @@ -149,14 +165,29 @@ jobs:
cmake --build .
cd ..

- name: Upload artifacts
- name: Upload monero-cpp shared library
uses: actions/upload-artifact@v7
with:
name: libmonero-cpp-win-x64
path: |
build/libmonero-cpp.dll
build/libmonero-cpp.dll.a

- name: Build monero-cpp static library
run: |
rm -rf build
mkdir -p build
cd build
cmake -DSTATIC=ON ..
cmake --build .
cd ..

- name: Upload monero-cpp static library
uses: actions/upload-artifact@v7
with:
name: libmonero-cpp-win-x64-static
path: build/libmonero-cpp.a

mac-os:
name: ${{ matrix.os }}
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -187,7 +218,7 @@ jobs:
make -j3 wallet cryptonote_protocol
cd ../../../../

- name: Build monero-cpp
- name: Build monero-cpp shared library
run: |
mkdir -p build
cd build
Expand All @@ -196,8 +227,24 @@ jobs:
make -j3
cd ..

- name: Upload artifacts
- name: Upload monero-cpp shared library
uses: actions/upload-artifact@v7
with:
name: libmonero-cpp-${{ matrix.os }}
path: build/libmonero-cpp.dylib

- name: Build monero-cpp static library
run: |
rm -rf build
mkdir -p build
cd build
cmake -DSTATIC=ON ..
cmake --build .
make -j3
cd ..

- name: Upload monero-cpp static library
uses: actions/upload-artifact@v7
with:
name: libmonero-cpp-${{ matrix.os }}-archive
path: build/libmonero-cpp.a
9 changes: 8 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ endif()
project(MoneroCppLibrary)

option(BUILD_LIBRARY "Build monero-cpp library" ON)
option(STATIC "Build monero-cpp static library" OFF)
option(BUILD_SAMPLE "Build c++ sample code" OFF)
option(BUILD_SCRATCHPAD "Build c++ scratchpad" OFF)
option(BUILD_TESTS "Builc c++ tests" OFF)
Expand Down Expand Up @@ -297,7 +298,13 @@ set(
)

if (BUILD_LIBRARY)
add_library(monero-cpp SHARED ${LIBRARY_SRC_FILES})
if (STATIC)
message(STATUS "Building static monero-cpp library")
add_library(monero-cpp STATIC ${LIBRARY_SRC_FILES})
else()
message(STATUS "Building shared monero-cpp library")
add_library(monero-cpp SHARED ${LIBRARY_SRC_FILES})
endif()

target_include_directories(monero-cpp PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/include
Expand Down
Loading