mirror of
https://codeberg.org/wownero/wownero-lws
synced 2026-01-09 23:25:16 -08:00
Add optional support for git submodule building (#172)
This commit is contained in:
committed by
Lee *!* Clagett
parent
448c6740f4
commit
d382c73b51
34
.github/workflows/build-ubuntu.yml
vendored
34
.github/workflows/build-ubuntu.yml
vendored
@@ -14,8 +14,40 @@ env:
|
|||||||
echo "Acquire::Retries \"3\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
|
echo "Acquire::Retries \"3\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
|
||||||
echo "Acquire::http::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
|
echo "Acquire::http::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
|
||||||
echo "Acquire::ftp::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
|
echo "Acquire::ftp::Timeout \"120\";" | sudo tee -a /etc/apt/apt.conf.d/80-custom
|
||||||
|
BREW_INSTALL_MAC: 'HOMEBREW_NO_AUTO_UPDATE=1 brew install boost hidapi openssl zmq libpgm miniupnpc expat libunwind-headers protobuf unbound'
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
build-beginner:
|
||||||
|
runs-on: ${{matrix.os}}
|
||||||
|
strategy:
|
||||||
|
fail-fast: false
|
||||||
|
matrix:
|
||||||
|
os: [ubuntu-latest, macos-latest]
|
||||||
|
steps:
|
||||||
|
- name: set apt conf (Debian base Linux)
|
||||||
|
if: matrix.os == 'ubuntu-latest'
|
||||||
|
run: ${{env.APT_SET_CONF}}
|
||||||
|
- name: update apt (Debian based Linux)
|
||||||
|
if: matrix.os == 'ubuntu-latest'
|
||||||
|
run: sudo apt update
|
||||||
|
- name: Install dependencies (Debian based Linux)
|
||||||
|
if: matrix.os == 'ubuntu-latest'
|
||||||
|
run: ${{env.APT_INSTALL_LINUX}}
|
||||||
|
- name: Install dependencies (MacOS)
|
||||||
|
if: matrix.os == 'macos-latest'
|
||||||
|
run: ${{env.BREW_INSTALL_MAC}}
|
||||||
|
- name: Checkout LWS Source
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
path: ${{github.workspace}}/lws
|
||||||
|
submodules: recursive
|
||||||
|
- name: Configure LWS
|
||||||
|
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
|
||||||
|
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
|
||||||
|
run: cmake -B ${{github.workspace}}/lws/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} ${{github.workspace}}/lws
|
||||||
|
- name: Build LWS
|
||||||
|
# Build your program with the given configuration
|
||||||
|
run: (cd ${{github.workspace}}/lws/build && make -j$(nproc))
|
||||||
build-tests:
|
build-tests:
|
||||||
runs-on: ${{matrix.os}}
|
runs-on: ${{matrix.os}}
|
||||||
strategy:
|
strategy:
|
||||||
@@ -39,7 +71,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Install dependencies (MacOS)
|
- name: Install dependencies (MacOS)
|
||||||
if: matrix.os == 'macos-latest' || matrix.os == 'macos-13' || matrix.os == 'macos-14'
|
if: matrix.os == 'macos-latest' || matrix.os == 'macos-13' || matrix.os == 'macos-14'
|
||||||
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install boost hidapi openssl zmq libpgm miniupnpc expat libunwind-headers protobuf
|
run: ${{env.BREW_INSTALL_MAC}}
|
||||||
- name: Install RabbitMQ iff WITH_RMQ (MacOS)
|
- name: Install RabbitMQ iff WITH_RMQ (MacOS)
|
||||||
if: matrix.rmq == 'WITH_RMQ=ON' && (matrix.os == 'macos-latest' || matrix.os == 'macos-13' || matrix.os == 'macos-14')
|
if: matrix.rmq == 'WITH_RMQ=ON' && (matrix.os == 'macos-latest' || matrix.os == 'macos-13' || matrix.os == 'macos-14')
|
||||||
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install rabbitmq-c
|
run: HOMEBREW_NO_AUTO_UPDATE=1 brew install rabbitmq-c
|
||||||
|
|||||||
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "external/monero"]
|
||||||
|
path = external/monero
|
||||||
|
url = https://github.com/monero-project/monero.git
|
||||||
@@ -41,6 +41,14 @@ if (WITH_RMQ)
|
|||||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMLWS_RMQ_ENABLED")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DMLWS_RMQ_ENABLED")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(STATIC)
|
||||||
|
if(MSVC)
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll.a .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
|
else()
|
||||||
|
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
set(MONERO_LIBRARIES
|
set(MONERO_LIBRARIES
|
||||||
daemon_messages
|
daemon_messages
|
||||||
serialization
|
serialization
|
||||||
@@ -64,10 +72,11 @@ set(MONERO_LIBRARIES
|
|||||||
easylogging
|
easylogging
|
||||||
version
|
version
|
||||||
wallet-crypto
|
wallet-crypto
|
||||||
unbound
|
|
||||||
)
|
)
|
||||||
|
|
||||||
set(MONERO_OPTIONAL unbound wallet-crypto)
|
set(MONERO_OPTIONAL wallet-crypto)
|
||||||
|
|
||||||
|
if (MONERO_BUILD_DIR)
|
||||||
|
|
||||||
set(MONERO_SEARCH_PATHS
|
set(MONERO_SEARCH_PATHS
|
||||||
"/contrib/epee/src"
|
"/contrib/epee/src"
|
||||||
@@ -92,18 +101,6 @@ if (NOT MONERO_SOURCE_DIR)
|
|||||||
message(FATAL_ERROR "The argument -DMONERO_SOURCE_DIR must specify a location of a monero source tree")
|
message(FATAL_ERROR "The argument -DMONERO_SOURCE_DIR must specify a location of a monero source tree")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT MONERO_BUILD_DIR)
|
|
||||||
message(FATAL_ERROR "The argument -DMONERO_BUILD_DIR must specify a location of an existing monero build")
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(STATIC)
|
|
||||||
if(MSVC)
|
|
||||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .lib .dll.a .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
|
||||||
else()
|
|
||||||
set(CMAKE_FIND_LIBRARY_SUFFIXES .a ${CMAKE_FIND_LIBRARY_SUFFIXES})
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
# monero `master` and `release-v0.18` branches use different LIBSODIUM
|
# monero `master` and `release-v0.18` branches use different LIBSODIUM
|
||||||
# find routines. So the upstream cmake names differ
|
# find routines. So the upstream cmake names differ
|
||||||
|
|
||||||
@@ -148,6 +145,48 @@ if ("${monero_HIDAPI_LIBRARY}" STREQUAL "HIDAPI_LIBRARY-NOTFOUND")
|
|||||||
unset(monero_HIDAPI_LIBRARY)
|
unset(monero_HIDAPI_LIBRARY)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
foreach (LIB ${MONERO_LIBRARIES})
|
||||||
|
find_library(LIB_PATH NAMES "${LIB}" PATHS ${MONERO_BUILD_DIR} PATH_SUFFIXES "/src/${LIB}" "external/${LIB}" ${MONERO_SEARCH_PATHS} NO_DEFAULT_PATH)
|
||||||
|
|
||||||
|
list(FIND MONERO_OPTIONAL "${LIB}" LIB_OPTIONAL)
|
||||||
|
if (NOT LIB_PATH)
|
||||||
|
if (LIB_OPTIONAL EQUAL -1)
|
||||||
|
message(FATAL_ERROR "Unable to find required Monero library ${LIB}")
|
||||||
|
endif()
|
||||||
|
else ()
|
||||||
|
set(LIB_NAME "monero::${LIB}")
|
||||||
|
add_library(${LIB_NAME} STATIC IMPORTED)
|
||||||
|
set_target_properties(${LIB_NAME} PROPERTIES IMPORTED_LOCATION ${LIB_PATH})
|
||||||
|
list(APPEND IMPORTED_MONERO_LIBRARIES "${LIB_NAME}")
|
||||||
|
endif()
|
||||||
|
unset(LIB_PATH CACHE)
|
||||||
|
endforeach()
|
||||||
|
|
||||||
|
set(LMDB_INCLUDE "${monero_LMDB_INCLUDE}")
|
||||||
|
set(LMDB_LIB_PATH "monero::lmdb")
|
||||||
|
else () # NOT MONERO_BUILD_DIR
|
||||||
|
if (NOT MONERO_SOURCE_DIR)
|
||||||
|
set (MONERO_SOURCE_DIR "${monero-lws_SOURCE_DIR}/external/monero")
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
include(FetchContent)
|
||||||
|
FetchContent_Declare(monero SOURCE_DIR "${MONERO_SOURCE_DIR}")
|
||||||
|
|
||||||
|
if (NOT monero_POPULATED)
|
||||||
|
FetchContent_MakeAvailable(monero)
|
||||||
|
endif ()
|
||||||
|
|
||||||
|
set(MONERO_BUILD_DIR "${monero_BINARY_DIR}")
|
||||||
|
set(IMPORTED_MONERO_LIBRARIES "${MONERO_LIBRARIES}")
|
||||||
|
set(monero_Boost_THREAD_LIBRARY_RELEASE "${Boost_THREAD_LIBRARY_RELEASE}")
|
||||||
|
set(monero_pkgcfg_lib_libzmq_zmq "${pkgcfg_lib_libzmq_zmq}")
|
||||||
|
if (SODIUM_LIBRARY)
|
||||||
|
set(monero_SODIUM_LIBRARY "${SODIUM_LIBRARY}")
|
||||||
|
else()
|
||||||
|
set(monero_SODIUM_LIBRARY "${monero_sodium_LIBRARY_RELEASE}")
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
#
|
#
|
||||||
# Dependencies specific to monero-lws
|
# Dependencies specific to monero-lws
|
||||||
#
|
#
|
||||||
@@ -177,8 +216,6 @@ else()
|
|||||||
set(RMQ_LIBRARY "")
|
set(RMQ_LIBRARY "")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(LMDB_INCLUDE "${monero_LMDB_INCLUDE}")
|
|
||||||
set(LMDB_LIB_PATH "monero::lmdb")
|
|
||||||
set(ZMQ_INCLUDE_PATH "${libzmq_INCLUDE_DIRS}")
|
set(ZMQ_INCLUDE_PATH "${libzmq_INCLUDE_DIRS}")
|
||||||
set(ZMQ_LIB "${monero_pkgcfg_lib_libzmq_zmq}")
|
set(ZMQ_LIB "${monero_pkgcfg_lib_libzmq_zmq}")
|
||||||
if (monero_SODIUM_LIBRARY)
|
if (monero_SODIUM_LIBRARY)
|
||||||
@@ -212,23 +249,6 @@ if(STATIC AND NOT IOS)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
foreach (LIB ${MONERO_LIBRARIES})
|
|
||||||
find_library(LIB_PATH NAMES "${LIB}" PATHS ${MONERO_BUILD_DIR} PATH_SUFFIXES "/src/${LIB}" "external/${LIB}" ${MONERO_SEARCH_PATHS} NO_DEFAULT_PATH)
|
|
||||||
|
|
||||||
list(FIND MONERO_OPTIONAL "${LIB}" LIB_OPTIONAL)
|
|
||||||
if (NOT LIB_PATH)
|
|
||||||
if (LIB_OPTIONAL EQUAL -1)
|
|
||||||
message(FATAL_ERROR "Unable to find required Monero library ${LIB}")
|
|
||||||
endif()
|
|
||||||
else ()
|
|
||||||
set(LIB_NAME "monero::${LIB}")
|
|
||||||
add_library(${LIB_NAME} STATIC IMPORTED)
|
|
||||||
set_target_properties(${LIB_NAME} PROPERTIES IMPORTED_LOCATION ${LIB_PATH})
|
|
||||||
list(APPEND IMPORTED_MONERO_LIBRARIES "${LIB_NAME}")
|
|
||||||
endif()
|
|
||||||
unset(LIB_PATH CACHE)
|
|
||||||
endforeach()
|
|
||||||
|
|
||||||
if(APPLE)
|
if(APPLE)
|
||||||
find_library(IOKIT_LIBRARY IOKit)
|
find_library(IOKIT_LIBRARY IOKit)
|
||||||
list(APPEND IMPORTED_MONERO_LIBRARIES ${IOKIT_LIBRARY})
|
list(APPEND IMPORTED_MONERO_LIBRARIES ${IOKIT_LIBRARY})
|
||||||
|
|||||||
1
external/monero
vendored
Submodule
1
external/monero
vendored
Submodule
Submodule external/monero added at c572e1ad00
Reference in New Issue
Block a user