forked from XRPLF/rippled
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add xrpld build option and Conan package test (XRPLF#5052)
* Make xrpld target optional * Add job to test Conan recipe * [fold] address review comments * [fold] Enable tests in workflows * [fold] Rename with_xrpld option * [fold] Fix grep expression
- Loading branch information
1 parent
e8602b8
commit f3bcc65
Showing
10 changed files
with
211 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
cmake_minimum_required(VERSION 3.21) | ||
|
||
set(name example) | ||
set(version 0.1.0) | ||
|
||
project( | ||
${name} | ||
VERSION ${version} | ||
LANGUAGES CXX | ||
) | ||
|
||
find_package(xrpl REQUIRED) | ||
|
||
add_executable(example) | ||
target_sources(example PRIVATE src/example.cpp) | ||
target_link_libraries(example PRIVATE xrpl::libxrpl) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
from conan import ConanFile, conan_version | ||
from conan.tools.cmake import CMake, cmake_layout | ||
|
||
class Example(ConanFile): | ||
|
||
def set_name(self): | ||
if self.name is None: | ||
self.name = 'example' | ||
|
||
def set_version(self): | ||
if self.version is None: | ||
self.version = '0.1.0' | ||
|
||
license = 'ISC' | ||
author = 'John Freeman <[email protected]>' | ||
|
||
settings = 'os', 'compiler', 'build_type', 'arch' | ||
options = {'shared': [True, False], 'fPIC': [True, False]} | ||
default_options = { | ||
'shared': False, | ||
'fPIC': True, | ||
'xrpl:xrpld': False, | ||
} | ||
|
||
requires = ['xrpl/2.2.0-rc1@jfreeman/nodestore'] | ||
generators = ['CMakeDeps', 'CMakeToolchain'] | ||
|
||
exports_sources = [ | ||
'CMakeLists.txt', | ||
'cmake/*', | ||
'external/*', | ||
'include/*', | ||
'src/*', | ||
] | ||
|
||
# For out-of-source build. | ||
# https://docs.conan.io/en/latest/reference/build_helpers/cmake.html#configure | ||
no_copy_source = True | ||
|
||
def layout(self): | ||
cmake_layout(self) | ||
|
||
def config_options(self): | ||
if self.settings.os == 'Windows': | ||
del self.options.fPIC | ||
|
||
def build(self): | ||
cmake = CMake(self) | ||
cmake.configure(variables={'BUILD_TESTING': 'NO'}) | ||
cmake.build() | ||
|
||
def package(self): | ||
cmake = CMake(self) | ||
cmake.install() | ||
|
||
def package_info(self): | ||
path = f'{self.package_folder}/share/{self.name}/cpp_info.py' | ||
with open(path, 'r') as file: | ||
exec(file.read(), {}, {'self': self.cpp_info}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#include <cstdio> | ||
|
||
#include <xrpl/protocol/BuildInfo.h> | ||
|
||
int main(int argc, char const** argv) { | ||
std::printf("%s\n", ripple::BuildInfo::getVersionString().c_str()); | ||
return 0; | ||
} |