mirror of
https://github.com/XRPLF/rippled.git
synced 2026-03-09 22:32:26 +00:00
Compare commits
12 Commits
legleux/de
...
develop
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
45b8c4d732 | ||
|
|
e284969ae4 | ||
|
|
0335076359 | ||
|
|
7e2b137131 | ||
|
|
e2290b1a0a | ||
|
|
1ee0567b14 | ||
|
|
6b301efc8c | ||
|
|
9e0d350fca | ||
|
|
7b12c00e6b | ||
|
|
5865bd017f | ||
|
|
af0ec7defd | ||
|
|
0c74270b05 |
@@ -31,6 +31,7 @@ Checks: "-*,
|
|||||||
bugprone-no-escape,
|
bugprone-no-escape,
|
||||||
bugprone-non-zero-enum-to-bool-conversion,
|
bugprone-non-zero-enum-to-bool-conversion,
|
||||||
bugprone-parent-virtual-call,
|
bugprone-parent-virtual-call,
|
||||||
|
bugprone-pointer-arithmetic-on-polymorphic-object,
|
||||||
bugprone-posix-return,
|
bugprone-posix-return,
|
||||||
bugprone-redundant-branch-condition,
|
bugprone-redundant-branch-condition,
|
||||||
bugprone-return-const-ref-from-parameter,
|
bugprone-return-const-ref-from-parameter,
|
||||||
@@ -49,6 +50,7 @@ Checks: "-*,
|
|||||||
bugprone-suspicious-include,
|
bugprone-suspicious-include,
|
||||||
bugprone-suspicious-memory-comparison,
|
bugprone-suspicious-memory-comparison,
|
||||||
bugprone-suspicious-memset-usage,
|
bugprone-suspicious-memset-usage,
|
||||||
|
bugprone-suspicious-missing-comma,
|
||||||
bugprone-suspicious-realloc-usage,
|
bugprone-suspicious-realloc-usage,
|
||||||
bugprone-suspicious-semicolon,
|
bugprone-suspicious-semicolon,
|
||||||
bugprone-suspicious-string-compare,
|
bugprone-suspicious-string-compare,
|
||||||
@@ -60,6 +62,7 @@ Checks: "-*,
|
|||||||
bugprone-unhandled-exception-at-new,
|
bugprone-unhandled-exception-at-new,
|
||||||
bugprone-unique-ptr-array-mismatch,
|
bugprone-unique-ptr-array-mismatch,
|
||||||
bugprone-unsafe-functions,
|
bugprone-unsafe-functions,
|
||||||
|
bugprone-unused-local-non-trivial-variable,
|
||||||
bugprone-virtual-near-miss,
|
bugprone-virtual-near-miss,
|
||||||
cppcoreguidelines-no-suspend-with-lock,
|
cppcoreguidelines-no-suspend-with-lock,
|
||||||
cppcoreguidelines-virtual-class-destructor,
|
cppcoreguidelines-virtual-class-destructor,
|
||||||
@@ -85,17 +88,14 @@ Checks: "-*,
|
|||||||
performance-trivially-destructible
|
performance-trivially-destructible
|
||||||
"
|
"
|
||||||
# ---
|
# ---
|
||||||
# more checks that have some issues that need to be resolved:
|
# checks that have some issues that need to be resolved:
|
||||||
#
|
#
|
||||||
# bugprone-crtp-constructor-accessibility,
|
# bugprone-crtp-constructor-accessibility,
|
||||||
# bugprone-inc-dec-in-conditions,
|
# bugprone-inc-dec-in-conditions,
|
||||||
# bugprone-reserved-identifier,
|
# bugprone-reserved-identifier,
|
||||||
# bugprone-move-forwarding-reference,
|
# bugprone-move-forwarding-reference,
|
||||||
# bugprone-unused-local-non-trivial-variable,
|
|
||||||
# bugprone-switch-missing-default-case,
|
# bugprone-switch-missing-default-case,
|
||||||
# bugprone-suspicious-stringview-data-usage,
|
# bugprone-suspicious-stringview-data-usage,
|
||||||
# bugprone-suspicious-missing-comma,
|
|
||||||
# bugprone-pointer-arithmetic-on-polymorphic-object,
|
|
||||||
# bugprone-optional-value-conversion,
|
# bugprone-optional-value-conversion,
|
||||||
# bugprone-too-small-loop-variable,
|
# bugprone-too-small-loop-variable,
|
||||||
# bugprone-unused-return-value,
|
# bugprone-unused-return-value,
|
||||||
|
|||||||
@@ -1,247 +0,0 @@
|
|||||||
_help_parse: Options affecting listfile parsing
|
|
||||||
parse:
|
|
||||||
_help_additional_commands:
|
|
||||||
- Specify structure for custom cmake functions
|
|
||||||
additional_commands:
|
|
||||||
target_protobuf_sources:
|
|
||||||
pargs:
|
|
||||||
- target
|
|
||||||
- prefix
|
|
||||||
kwargs:
|
|
||||||
PROTOS: "*"
|
|
||||||
LANGUAGE: cpp
|
|
||||||
IMPORT_DIRS: "*"
|
|
||||||
GENERATE_EXTENSIONS: "*"
|
|
||||||
PLUGIN: "*"
|
|
||||||
_help_override_spec:
|
|
||||||
- Override configurations per-command where available
|
|
||||||
override_spec: {}
|
|
||||||
_help_vartags:
|
|
||||||
- Specify variable tags.
|
|
||||||
vartags: []
|
|
||||||
_help_proptags:
|
|
||||||
- Specify property tags.
|
|
||||||
proptags: []
|
|
||||||
_help_format: Options affecting formatting.
|
|
||||||
format:
|
|
||||||
_help_disable:
|
|
||||||
- Disable formatting entirely, making cmake-format a no-op
|
|
||||||
disable: false
|
|
||||||
_help_line_width:
|
|
||||||
- How wide to allow formatted cmake files
|
|
||||||
line_width: 100
|
|
||||||
_help_tab_size:
|
|
||||||
- How many spaces to tab for indent
|
|
||||||
tab_size: 4
|
|
||||||
_help_use_tabchars:
|
|
||||||
- If true, lines are indented using tab characters (utf-8
|
|
||||||
- 0x09) instead of <tab_size> space characters (utf-8 0x20).
|
|
||||||
- In cases where the layout would require a fractional tab
|
|
||||||
- character, the behavior of the fractional indentation is
|
|
||||||
- governed by <fractional_tab_policy>
|
|
||||||
use_tabchars: false
|
|
||||||
_help_fractional_tab_policy:
|
|
||||||
- If <use_tabchars> is True, then the value of this variable
|
|
||||||
- indicates how fractional indentions are handled during
|
|
||||||
- whitespace replacement. If set to 'use-space', fractional
|
|
||||||
- indentation is left as spaces (utf-8 0x20). If set to
|
|
||||||
- "`round-up` fractional indentation is replaced with a single"
|
|
||||||
- tab character (utf-8 0x09) effectively shifting the column
|
|
||||||
- to the next tabstop
|
|
||||||
fractional_tab_policy: use-space
|
|
||||||
_help_max_subgroups_hwrap:
|
|
||||||
- If an argument group contains more than this many sub-groups
|
|
||||||
- (parg or kwarg groups) then force it to a vertical layout.
|
|
||||||
max_subgroups_hwrap: 4
|
|
||||||
_help_max_pargs_hwrap:
|
|
||||||
- If a positional argument group contains more than this many
|
|
||||||
- arguments, then force it to a vertical layout.
|
|
||||||
max_pargs_hwrap: 5
|
|
||||||
_help_max_rows_cmdline:
|
|
||||||
- If a cmdline positional group consumes more than this many
|
|
||||||
- lines without nesting, then invalidate the layout (and nest)
|
|
||||||
max_rows_cmdline: 2
|
|
||||||
_help_separate_ctrl_name_with_space:
|
|
||||||
- If true, separate flow control names from their parentheses
|
|
||||||
- with a space
|
|
||||||
separate_ctrl_name_with_space: true
|
|
||||||
_help_separate_fn_name_with_space:
|
|
||||||
- If true, separate function names from parentheses with a
|
|
||||||
- space
|
|
||||||
separate_fn_name_with_space: false
|
|
||||||
_help_dangle_parens:
|
|
||||||
- If a statement is wrapped to more than one line, than dangle
|
|
||||||
- the closing parenthesis on its own line.
|
|
||||||
dangle_parens: false
|
|
||||||
_help_dangle_align:
|
|
||||||
- If the trailing parenthesis must be 'dangled' on its on
|
|
||||||
- "line, then align it to this reference: `prefix`: the start"
|
|
||||||
- "of the statement, `prefix-indent`: the start of the"
|
|
||||||
- "statement, plus one indentation level, `child`: align to"
|
|
||||||
- the column of the arguments
|
|
||||||
dangle_align: prefix
|
|
||||||
_help_min_prefix_chars:
|
|
||||||
- If the statement spelling length (including space and
|
|
||||||
- parenthesis) is smaller than this amount, then force reject
|
|
||||||
- nested layouts.
|
|
||||||
min_prefix_chars: 18
|
|
||||||
_help_max_prefix_chars:
|
|
||||||
- If the statement spelling length (including space and
|
|
||||||
- parenthesis) is larger than the tab width by more than this
|
|
||||||
- amount, then force reject un-nested layouts.
|
|
||||||
max_prefix_chars: 10
|
|
||||||
_help_max_lines_hwrap:
|
|
||||||
- If a candidate layout is wrapped horizontally but it exceeds
|
|
||||||
- this many lines, then reject the layout.
|
|
||||||
max_lines_hwrap: 2
|
|
||||||
_help_line_ending:
|
|
||||||
- What style line endings to use in the output.
|
|
||||||
line_ending: unix
|
|
||||||
_help_command_case:
|
|
||||||
- Format command names consistently as 'lower' or 'upper' case
|
|
||||||
command_case: canonical
|
|
||||||
_help_keyword_case:
|
|
||||||
- Format keywords consistently as 'lower' or 'upper' case
|
|
||||||
keyword_case: unchanged
|
|
||||||
_help_always_wrap:
|
|
||||||
- A list of command names which should always be wrapped
|
|
||||||
always_wrap: []
|
|
||||||
_help_enable_sort:
|
|
||||||
- If true, the argument lists which are known to be sortable
|
|
||||||
- will be sorted lexicographicall
|
|
||||||
enable_sort: true
|
|
||||||
_help_autosort:
|
|
||||||
- If true, the parsers may infer whether or not an argument
|
|
||||||
- list is sortable (without annotation).
|
|
||||||
autosort: true
|
|
||||||
_help_require_valid_layout:
|
|
||||||
- By default, if cmake-format cannot successfully fit
|
|
||||||
- everything into the desired linewidth it will apply the
|
|
||||||
- last, most aggressive attempt that it made. If this flag is
|
|
||||||
- True, however, cmake-format will print error, exit with non-
|
|
||||||
- zero status code, and write-out nothing
|
|
||||||
require_valid_layout: false
|
|
||||||
_help_layout_passes:
|
|
||||||
- A dictionary mapping layout nodes to a list of wrap
|
|
||||||
- decisions. See the documentation for more information.
|
|
||||||
layout_passes: {}
|
|
||||||
_help_markup: Options affecting comment reflow and formatting.
|
|
||||||
markup:
|
|
||||||
_help_bullet_char:
|
|
||||||
- What character to use for bulleted lists
|
|
||||||
bullet_char: "-"
|
|
||||||
_help_enum_char:
|
|
||||||
- What character to use as punctuation after numerals in an
|
|
||||||
- enumerated list
|
|
||||||
enum_char: .
|
|
||||||
_help_first_comment_is_literal:
|
|
||||||
- If comment markup is enabled, don't reflow the first comment
|
|
||||||
- block in each listfile. Use this to preserve formatting of
|
|
||||||
- your copyright/license statements.
|
|
||||||
first_comment_is_literal: false
|
|
||||||
_help_literal_comment_pattern:
|
|
||||||
- If comment markup is enabled, don't reflow any comment block
|
|
||||||
- which matches this (regex) pattern. Default is `None`
|
|
||||||
- (disabled).
|
|
||||||
literal_comment_pattern: null
|
|
||||||
_help_fence_pattern:
|
|
||||||
- Regular expression to match preformat fences in comments
|
|
||||||
- default= ``r'^\s*([`~]{3}[`~]*)(.*)$'``
|
|
||||||
fence_pattern: ^\s*([`~]{3}[`~]*)(.*)$
|
|
||||||
_help_ruler_pattern:
|
|
||||||
- Regular expression to match rulers in comments default=
|
|
||||||
- '``r''^\s*[^\w\s]{3}.*[^\w\s]{3}$''``'
|
|
||||||
ruler_pattern: ^\s*[^\w\s]{3}.*[^\w\s]{3}$
|
|
||||||
_help_explicit_trailing_pattern:
|
|
||||||
- If a comment line matches starts with this pattern then it
|
|
||||||
- is explicitly a trailing comment for the preceding
|
|
||||||
- argument. Default is '#<'
|
|
||||||
explicit_trailing_pattern: "#<"
|
|
||||||
_help_hashruler_min_length:
|
|
||||||
- If a comment line starts with at least this many consecutive
|
|
||||||
- hash characters, then don't lstrip() them off. This allows
|
|
||||||
- for lazy hash rulers where the first hash char is not
|
|
||||||
- separated by space
|
|
||||||
hashruler_min_length: 10
|
|
||||||
_help_canonicalize_hashrulers:
|
|
||||||
- If true, then insert a space between the first hash char and
|
|
||||||
- remaining hash chars in a hash ruler, and normalize its
|
|
||||||
- length to fill the column
|
|
||||||
canonicalize_hashrulers: true
|
|
||||||
_help_enable_markup:
|
|
||||||
- enable comment markup parsing and reflow
|
|
||||||
enable_markup: false
|
|
||||||
_help_lint: Options affecting the linter
|
|
||||||
lint:
|
|
||||||
_help_disabled_codes:
|
|
||||||
- a list of lint codes to disable
|
|
||||||
disabled_codes: []
|
|
||||||
_help_function_pattern:
|
|
||||||
- regular expression pattern describing valid function names
|
|
||||||
function_pattern: "[0-9a-z_]+"
|
|
||||||
_help_macro_pattern:
|
|
||||||
- regular expression pattern describing valid macro names
|
|
||||||
macro_pattern: "[0-9A-Z_]+"
|
|
||||||
_help_global_var_pattern:
|
|
||||||
- regular expression pattern describing valid names for
|
|
||||||
- variables with global (cache) scope
|
|
||||||
global_var_pattern: "[A-Z][0-9A-Z_]+"
|
|
||||||
_help_internal_var_pattern:
|
|
||||||
- regular expression pattern describing valid names for
|
|
||||||
- variables with global scope (but internal semantic)
|
|
||||||
internal_var_pattern: _[A-Z][0-9A-Z_]+
|
|
||||||
_help_local_var_pattern:
|
|
||||||
- regular expression pattern describing valid names for
|
|
||||||
- variables with local scope
|
|
||||||
local_var_pattern: "[a-z][a-z0-9_]+"
|
|
||||||
_help_private_var_pattern:
|
|
||||||
- regular expression pattern describing valid names for
|
|
||||||
- privatedirectory variables
|
|
||||||
private_var_pattern: _[0-9a-z_]+
|
|
||||||
_help_public_var_pattern:
|
|
||||||
- regular expression pattern describing valid names for public
|
|
||||||
- directory variables
|
|
||||||
public_var_pattern: "[A-Z][0-9A-Z_]+"
|
|
||||||
_help_argument_var_pattern:
|
|
||||||
- regular expression pattern describing valid names for
|
|
||||||
- function/macro arguments and loop variables.
|
|
||||||
argument_var_pattern: "[a-z][a-z0-9_]+"
|
|
||||||
_help_keyword_pattern:
|
|
||||||
- regular expression pattern describing valid names for
|
|
||||||
- keywords used in functions or macros
|
|
||||||
keyword_pattern: "[A-Z][0-9A-Z_]+"
|
|
||||||
_help_max_conditionals_custom_parser:
|
|
||||||
- In the heuristic for C0201, how many conditionals to match
|
|
||||||
- within a loop in before considering the loop a parser.
|
|
||||||
max_conditionals_custom_parser: 2
|
|
||||||
_help_min_statement_spacing:
|
|
||||||
- Require at least this many newlines between statements
|
|
||||||
min_statement_spacing: 1
|
|
||||||
_help_max_statement_spacing:
|
|
||||||
- Require no more than this many newlines between statements
|
|
||||||
max_statement_spacing: 2
|
|
||||||
max_returns: 6
|
|
||||||
max_branches: 12
|
|
||||||
max_arguments: 5
|
|
||||||
max_localvars: 15
|
|
||||||
max_statements: 50
|
|
||||||
_help_encode: Options affecting file encoding
|
|
||||||
encode:
|
|
||||||
_help_emit_byteorder_mark:
|
|
||||||
- If true, emit the unicode byte-order mark (BOM) at the start
|
|
||||||
- of the file
|
|
||||||
emit_byteorder_mark: false
|
|
||||||
_help_input_encoding:
|
|
||||||
- Specify the encoding of the input file. Defaults to utf-8
|
|
||||||
input_encoding: utf-8
|
|
||||||
_help_output_encoding:
|
|
||||||
- Specify the encoding of the output file. Defaults to utf-8.
|
|
||||||
- Note that cmake only claims to support utf-8 so be careful
|
|
||||||
- when using anything else
|
|
||||||
output_encoding: utf-8
|
|
||||||
_help_misc: Miscellaneous configurations options.
|
|
||||||
misc:
|
|
||||||
_help_per_command:
|
|
||||||
- A dictionary containing any per-command configuration
|
|
||||||
- overrides. Currently only `command_case` is supported.
|
|
||||||
per_command: {}
|
|
||||||
98
.gersemi/definitions.cmake
Normal file
98
.gersemi/definitions.cmake
Normal file
@@ -0,0 +1,98 @@
|
|||||||
|
# Custom CMake command definitions for gersemi formatting.
|
||||||
|
# These stubs teach gersemi the signatures of project-specific commands
|
||||||
|
# so it can format their invocations correctly.
|
||||||
|
|
||||||
|
function(git_branch branch_val)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(isolate_headers target A B scope)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(create_symbolic_link target link)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(xrpl_add_test name)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
macro(exclude_from_default target_)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
macro(exclude_if_included target_)
|
||||||
|
endmacro()
|
||||||
|
|
||||||
|
function(target_protobuf_sources target prefix)
|
||||||
|
set(options APPEND_PATH DESCRIPTORS)
|
||||||
|
set(oneValueArgs
|
||||||
|
LANGUAGE
|
||||||
|
OUT_VAR
|
||||||
|
EXPORT_MACRO
|
||||||
|
TARGET
|
||||||
|
PROTOC_OUT_DIR
|
||||||
|
PLUGIN
|
||||||
|
PLUGIN_OPTIONS
|
||||||
|
PROTOC_EXE
|
||||||
|
)
|
||||||
|
set(multiValueArgs
|
||||||
|
PROTOS
|
||||||
|
IMPORT_DIRS
|
||||||
|
GENERATE_EXTENSIONS
|
||||||
|
PROTOC_OPTIONS
|
||||||
|
DEPENDENCIES
|
||||||
|
)
|
||||||
|
cmake_parse_arguments(
|
||||||
|
THIS_FUNCTION_PREFIX
|
||||||
|
"${options}"
|
||||||
|
"${oneValueArgs}"
|
||||||
|
"${multiValueArgs}"
|
||||||
|
${ARGN}
|
||||||
|
)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(add_module parent name)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(target_link_modules parent scope)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(setup_target_for_coverage_gcovr)
|
||||||
|
set(options NONE)
|
||||||
|
set(oneValueArgs BASE_DIRECTORY NAME FORMAT)
|
||||||
|
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
|
||||||
|
cmake_parse_arguments(
|
||||||
|
THIS_FUNCTION_PREFIX
|
||||||
|
"${options}"
|
||||||
|
"${oneValueArgs}"
|
||||||
|
"${multiValueArgs}"
|
||||||
|
${ARGN}
|
||||||
|
)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(add_code_coverage_to_target name scope)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
function(verbose_find_path variable name)
|
||||||
|
set(options
|
||||||
|
NO_CACHE
|
||||||
|
REQUIRED
|
||||||
|
OPTIONAL
|
||||||
|
NO_DEFAULT_PATH
|
||||||
|
NO_PACKAGE_ROOT_PATH
|
||||||
|
NO_CMAKE_PATH
|
||||||
|
NO_CMAKE_ENVIRONMENT_PATH
|
||||||
|
NO_SYSTEM_ENVIRONMENT_PATH
|
||||||
|
NO_CMAKE_SYSTEM_PATH
|
||||||
|
NO_CMAKE_INSTALL_PREFIX
|
||||||
|
CMAKE_FIND_ROOT_PATH_BOTH
|
||||||
|
ONLY_CMAKE_FIND_ROOT_PATH
|
||||||
|
NO_CMAKE_FIND_ROOT_PATH
|
||||||
|
)
|
||||||
|
set(oneValueArgs REGISTRY_VIEW VALIDATOR DOC)
|
||||||
|
set(multiValueArgs NAMES HINTS PATHS PATH_SUFFIXES)
|
||||||
|
cmake_parse_arguments(
|
||||||
|
THIS_FUNCTION_PREFIX
|
||||||
|
"${options}"
|
||||||
|
"${oneValueArgs}"
|
||||||
|
"${multiValueArgs}"
|
||||||
|
${ARGN}
|
||||||
|
)
|
||||||
|
endfunction()
|
||||||
1
.gersemirc
Normal file
1
.gersemirc
Normal file
@@ -0,0 +1 @@
|
|||||||
|
definitions: [.gersemi]
|
||||||
10
.github/workflows/check-pr-title.yml
vendored
Normal file
10
.github/workflows/check-pr-title.yml
vendored
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
name: Check PR title
|
||||||
|
|
||||||
|
on:
|
||||||
|
pull_request:
|
||||||
|
types: [opened, edited, reopened, synchronize]
|
||||||
|
branches: [develop]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
check_title:
|
||||||
|
uses: XRPLF/actions/.github/workflows/check-pr-title.yml@943eb8277e8f4b010fde0c826ce4154c36c39509
|
||||||
2
.github/workflows/on-pr.yml
vendored
2
.github/workflows/on-pr.yml
vendored
@@ -46,7 +46,7 @@ jobs:
|
|||||||
# that Github considers any skipped jobs to have passed, and in
|
# that Github considers any skipped jobs to have passed, and in
|
||||||
# turn the required checks as well.
|
# turn the required checks as well.
|
||||||
id: changes
|
id: changes
|
||||||
uses: tj-actions/changed-files@7dee1b0c1557f278e5c7dc244927139d78c0e22a # v47.0.4
|
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 # v47.0.5
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
# These paths are unique to `on-pr.yml`.
|
# These paths are unique to `on-pr.yml`.
|
||||||
|
|||||||
2
.github/workflows/pre-commit.yml
vendored
2
.github/workflows/pre-commit.yml
vendored
@@ -11,7 +11,7 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
# Call the workflow in the XRPLF/actions repo that runs the pre-commit hooks.
|
# Call the workflow in the XRPLF/actions repo that runs the pre-commit hooks.
|
||||||
run-hooks:
|
run-hooks:
|
||||||
uses: XRPLF/actions/.github/workflows/pre-commit.yml@56de1bdf19639e009639a50b8d17c28ca954f267
|
uses: XRPLF/actions/.github/workflows/pre-commit.yml@44856eb0d6ecb7d376370244324ab3dc8b863bad
|
||||||
with:
|
with:
|
||||||
runs_on: ubuntu-latest
|
runs_on: ubuntu-latest
|
||||||
container: '{ "image": "ghcr.io/xrplf/ci/tools-rippled-pre-commit:sha-41ec7c1" }'
|
container: '{ "image": "ghcr.io/xrplf/ci/tools-rippled-pre-commit:sha-41ec7c1" }'
|
||||||
|
|||||||
4
.github/workflows/reusable-clang-tidy.yml
vendored
4
.github/workflows/reusable-clang-tidy.yml
vendored
@@ -31,7 +31,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get changed C++ files
|
- name: Get changed C++ files
|
||||||
id: changed_files
|
id: changed_files
|
||||||
uses: tj-actions/changed-files@7dee1b0c1557f278e5c7dc244927139d78c0e22a # v47.0.4
|
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 # v47.0.5
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
**/*.cpp
|
**/*.cpp
|
||||||
@@ -41,7 +41,7 @@ jobs:
|
|||||||
|
|
||||||
- name: Get changed clang-tidy configuration
|
- name: Get changed clang-tidy configuration
|
||||||
id: changed_clang_tidy
|
id: changed_clang_tidy
|
||||||
uses: tj-actions/changed-files@7dee1b0c1557f278e5c7dc244927139d78c0e22a # v47.0.4
|
uses: tj-actions/changed-files@22103cc46bda19c2b464ffe86db46df6922fd323 # v47.0.5
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
.clang-tidy
|
.clang-tidy
|
||||||
|
|||||||
@@ -26,11 +26,10 @@ repos:
|
|||||||
args: [--style=file]
|
args: [--style=file]
|
||||||
"types_or": [c++, c, proto]
|
"types_or": [c++, c, proto]
|
||||||
|
|
||||||
- repo: https://github.com/cheshirekow/cmake-format-precommit
|
- repo: https://github.com/BlankSpruce/gersemi
|
||||||
rev: e2c2116d86a80e72e7146a06e68b7c228afc6319 # frozen: v0.6.13
|
rev: 0.26.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: cmake-format
|
- id: gersemi
|
||||||
additional_dependencies: [PyYAML]
|
|
||||||
|
|
||||||
- repo: https://github.com/rbubley/mirrors-prettier
|
- repo: https://github.com/rbubley/mirrors-prettier
|
||||||
rev: c2bc67fe8f8f549cc489e00ba8b45aa18ee713b1 # frozen: v3.8.1
|
rev: c2bc67fe8f8f549cc489e00ba8b45aa18ee713b1 # frozen: v3.8.1
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
if (POLICY CMP0074)
|
if(POLICY CMP0074)
|
||||||
cmake_policy(SET CMP0074 NEW)
|
cmake_policy(SET CMP0074 NEW)
|
||||||
endif ()
|
endif()
|
||||||
if (POLICY CMP0077)
|
if(POLICY CMP0077)
|
||||||
cmake_policy(SET CMP0077 NEW)
|
cmake_policy(SET CMP0077 NEW)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
# Fix "unrecognized escape" issues when passing CMAKE_MODULE_PATH on Windows.
|
# Fix "unrecognized escape" issues when passing CMAKE_MODULE_PATH on Windows.
|
||||||
if (DEFINED CMAKE_MODULE_PATH)
|
if(DEFINED CMAKE_MODULE_PATH)
|
||||||
file(TO_CMAKE_PATH "${CMAKE_MODULE_PATH}" CMAKE_MODULE_PATH)
|
file(TO_CMAKE_PATH "${CMAKE_MODULE_PATH}" CMAKE_MODULE_PATH)
|
||||||
endif ()
|
endif()
|
||||||
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake")
|
||||||
|
|
||||||
project(xrpl)
|
project(xrpl)
|
||||||
@@ -21,57 +21,64 @@ set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
|
|||||||
|
|
||||||
include(CompilationEnv)
|
include(CompilationEnv)
|
||||||
|
|
||||||
if (is_gcc)
|
if(is_gcc)
|
||||||
# GCC-specific fixes
|
# GCC-specific fixes
|
||||||
add_compile_options(-Wno-unknown-pragmas -Wno-subobject-linkage)
|
add_compile_options(-Wno-unknown-pragmas -Wno-subobject-linkage)
|
||||||
# -Wno-subobject-linkage can be removed when we upgrade GCC version to at least 13.3
|
# -Wno-subobject-linkage can be removed when we upgrade GCC version to at least 13.3
|
||||||
elseif (is_clang)
|
elseif(is_clang)
|
||||||
# Clang-specific fixes
|
# Clang-specific fixes
|
||||||
add_compile_options(-Wno-unknown-warning-option) # Ignore unknown warning options
|
add_compile_options(-Wno-unknown-warning-option) # Ignore unknown warning options
|
||||||
elseif (is_msvc)
|
elseif(is_msvc)
|
||||||
# MSVC-specific fixes
|
# MSVC-specific fixes
|
||||||
add_compile_options(/wd4068) # Ignore unknown pragmas
|
add_compile_options(/wd4068) # Ignore unknown pragmas
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
# Enable ccache to speed up builds.
|
# Enable ccache to speed up builds.
|
||||||
include(Ccache)
|
include(Ccache)
|
||||||
|
|
||||||
if (thread_safety_analysis)
|
if(thread_safety_analysis)
|
||||||
add_compile_options(-Wthread-safety -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS
|
add_compile_options(
|
||||||
-DXRPL_ENABLE_THREAD_SAFETY_ANNOTATIONS)
|
-Wthread-safety
|
||||||
|
-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS
|
||||||
|
-DXRPL_ENABLE_THREAD_SAFETY_ANNOTATIONS
|
||||||
|
)
|
||||||
add_compile_options("-stdlib=libc++")
|
add_compile_options("-stdlib=libc++")
|
||||||
add_link_options("-stdlib=libc++")
|
add_link_options("-stdlib=libc++")
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
include(CheckCXXCompilerFlag)
|
include(CheckCXXCompilerFlag)
|
||||||
include(FetchContent)
|
include(FetchContent)
|
||||||
include(ExternalProject)
|
include(ExternalProject)
|
||||||
include(CMakeFuncs) # must come *after* ExternalProject b/c it overrides one function in EP
|
include(CMakeFuncs) # must come *after* ExternalProject b/c it overrides one function in EP
|
||||||
if (target)
|
if(target)
|
||||||
message(FATAL_ERROR "The target option has been removed - use native cmake options to control build"
|
message(
|
||||||
|
FATAL_ERROR
|
||||||
|
"The target option has been removed - use native cmake options to control build"
|
||||||
)
|
)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
include(XrplSanity)
|
include(XrplSanity)
|
||||||
include(XrplVersion)
|
include(XrplVersion)
|
||||||
include(XrplSettings)
|
include(XrplSettings)
|
||||||
# this check has to remain in the top-level cmake because of the early return statement
|
# this check has to remain in the top-level cmake because of the early return statement
|
||||||
if (packages_only)
|
if(packages_only)
|
||||||
if (NOT TARGET rpm)
|
if(NOT TARGET rpm)
|
||||||
message(FATAL_ERROR "packages_only requested, but targets were not created - is docker installed?"
|
message(
|
||||||
|
FATAL_ERROR
|
||||||
|
"packages_only requested, but targets were not created - is docker installed?"
|
||||||
)
|
)
|
||||||
endif ()
|
endif()
|
||||||
return()
|
return()
|
||||||
endif ()
|
endif()
|
||||||
include(XrplCompiler)
|
include(XrplCompiler)
|
||||||
include(XrplSanitizers)
|
include(XrplSanitizers)
|
||||||
include(XrplInterface)
|
include(XrplInterface)
|
||||||
|
|
||||||
option(only_docs "Include only the docs target?" FALSE)
|
option(only_docs "Include only the docs target?" FALSE)
|
||||||
include(XrplDocs)
|
include(XrplDocs)
|
||||||
if (only_docs)
|
if(only_docs)
|
||||||
return()
|
return()
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
include(deps/Boost)
|
include(deps/Boost)
|
||||||
|
|
||||||
@@ -90,42 +97,46 @@ find_package(xxHash REQUIRED)
|
|||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
xrpl_libs
|
xrpl_libs
|
||||||
INTERFACE ed25519::ed25519
|
INTERFACE
|
||||||
lz4::lz4
|
ed25519::ed25519
|
||||||
OpenSSL::Crypto
|
lz4::lz4
|
||||||
OpenSSL::SSL
|
OpenSSL::Crypto
|
||||||
secp256k1::secp256k1
|
OpenSSL::SSL
|
||||||
soci::soci
|
secp256k1::secp256k1
|
||||||
SQLite::SQLite3)
|
soci::soci
|
||||||
|
SQLite::SQLite3
|
||||||
|
)
|
||||||
|
|
||||||
option(rocksdb "Enable RocksDB" ON)
|
option(rocksdb "Enable RocksDB" ON)
|
||||||
if (rocksdb)
|
if(rocksdb)
|
||||||
find_package(RocksDB REQUIRED)
|
find_package(RocksDB REQUIRED)
|
||||||
set_target_properties(RocksDB::rocksdb PROPERTIES INTERFACE_COMPILE_DEFINITIONS
|
set_target_properties(
|
||||||
XRPL_ROCKSDB_AVAILABLE=1)
|
RocksDB::rocksdb
|
||||||
|
PROPERTIES INTERFACE_COMPILE_DEFINITIONS XRPL_ROCKSDB_AVAILABLE=1
|
||||||
|
)
|
||||||
target_link_libraries(xrpl_libs INTERFACE RocksDB::rocksdb)
|
target_link_libraries(xrpl_libs INTERFACE RocksDB::rocksdb)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
# Work around changes to Conan recipe for now.
|
# Work around changes to Conan recipe for now.
|
||||||
if (TARGET nudb::core)
|
if(TARGET nudb::core)
|
||||||
set(nudb nudb::core)
|
set(nudb nudb::core)
|
||||||
elseif (TARGET NuDB::nudb)
|
elseif(TARGET NuDB::nudb)
|
||||||
set(nudb NuDB::nudb)
|
set(nudb NuDB::nudb)
|
||||||
else ()
|
else()
|
||||||
message(FATAL_ERROR "unknown nudb target")
|
message(FATAL_ERROR "unknown nudb target")
|
||||||
endif ()
|
endif()
|
||||||
target_link_libraries(xrpl_libs INTERFACE ${nudb})
|
target_link_libraries(xrpl_libs INTERFACE ${nudb})
|
||||||
|
|
||||||
if (coverage)
|
if(coverage)
|
||||||
include(XrplCov)
|
include(XrplCov)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
set(PROJECT_EXPORT_SET XrplExports)
|
set(PROJECT_EXPORT_SET XrplExports)
|
||||||
include(XrplCore)
|
include(XrplCore)
|
||||||
include(XrplInstall)
|
include(XrplInstall)
|
||||||
include(XrplValidatorKeys)
|
include(XrplValidatorKeys)
|
||||||
|
|
||||||
if (tests)
|
if(tests)
|
||||||
include(CTest)
|
include(CTest)
|
||||||
add_subdirectory(src/tests/libxrpl)
|
add_subdirectory(src/tests/libxrpl)
|
||||||
endif ()
|
endif()
|
||||||
|
|||||||
@@ -1,21 +0,0 @@
|
|||||||
Source: rippled
|
|
||||||
Section: net
|
|
||||||
Priority: optional
|
|
||||||
Maintainer: Michael Legleux <mlegleux@ripple.com>
|
|
||||||
Rules-Requires-Root: no
|
|
||||||
Build-Depends:
|
|
||||||
debhelper-compat (= 13),
|
|
||||||
Standards-Version: 4.7.0
|
|
||||||
Homepage: https://github.com/XRPLF/rippled
|
|
||||||
Vcs-Git: https://github.com/XRPLF/rippled.git
|
|
||||||
Vcs-Browser: https://github.com/XRPLF/rippled
|
|
||||||
|
|
||||||
Package: rippled
|
|
||||||
Section: net
|
|
||||||
Priority: optional
|
|
||||||
Architecture: any
|
|
||||||
Depends:
|
|
||||||
${shlibs:Depends},
|
|
||||||
${misc:Depends}
|
|
||||||
Description: XRP Ledger server daemon
|
|
||||||
XRPL server daemon providing ledger validation and p2p network services.
|
|
||||||
@@ -1,11 +0,0 @@
|
|||||||
opt/ripple/bin/rippled
|
|
||||||
|
|
||||||
opt/ripple/etc/rippled.cfg
|
|
||||||
opt/ripple/etc/validators.txt
|
|
||||||
|
|
||||||
# systemd unit (if you keep it in debian/ as a source file, do NOT list it here)
|
|
||||||
# If instead you stage it into debian/tmp, uncomment:
|
|
||||||
# lib/systemd/system/rippled.service
|
|
||||||
|
|
||||||
usr/share/doc/rippled/README.md
|
|
||||||
usr/share/doc/rippled/LICENSE.md
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
/opt/ripple/bin/rippled /usr/bin/rippled
|
|
||||||
/opt/ripple/etc/rippled.cfg /etc/opt/ripple/xrpld.cfg
|
|
||||||
/opt/ripple/etc/validators.txt /etc/opt/ripple/validators.txt
|
|
||||||
|
|
||||||
# TODO: Remove when rippled deprecated
|
|
||||||
/opt/ripple/bin/rippled /opt/ripple/bin/xrpld
|
|
||||||
/opt/ripple/etc/rippled.cfg /etc/opt/ripple/xrpld.cfg
|
|
||||||
/opt/ripple /opt/xrpld
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
/var/log/rippled/*.log {
|
|
||||||
daily
|
|
||||||
minsize 200M
|
|
||||||
rotate 7
|
|
||||||
nocreate
|
|
||||||
missingok
|
|
||||||
notifempty
|
|
||||||
compress
|
|
||||||
compresscmd /usr/bin/nice
|
|
||||||
compressoptions -n19 ionice -c3 gzip
|
|
||||||
compressext .gz
|
|
||||||
postrotate
|
|
||||||
/opt/ripple/bin/rippled --conf /opt/ripple/etc/rippled.cfg logrotate
|
|
||||||
endscript
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
[Unit]
|
|
||||||
Description=XRPL daemon
|
|
||||||
After=network-online.target
|
|
||||||
Wants=network-online.target
|
|
||||||
|
|
||||||
[Service]
|
|
||||||
Type=notify
|
|
||||||
|
|
||||||
User=rippled
|
|
||||||
Group=rippled
|
|
||||||
|
|
||||||
# Canonical config location (as you described)
|
|
||||||
ExecStart=/opt/ripple/bin/rippled --conf /etc/opt/ripple/rippled.cfg
|
|
||||||
|
|
||||||
# Reasonable hardening defaults (trim if they break your runtime)
|
|
||||||
NoNewPrivileges=true
|
|
||||||
PrivateTmp=true
|
|
||||||
ProtectSystem=strict
|
|
||||||
ProtectHome=true
|
|
||||||
ProtectControlGroups=true
|
|
||||||
ProtectKernelTunables=true
|
|
||||||
ProtectKernelModules=true
|
|
||||||
LockPersonality=true
|
|
||||||
RestrictRealtime=true
|
|
||||||
RestrictSUIDSGID=true
|
|
||||||
MemoryDenyWriteExecute=true
|
|
||||||
SystemCallArchitectures=native
|
|
||||||
|
|
||||||
# Allow writes only where you actually need them
|
|
||||||
ReadWritePaths=/var/lib/rippled /var/log/rippled
|
|
||||||
|
|
||||||
StateDirectory=rippled
|
|
||||||
LogsDirectory=rippled
|
|
||||||
|
|
||||||
Restart=on-failure
|
|
||||||
RestartSec=2s
|
|
||||||
TimeoutStopSec=30s
|
|
||||||
|
|
||||||
[Install]
|
|
||||||
WantedBy=multi-user.target
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
u rippled - "XRPL Daemon" /var/lib/ripled
|
|
||||||
|
|
||||||
# Type Name ID GECOS Home Shell
|
|
||||||
g rippled - - - -
|
|
||||||
u rippled - "XRPL rippled" /var/lib/rippled /usr/sbin/nologin
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
# StateDirectory/LogsDirectory/RuntimeDirectory in systemd service makes this redundant but this enables apt purge.
|
|
||||||
d /var/lib/rippled 0750 rippled rippled -
|
|
||||||
d /var/log/rippled 0750 rippled rippled -
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
#!/usr/bin/make -f
|
|
||||||
|
|
||||||
export DH_VERBOSE = 1
|
|
||||||
|
|
||||||
%:
|
|
||||||
dh $@
|
|
||||||
|
|
||||||
override_dh_auto_configure override_dh_auto_build override_dh_auto_test:
|
|
||||||
@:
|
|
||||||
|
|
||||||
override_dh_auto_install:
|
|
||||||
rm -rf debian/tmp
|
|
||||||
mkdir -p debian/tmp/opt/ripple/bin
|
|
||||||
mkdir -p debian/tmp/opt/ripple/etc
|
|
||||||
mkdir -p debian/tmp/usr
|
|
||||||
cp -a "$(INSTALL_TREE)/bin" debian/tmp/opt/ripple
|
|
||||||
cp -a "$(INSTALL_TREE)/etc" debian/tmp/opt/ripple
|
|
||||||
cp -a "$(INSTALL_TREE)/usr" debian/tmp
|
|
||||||
rm -rf debian/tmp/usr/include
|
|
||||||
rm -rf debian/tmp/usr/lib
|
|
||||||
install -Dm0644 README.md debian/tmp/usr/share/doc/rippled/README.md
|
|
||||||
install -Dm0644 LICENSE.md debian/tmp/usr/share/doc/rippled/LICENSE.md
|
|
||||||
install -Dm0644 cfg/rippled-example.cfg debian/tmp/opt/ripple/etc/rippled.cfg
|
|
||||||
install -Dm0644 cfg/validators-example.txt debian/tmp/opt/ripple/etc/validators.txt
|
|
||||||
|
|
||||||
override_dh_installsystemd:
|
|
||||||
dh_installsystemd
|
|
||||||
|
|
||||||
override_dh_installsysusers:
|
|
||||||
dh_installsysusers
|
|
||||||
|
|
||||||
override_dh_installtmpfiles:
|
|
||||||
dh_installtmpfiles
|
|
||||||
|
|
||||||
override_dh_install:
|
|
||||||
dh_install
|
|
||||||
|
|
||||||
override_dh_dwz:
|
|
||||||
@:
|
|
||||||
|
|
||||||
override_dh_strip:
|
|
||||||
dh_strip --no-automatic-dbgsym
|
|
||||||
@@ -1,29 +1,32 @@
|
|||||||
macro (exclude_from_default target_)
|
macro(exclude_from_default target_)
|
||||||
set_target_properties(${target_} PROPERTIES EXCLUDE_FROM_ALL ON)
|
set_target_properties(${target_} PROPERTIES EXCLUDE_FROM_ALL ON)
|
||||||
set_target_properties(${target_} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD ON)
|
set_target_properties(${target_} PROPERTIES EXCLUDE_FROM_DEFAULT_BUILD ON)
|
||||||
endmacro ()
|
endmacro()
|
||||||
|
|
||||||
macro (exclude_if_included target_)
|
macro(exclude_if_included target_)
|
||||||
get_directory_property(has_parent PARENT_DIRECTORY)
|
get_directory_property(has_parent PARENT_DIRECTORY)
|
||||||
if (has_parent)
|
if(has_parent)
|
||||||
exclude_from_default(${target_})
|
exclude_from_default(${target_})
|
||||||
endif ()
|
endif()
|
||||||
endmacro ()
|
endmacro()
|
||||||
|
|
||||||
find_package(Git)
|
find_package(Git)
|
||||||
|
|
||||||
function (git_branch branch_val)
|
function(git_branch branch_val)
|
||||||
if (NOT GIT_FOUND)
|
if(NOT GIT_FOUND)
|
||||||
return()
|
return()
|
||||||
endif ()
|
endif()
|
||||||
set(_branch "")
|
set(_branch "")
|
||||||
execute_process(COMMAND ${GIT_EXECUTABLE} "rev-parse" "--abbrev-ref" "HEAD"
|
execute_process(
|
||||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
COMMAND ${GIT_EXECUTABLE} "rev-parse" "--abbrev-ref" "HEAD"
|
||||||
RESULT_VARIABLE _git_exit_code
|
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
OUTPUT_VARIABLE _temp_branch
|
RESULT_VARIABLE _git_exit_code
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE ERROR_QUIET)
|
OUTPUT_VARIABLE _temp_branch
|
||||||
if (_git_exit_code EQUAL 0)
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
ERROR_QUIET
|
||||||
|
)
|
||||||
|
if(_git_exit_code EQUAL 0)
|
||||||
set(_branch ${_temp_branch})
|
set(_branch ${_temp_branch})
|
||||||
endif ()
|
endif()
|
||||||
set(${branch_val} "${_branch}" PARENT_SCOPE)
|
set(${branch_val} "${_branch}" PARENT_SCOPE)
|
||||||
endfunction ()
|
endfunction()
|
||||||
|
|||||||
@@ -1,50 +1,62 @@
|
|||||||
find_program(CCACHE_PATH "ccache")
|
find_program(CCACHE_PATH "ccache")
|
||||||
if (NOT CCACHE_PATH)
|
if(NOT CCACHE_PATH)
|
||||||
return()
|
return()
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
# For Linux and macOS we can use the ccache binary directly.
|
# For Linux and macOS we can use the ccache binary directly.
|
||||||
if (NOT MSVC)
|
if(NOT MSVC)
|
||||||
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PATH}")
|
set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PATH}")
|
||||||
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PATH}")
|
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PATH}")
|
||||||
message(STATUS "Found ccache: ${CCACHE_PATH}")
|
message(STATUS "Found ccache: ${CCACHE_PATH}")
|
||||||
return()
|
return()
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
# For Windows more effort is required. The code below is a modified version of
|
# For Windows more effort is required. The code below is a modified version of
|
||||||
# https://github.com/ccache/ccache/wiki/MS-Visual-Studio#usage-with-cmake.
|
# https://github.com/ccache/ccache/wiki/MS-Visual-Studio#usage-with-cmake.
|
||||||
if ("${CCACHE_PATH}" MATCHES "chocolatey")
|
if("${CCACHE_PATH}" MATCHES "chocolatey")
|
||||||
message(DEBUG "Ccache path: ${CCACHE_PATH}")
|
message(DEBUG "Ccache path: ${CCACHE_PATH}")
|
||||||
# Chocolatey uses a shim executable that we cannot use directly, in which case we have to find the executable it
|
# Chocolatey uses a shim executable that we cannot use directly, in which case we have to find the executable it
|
||||||
# points to. If we cannot find the target executable then we cannot use ccache.
|
# points to. If we cannot find the target executable then we cannot use ccache.
|
||||||
find_program(BASH_PATH "bash")
|
find_program(BASH_PATH "bash")
|
||||||
if (NOT BASH_PATH)
|
if(NOT BASH_PATH)
|
||||||
message(WARNING "Could not find bash.")
|
message(WARNING "Could not find bash.")
|
||||||
return()
|
return()
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
execute_process(COMMAND bash -c
|
execute_process(
|
||||||
"export LC_ALL='en_US.UTF-8'; ${CCACHE_PATH} --shimgen-noop | grep -oP 'path to executable: \\K.+' | head -c -1"
|
COMMAND
|
||||||
OUTPUT_VARIABLE CCACHE_PATH)
|
bash -c
|
||||||
|
"export LC_ALL='en_US.UTF-8'; ${CCACHE_PATH} --shimgen-noop | grep -oP 'path to executable: \\K.+' | head -c -1"
|
||||||
|
OUTPUT_VARIABLE CCACHE_PATH
|
||||||
|
)
|
||||||
|
|
||||||
if (NOT CCACHE_PATH)
|
if(NOT CCACHE_PATH)
|
||||||
message(WARNING "Could not find ccache target.")
|
message(WARNING "Could not find ccache target.")
|
||||||
return()
|
return()
|
||||||
endif ()
|
endif()
|
||||||
file(TO_CMAKE_PATH "${CCACHE_PATH}" CCACHE_PATH)
|
file(TO_CMAKE_PATH "${CCACHE_PATH}" CCACHE_PATH)
|
||||||
endif ()
|
endif()
|
||||||
message(STATUS "Found ccache: ${CCACHE_PATH}")
|
message(STATUS "Found ccache: ${CCACHE_PATH}")
|
||||||
|
|
||||||
# Tell cmake to use ccache for compiling with Visual Studio.
|
# Tell cmake to use ccache for compiling with Visual Studio.
|
||||||
file(COPY_FILE ${CCACHE_PATH} ${CMAKE_BINARY_DIR}/cl.exe ONLY_IF_DIFFERENT)
|
file(COPY_FILE ${CCACHE_PATH} ${CMAKE_BINARY_DIR}/cl.exe ONLY_IF_DIFFERENT)
|
||||||
set(CMAKE_VS_GLOBALS "CLToolExe=cl.exe" "CLToolPath=${CMAKE_BINARY_DIR}" "TrackFileAccess=false"
|
set(CMAKE_VS_GLOBALS
|
||||||
"UseMultiToolTask=true")
|
"CLToolExe=cl.exe"
|
||||||
|
"CLToolPath=${CMAKE_BINARY_DIR}"
|
||||||
|
"TrackFileAccess=false"
|
||||||
|
"UseMultiToolTask=true"
|
||||||
|
)
|
||||||
|
|
||||||
# By default Visual Studio generators will use /Zi to capture debug information, which is not compatible with ccache, so
|
# By default Visual Studio generators will use /Zi to capture debug information, which is not compatible with ccache, so
|
||||||
# tell it to use /Z7 instead.
|
# tell it to use /Z7 instead.
|
||||||
if (MSVC)
|
if(MSVC)
|
||||||
foreach (var_ CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG
|
foreach(
|
||||||
CMAKE_CXX_FLAGS_RELEASE)
|
var_
|
||||||
|
CMAKE_C_FLAGS_DEBUG
|
||||||
|
CMAKE_C_FLAGS_RELEASE
|
||||||
|
CMAKE_CXX_FLAGS_DEBUG
|
||||||
|
CMAKE_CXX_FLAGS_RELEASE
|
||||||
|
)
|
||||||
string(REPLACE "/Zi" "/Z7" ${var_} "${${var_}}")
|
string(REPLACE "/Zi" "/Z7" ${var_} "${${var_}}")
|
||||||
endforeach ()
|
endforeach()
|
||||||
endif ()
|
endif()
|
||||||
|
|||||||
@@ -174,37 +174,45 @@ option(CODE_COVERAGE_VERBOSE "Verbose information" FALSE)
|
|||||||
# Check prereqs
|
# Check prereqs
|
||||||
find_program(GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/scripts/test)
|
find_program(GCOVR_PATH gcovr PATHS ${CMAKE_SOURCE_DIR}/scripts/test)
|
||||||
|
|
||||||
if (DEFINED CODE_COVERAGE_GCOV_TOOL)
|
if(DEFINED CODE_COVERAGE_GCOV_TOOL)
|
||||||
set(GCOV_TOOL "${CODE_COVERAGE_GCOV_TOOL}")
|
set(GCOV_TOOL "${CODE_COVERAGE_GCOV_TOOL}")
|
||||||
elseif (DEFINED ENV{CODE_COVERAGE_GCOV_TOOL})
|
elseif(DEFINED ENV{CODE_COVERAGE_GCOV_TOOL})
|
||||||
set(GCOV_TOOL "$ENV{CODE_COVERAGE_GCOV_TOOL}")
|
set(GCOV_TOOL "$ENV{CODE_COVERAGE_GCOV_TOOL}")
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang")
|
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang")
|
||||||
if (APPLE)
|
if(APPLE)
|
||||||
execute_process(COMMAND xcrun -f llvm-cov OUTPUT_VARIABLE LLVMCOV_PATH
|
execute_process(
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
COMMAND xcrun -f llvm-cov
|
||||||
else ()
|
OUTPUT_VARIABLE LLVMCOV_PATH
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
)
|
||||||
|
else()
|
||||||
find_program(LLVMCOV_PATH llvm-cov)
|
find_program(LLVMCOV_PATH llvm-cov)
|
||||||
endif ()
|
endif()
|
||||||
if (LLVMCOV_PATH)
|
if(LLVMCOV_PATH)
|
||||||
set(GCOV_TOOL "${LLVMCOV_PATH} gcov")
|
set(GCOV_TOOL "${LLVMCOV_PATH} gcov")
|
||||||
endif ()
|
endif()
|
||||||
elseif ("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
||||||
find_program(GCOV_PATH gcov)
|
find_program(GCOV_PATH gcov)
|
||||||
set(GCOV_TOOL "${GCOV_PATH}")
|
set(GCOV_TOOL "${GCOV_PATH}")
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
# Check supported compiler (Clang, GNU and Flang)
|
# Check supported compiler (Clang, GNU and Flang)
|
||||||
get_property(LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
|
get_property(LANGUAGES GLOBAL PROPERTY ENABLED_LANGUAGES)
|
||||||
foreach (LANG ${LANGUAGES})
|
foreach(LANG ${LANGUAGES})
|
||||||
if ("${CMAKE_${LANG}_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang")
|
if("${CMAKE_${LANG}_COMPILER_ID}" MATCHES "(Apple)?[Cc]lang")
|
||||||
if ("${CMAKE_${LANG}_COMPILER_VERSION}" VERSION_LESS 3)
|
if("${CMAKE_${LANG}_COMPILER_VERSION}" VERSION_LESS 3)
|
||||||
message(FATAL_ERROR "Clang version must be 3.0.0 or greater! Aborting...")
|
message(
|
||||||
endif ()
|
FATAL_ERROR
|
||||||
elseif (NOT "${CMAKE_${LANG}_COMPILER_ID}" MATCHES "GNU" AND NOT "${CMAKE_${LANG}_COMPILER_ID}"
|
"Clang version must be 3.0.0 or greater! Aborting..."
|
||||||
MATCHES "(LLVM)?[Ff]lang")
|
)
|
||||||
|
endif()
|
||||||
|
elseif(
|
||||||
|
NOT "${CMAKE_${LANG}_COMPILER_ID}" MATCHES "GNU"
|
||||||
|
AND NOT "${CMAKE_${LANG}_COMPILER_ID}" MATCHES "(LLVM)?[Ff]lang"
|
||||||
|
)
|
||||||
message(FATAL_ERROR "Compiler is not GNU or Flang! Aborting...")
|
message(FATAL_ERROR "Compiler is not GNU or Flang! Aborting...")
|
||||||
endif ()
|
endif()
|
||||||
endforeach ()
|
endforeach()
|
||||||
|
|
||||||
set(COVERAGE_COMPILER_FLAGS "-g --coverage" CACHE INTERNAL "")
|
set(COVERAGE_COMPILER_FLAGS "-g --coverage" CACHE INTERNAL "")
|
||||||
|
|
||||||
@@ -213,7 +221,7 @@ set(COVERAGE_C_COMPILER_FLAGS "")
|
|||||||
set(COVERAGE_CXX_LINKER_FLAGS "")
|
set(COVERAGE_CXX_LINKER_FLAGS "")
|
||||||
set(COVERAGE_C_LINKER_FLAGS "")
|
set(COVERAGE_C_LINKER_FLAGS "")
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
|
if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
|
||||||
include(CheckCXXCompilerFlag)
|
include(CheckCXXCompilerFlag)
|
||||||
include(CheckCCompilerFlag)
|
include(CheckCCompilerFlag)
|
||||||
include(CheckLinkerFlag)
|
include(CheckLinkerFlag)
|
||||||
@@ -224,51 +232,77 @@ if (CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")
|
|||||||
set(COVERAGE_C_LINKER_FLAGS ${COVERAGE_COMPILER_FLAGS})
|
set(COVERAGE_C_LINKER_FLAGS ${COVERAGE_COMPILER_FLAGS})
|
||||||
|
|
||||||
check_cxx_compiler_flag(-fprofile-abs-path HAVE_cxx_fprofile_abs_path)
|
check_cxx_compiler_flag(-fprofile-abs-path HAVE_cxx_fprofile_abs_path)
|
||||||
if (HAVE_cxx_fprofile_abs_path)
|
if(HAVE_cxx_fprofile_abs_path)
|
||||||
set(COVERAGE_CXX_COMPILER_FLAGS "${COVERAGE_CXX_COMPILER_FLAGS} -fprofile-abs-path")
|
set(COVERAGE_CXX_COMPILER_FLAGS
|
||||||
endif ()
|
"${COVERAGE_CXX_COMPILER_FLAGS} -fprofile-abs-path"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
check_c_compiler_flag(-fprofile-abs-path HAVE_c_fprofile_abs_path)
|
check_c_compiler_flag(-fprofile-abs-path HAVE_c_fprofile_abs_path)
|
||||||
if (HAVE_c_fprofile_abs_path)
|
if(HAVE_c_fprofile_abs_path)
|
||||||
set(COVERAGE_C_COMPILER_FLAGS "${COVERAGE_C_COMPILER_FLAGS} -fprofile-abs-path")
|
set(COVERAGE_C_COMPILER_FLAGS
|
||||||
endif ()
|
"${COVERAGE_C_COMPILER_FLAGS} -fprofile-abs-path"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
check_linker_flag(CXX -fprofile-abs-path HAVE_cxx_linker_fprofile_abs_path)
|
check_linker_flag(CXX -fprofile-abs-path HAVE_cxx_linker_fprofile_abs_path)
|
||||||
if (HAVE_cxx_linker_fprofile_abs_path)
|
if(HAVE_cxx_linker_fprofile_abs_path)
|
||||||
set(COVERAGE_CXX_LINKER_FLAGS "${COVERAGE_CXX_LINKER_FLAGS} -fprofile-abs-path")
|
set(COVERAGE_CXX_LINKER_FLAGS
|
||||||
endif ()
|
"${COVERAGE_CXX_LINKER_FLAGS} -fprofile-abs-path"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
check_linker_flag(C -fprofile-abs-path HAVE_c_linker_fprofile_abs_path)
|
check_linker_flag(C -fprofile-abs-path HAVE_c_linker_fprofile_abs_path)
|
||||||
if (HAVE_c_linker_fprofile_abs_path)
|
if(HAVE_c_linker_fprofile_abs_path)
|
||||||
set(COVERAGE_C_LINKER_FLAGS "${COVERAGE_C_LINKER_FLAGS} -fprofile-abs-path")
|
set(COVERAGE_C_LINKER_FLAGS
|
||||||
endif ()
|
"${COVERAGE_C_LINKER_FLAGS} -fprofile-abs-path"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
check_cxx_compiler_flag(-fprofile-update=atomic HAVE_cxx_fprofile_update)
|
check_cxx_compiler_flag(-fprofile-update=atomic HAVE_cxx_fprofile_update)
|
||||||
if (HAVE_cxx_fprofile_update)
|
if(HAVE_cxx_fprofile_update)
|
||||||
set(COVERAGE_CXX_COMPILER_FLAGS "${COVERAGE_CXX_COMPILER_FLAGS} -fprofile-update=atomic")
|
set(COVERAGE_CXX_COMPILER_FLAGS
|
||||||
endif ()
|
"${COVERAGE_CXX_COMPILER_FLAGS} -fprofile-update=atomic"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
check_c_compiler_flag(-fprofile-update=atomic HAVE_c_fprofile_update)
|
check_c_compiler_flag(-fprofile-update=atomic HAVE_c_fprofile_update)
|
||||||
if (HAVE_c_fprofile_update)
|
if(HAVE_c_fprofile_update)
|
||||||
set(COVERAGE_C_COMPILER_FLAGS "${COVERAGE_C_COMPILER_FLAGS} -fprofile-update=atomic")
|
set(COVERAGE_C_COMPILER_FLAGS
|
||||||
endif ()
|
"${COVERAGE_C_COMPILER_FLAGS} -fprofile-update=atomic"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
check_linker_flag(CXX -fprofile-update=atomic HAVE_cxx_linker_fprofile_update)
|
check_linker_flag(
|
||||||
if (HAVE_cxx_linker_fprofile_update)
|
CXX
|
||||||
set(COVERAGE_CXX_LINKER_FLAGS "${COVERAGE_CXX_LINKER_FLAGS} -fprofile-update=atomic")
|
-fprofile-update=atomic
|
||||||
endif ()
|
HAVE_cxx_linker_fprofile_update
|
||||||
|
)
|
||||||
|
if(HAVE_cxx_linker_fprofile_update)
|
||||||
|
set(COVERAGE_CXX_LINKER_FLAGS
|
||||||
|
"${COVERAGE_CXX_LINKER_FLAGS} -fprofile-update=atomic"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
check_linker_flag(C -fprofile-update=atomic HAVE_c_linker_fprofile_update)
|
check_linker_flag(C -fprofile-update=atomic HAVE_c_linker_fprofile_update)
|
||||||
if (HAVE_c_linker_fprofile_update)
|
if(HAVE_c_linker_fprofile_update)
|
||||||
set(COVERAGE_C_LINKER_FLAGS "${COVERAGE_C_LINKER_FLAGS} -fprofile-update=atomic")
|
set(COVERAGE_C_LINKER_FLAGS
|
||||||
endif ()
|
"${COVERAGE_C_LINKER_FLAGS} -fprofile-update=atomic"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
endif ()
|
get_property(
|
||||||
|
GENERATOR_IS_MULTI_CONFIG
|
||||||
get_property(GENERATOR_IS_MULTI_CONFIG GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
GLOBAL
|
||||||
if (NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR GENERATOR_IS_MULTI_CONFIG))
|
PROPERTY GENERATOR_IS_MULTI_CONFIG
|
||||||
message(WARNING "Code coverage results with an optimised (non-Debug) build may be misleading")
|
)
|
||||||
endif () # NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR GENERATOR_IS_MULTI_CONFIG)
|
if(NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR GENERATOR_IS_MULTI_CONFIG))
|
||||||
|
message(
|
||||||
|
WARNING
|
||||||
|
"Code coverage results with an optimised (non-Debug) build may be misleading"
|
||||||
|
)
|
||||||
|
endif() # NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR GENERATOR_IS_MULTI_CONFIG)
|
||||||
|
|
||||||
# Defines a target for running and collection code coverage information
|
# Defines a target for running and collection code coverage information
|
||||||
# Builds dependencies, runs the given executable and outputs reports.
|
# Builds dependencies, runs the given executable and outputs reports.
|
||||||
@@ -292,125 +326,167 @@ endif () # NOT (CMAKE_BUILD_TYPE STREQUAL "Debug" OR GENERATOR_IS_MULTI_CONFIG)
|
|||||||
# )
|
# )
|
||||||
# The user can set the variable GCOVR_ADDITIONAL_ARGS to supply additional flags to the
|
# The user can set the variable GCOVR_ADDITIONAL_ARGS to supply additional flags to the
|
||||||
# GCVOR command.
|
# GCVOR command.
|
||||||
function (setup_target_for_coverage_gcovr)
|
function(setup_target_for_coverage_gcovr)
|
||||||
set(options NONE)
|
set(options NONE)
|
||||||
set(oneValueArgs BASE_DIRECTORY NAME FORMAT)
|
set(oneValueArgs BASE_DIRECTORY NAME FORMAT)
|
||||||
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
|
set(multiValueArgs EXCLUDE EXECUTABLE EXECUTABLE_ARGS DEPENDENCIES)
|
||||||
cmake_parse_arguments(Coverage "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
|
cmake_parse_arguments(
|
||||||
|
Coverage
|
||||||
|
"${options}"
|
||||||
|
"${oneValueArgs}"
|
||||||
|
"${multiValueArgs}"
|
||||||
|
${ARGN}
|
||||||
|
)
|
||||||
|
|
||||||
if (NOT GCOV_TOOL)
|
if(NOT GCOV_TOOL)
|
||||||
message(FATAL_ERROR "Could not find gcov or llvm-cov tool! Aborting...")
|
message(FATAL_ERROR "Could not find gcov or llvm-cov tool! Aborting...")
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
if (NOT GCOVR_PATH)
|
if(NOT GCOVR_PATH)
|
||||||
message(FATAL_ERROR "Could not find gcovr tool! Aborting...")
|
message(FATAL_ERROR "Could not find gcovr tool! Aborting...")
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
# Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
|
# Set base directory (as absolute path), or default to PROJECT_SOURCE_DIR
|
||||||
if (DEFINED Coverage_BASE_DIRECTORY)
|
if(DEFINED Coverage_BASE_DIRECTORY)
|
||||||
get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
|
get_filename_component(BASEDIR ${Coverage_BASE_DIRECTORY} ABSOLUTE)
|
||||||
else ()
|
else()
|
||||||
set(BASEDIR ${PROJECT_SOURCE_DIR})
|
set(BASEDIR ${PROJECT_SOURCE_DIR})
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
if (NOT DEFINED Coverage_FORMAT)
|
if(NOT DEFINED Coverage_FORMAT)
|
||||||
set(Coverage_FORMAT xml)
|
set(Coverage_FORMAT xml)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
if (NOT DEFINED Coverage_EXECUTABLE AND DEFINED Coverage_EXECUTABLE_ARGS)
|
if(NOT DEFINED Coverage_EXECUTABLE AND DEFINED Coverage_EXECUTABLE_ARGS)
|
||||||
message(FATAL_ERROR "EXECUTABLE_ARGS must not be set if EXECUTABLE is not set")
|
message(
|
||||||
endif ()
|
FATAL_ERROR
|
||||||
|
"EXECUTABLE_ARGS must not be set if EXECUTABLE is not set"
|
||||||
if ("--output" IN_LIST GCOVR_ADDITIONAL_ARGS)
|
|
||||||
message(FATAL_ERROR "Unsupported --output option detected in GCOVR_ADDITIONAL_ARGS! Aborting..."
|
|
||||||
)
|
)
|
||||||
else ()
|
endif()
|
||||||
if ((Coverage_FORMAT STREQUAL "html-details") OR (Coverage_FORMAT STREQUAL "html-nested"))
|
|
||||||
set(GCOVR_OUTPUT_FILE ${PROJECT_BINARY_DIR}/${Coverage_NAME}/index.html)
|
|
||||||
set(GCOVR_CREATE_FOLDER ${PROJECT_BINARY_DIR}/${Coverage_NAME})
|
|
||||||
elseif (Coverage_FORMAT STREQUAL "html-single")
|
|
||||||
set(GCOVR_OUTPUT_FILE ${Coverage_NAME}.html)
|
|
||||||
elseif ((Coverage_FORMAT STREQUAL "json-summary") OR (Coverage_FORMAT STREQUAL
|
|
||||||
"json-details")
|
|
||||||
OR (Coverage_FORMAT STREQUAL "coveralls"))
|
|
||||||
set(GCOVR_OUTPUT_FILE ${Coverage_NAME}.json)
|
|
||||||
elseif (Coverage_FORMAT STREQUAL "txt")
|
|
||||||
set(GCOVR_OUTPUT_FILE ${Coverage_NAME}.txt)
|
|
||||||
elseif (Coverage_FORMAT STREQUAL "csv")
|
|
||||||
set(GCOVR_OUTPUT_FILE ${Coverage_NAME}.csv)
|
|
||||||
elseif (Coverage_FORMAT STREQUAL "lcov")
|
|
||||||
set(GCOVR_OUTPUT_FILE ${Coverage_NAME}.lcov)
|
|
||||||
else ()
|
|
||||||
set(GCOVR_OUTPUT_FILE ${Coverage_NAME}.xml)
|
|
||||||
endif ()
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if ((Coverage_FORMAT STREQUAL "cobertura") OR (Coverage_FORMAT STREQUAL "xml"))
|
if("--output" IN_LIST GCOVR_ADDITIONAL_ARGS)
|
||||||
|
message(
|
||||||
|
FATAL_ERROR
|
||||||
|
"Unsupported --output option detected in GCOVR_ADDITIONAL_ARGS! Aborting..."
|
||||||
|
)
|
||||||
|
else()
|
||||||
|
if(
|
||||||
|
(Coverage_FORMAT STREQUAL "html-details")
|
||||||
|
OR (Coverage_FORMAT STREQUAL "html-nested")
|
||||||
|
)
|
||||||
|
set(GCOVR_OUTPUT_FILE
|
||||||
|
${PROJECT_BINARY_DIR}/${Coverage_NAME}/index.html
|
||||||
|
)
|
||||||
|
set(GCOVR_CREATE_FOLDER ${PROJECT_BINARY_DIR}/${Coverage_NAME})
|
||||||
|
elseif(Coverage_FORMAT STREQUAL "html-single")
|
||||||
|
set(GCOVR_OUTPUT_FILE ${Coverage_NAME}.html)
|
||||||
|
elseif(
|
||||||
|
(Coverage_FORMAT STREQUAL "json-summary")
|
||||||
|
OR (Coverage_FORMAT STREQUAL "json-details")
|
||||||
|
OR (Coverage_FORMAT STREQUAL "coveralls")
|
||||||
|
)
|
||||||
|
set(GCOVR_OUTPUT_FILE ${Coverage_NAME}.json)
|
||||||
|
elseif(Coverage_FORMAT STREQUAL "txt")
|
||||||
|
set(GCOVR_OUTPUT_FILE ${Coverage_NAME}.txt)
|
||||||
|
elseif(Coverage_FORMAT STREQUAL "csv")
|
||||||
|
set(GCOVR_OUTPUT_FILE ${Coverage_NAME}.csv)
|
||||||
|
elseif(Coverage_FORMAT STREQUAL "lcov")
|
||||||
|
set(GCOVR_OUTPUT_FILE ${Coverage_NAME}.lcov)
|
||||||
|
else()
|
||||||
|
set(GCOVR_OUTPUT_FILE ${Coverage_NAME}.xml)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
if(
|
||||||
|
(Coverage_FORMAT STREQUAL "cobertura")
|
||||||
|
OR (Coverage_FORMAT STREQUAL "xml")
|
||||||
|
)
|
||||||
list(APPEND GCOVR_ADDITIONAL_ARGS --cobertura "${GCOVR_OUTPUT_FILE}")
|
list(APPEND GCOVR_ADDITIONAL_ARGS --cobertura "${GCOVR_OUTPUT_FILE}")
|
||||||
list(APPEND GCOVR_ADDITIONAL_ARGS --cobertura-pretty)
|
list(APPEND GCOVR_ADDITIONAL_ARGS --cobertura-pretty)
|
||||||
set(Coverage_FORMAT cobertura) # overwrite xml
|
set(Coverage_FORMAT cobertura) # overwrite xml
|
||||||
elseif (Coverage_FORMAT STREQUAL "sonarqube")
|
elseif(Coverage_FORMAT STREQUAL "sonarqube")
|
||||||
list(APPEND GCOVR_ADDITIONAL_ARGS --sonarqube "${GCOVR_OUTPUT_FILE}")
|
list(APPEND GCOVR_ADDITIONAL_ARGS --sonarqube "${GCOVR_OUTPUT_FILE}")
|
||||||
elseif (Coverage_FORMAT STREQUAL "jacoco")
|
elseif(Coverage_FORMAT STREQUAL "jacoco")
|
||||||
list(APPEND GCOVR_ADDITIONAL_ARGS --jacoco "${GCOVR_OUTPUT_FILE}")
|
list(APPEND GCOVR_ADDITIONAL_ARGS --jacoco "${GCOVR_OUTPUT_FILE}")
|
||||||
list(APPEND GCOVR_ADDITIONAL_ARGS --jacoco-pretty)
|
list(APPEND GCOVR_ADDITIONAL_ARGS --jacoco-pretty)
|
||||||
elseif (Coverage_FORMAT STREQUAL "clover")
|
elseif(Coverage_FORMAT STREQUAL "clover")
|
||||||
list(APPEND GCOVR_ADDITIONAL_ARGS --clover "${GCOVR_OUTPUT_FILE}")
|
list(APPEND GCOVR_ADDITIONAL_ARGS --clover "${GCOVR_OUTPUT_FILE}")
|
||||||
list(APPEND GCOVR_ADDITIONAL_ARGS --clover-pretty)
|
list(APPEND GCOVR_ADDITIONAL_ARGS --clover-pretty)
|
||||||
elseif (Coverage_FORMAT STREQUAL "lcov")
|
elseif(Coverage_FORMAT STREQUAL "lcov")
|
||||||
list(APPEND GCOVR_ADDITIONAL_ARGS --lcov "${GCOVR_OUTPUT_FILE}")
|
list(APPEND GCOVR_ADDITIONAL_ARGS --lcov "${GCOVR_OUTPUT_FILE}")
|
||||||
elseif (Coverage_FORMAT STREQUAL "json-summary")
|
elseif(Coverage_FORMAT STREQUAL "json-summary")
|
||||||
list(APPEND GCOVR_ADDITIONAL_ARGS --json-summary "${GCOVR_OUTPUT_FILE}")
|
list(APPEND GCOVR_ADDITIONAL_ARGS --json-summary "${GCOVR_OUTPUT_FILE}")
|
||||||
list(APPEND GCOVR_ADDITIONAL_ARGS --json-summary-pretty)
|
list(APPEND GCOVR_ADDITIONAL_ARGS --json-summary-pretty)
|
||||||
elseif (Coverage_FORMAT STREQUAL "json-details")
|
elseif(Coverage_FORMAT STREQUAL "json-details")
|
||||||
list(APPEND GCOVR_ADDITIONAL_ARGS --json "${GCOVR_OUTPUT_FILE}")
|
list(APPEND GCOVR_ADDITIONAL_ARGS --json "${GCOVR_OUTPUT_FILE}")
|
||||||
list(APPEND GCOVR_ADDITIONAL_ARGS --json-pretty)
|
list(APPEND GCOVR_ADDITIONAL_ARGS --json-pretty)
|
||||||
elseif (Coverage_FORMAT STREQUAL "coveralls")
|
elseif(Coverage_FORMAT STREQUAL "coveralls")
|
||||||
list(APPEND GCOVR_ADDITIONAL_ARGS --coveralls "${GCOVR_OUTPUT_FILE}")
|
list(APPEND GCOVR_ADDITIONAL_ARGS --coveralls "${GCOVR_OUTPUT_FILE}")
|
||||||
list(APPEND GCOVR_ADDITIONAL_ARGS --coveralls-pretty)
|
list(APPEND GCOVR_ADDITIONAL_ARGS --coveralls-pretty)
|
||||||
elseif (Coverage_FORMAT STREQUAL "csv")
|
elseif(Coverage_FORMAT STREQUAL "csv")
|
||||||
list(APPEND GCOVR_ADDITIONAL_ARGS --csv "${GCOVR_OUTPUT_FILE}")
|
list(APPEND GCOVR_ADDITIONAL_ARGS --csv "${GCOVR_OUTPUT_FILE}")
|
||||||
elseif (Coverage_FORMAT STREQUAL "txt")
|
elseif(Coverage_FORMAT STREQUAL "txt")
|
||||||
list(APPEND GCOVR_ADDITIONAL_ARGS --txt "${GCOVR_OUTPUT_FILE}")
|
list(APPEND GCOVR_ADDITIONAL_ARGS --txt "${GCOVR_OUTPUT_FILE}")
|
||||||
elseif (Coverage_FORMAT STREQUAL "html-single")
|
elseif(Coverage_FORMAT STREQUAL "html-single")
|
||||||
list(APPEND GCOVR_ADDITIONAL_ARGS --html "${GCOVR_OUTPUT_FILE}")
|
list(APPEND GCOVR_ADDITIONAL_ARGS --html "${GCOVR_OUTPUT_FILE}")
|
||||||
list(APPEND GCOVR_ADDITIONAL_ARGS --html-self-contained)
|
list(APPEND GCOVR_ADDITIONAL_ARGS --html-self-contained)
|
||||||
elseif (Coverage_FORMAT STREQUAL "html-nested")
|
elseif(Coverage_FORMAT STREQUAL "html-nested")
|
||||||
list(APPEND GCOVR_ADDITIONAL_ARGS --html-nested "${GCOVR_OUTPUT_FILE}")
|
list(APPEND GCOVR_ADDITIONAL_ARGS --html-nested "${GCOVR_OUTPUT_FILE}")
|
||||||
elseif (Coverage_FORMAT STREQUAL "html-details")
|
elseif(Coverage_FORMAT STREQUAL "html-details")
|
||||||
list(APPEND GCOVR_ADDITIONAL_ARGS --html-details "${GCOVR_OUTPUT_FILE}")
|
list(APPEND GCOVR_ADDITIONAL_ARGS --html-details "${GCOVR_OUTPUT_FILE}")
|
||||||
else ()
|
else()
|
||||||
message(FATAL_ERROR "Unsupported output style ${Coverage_FORMAT}! Aborting...")
|
message(
|
||||||
endif ()
|
FATAL_ERROR
|
||||||
|
"Unsupported output style ${Coverage_FORMAT}! Aborting..."
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Collect excludes (CMake 3.4+: Also compute absolute paths)
|
# Collect excludes (CMake 3.4+: Also compute absolute paths)
|
||||||
set(GCOVR_EXCLUDES "")
|
set(GCOVR_EXCLUDES "")
|
||||||
foreach (EXCLUDE ${Coverage_EXCLUDE} ${COVERAGE_EXCLUDES} ${COVERAGE_GCOVR_EXCLUDES})
|
foreach(
|
||||||
if (CMAKE_VERSION VERSION_GREATER 3.4)
|
EXCLUDE
|
||||||
get_filename_component(EXCLUDE ${EXCLUDE} ABSOLUTE BASE_DIR ${BASEDIR})
|
${Coverage_EXCLUDE}
|
||||||
endif ()
|
${COVERAGE_EXCLUDES}
|
||||||
|
${COVERAGE_GCOVR_EXCLUDES}
|
||||||
|
)
|
||||||
|
if(CMAKE_VERSION VERSION_GREATER 3.4)
|
||||||
|
get_filename_component(
|
||||||
|
EXCLUDE
|
||||||
|
${EXCLUDE}
|
||||||
|
ABSOLUTE
|
||||||
|
BASE_DIR ${BASEDIR}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
list(APPEND GCOVR_EXCLUDES "${EXCLUDE}")
|
list(APPEND GCOVR_EXCLUDES "${EXCLUDE}")
|
||||||
endforeach ()
|
endforeach()
|
||||||
list(REMOVE_DUPLICATES GCOVR_EXCLUDES)
|
list(REMOVE_DUPLICATES GCOVR_EXCLUDES)
|
||||||
|
|
||||||
# Combine excludes to several -e arguments
|
# Combine excludes to several -e arguments
|
||||||
set(GCOVR_EXCLUDE_ARGS "")
|
set(GCOVR_EXCLUDE_ARGS "")
|
||||||
foreach (EXCLUDE ${GCOVR_EXCLUDES})
|
foreach(EXCLUDE ${GCOVR_EXCLUDES})
|
||||||
list(APPEND GCOVR_EXCLUDE_ARGS "-e")
|
list(APPEND GCOVR_EXCLUDE_ARGS "-e")
|
||||||
list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
|
list(APPEND GCOVR_EXCLUDE_ARGS "${EXCLUDE}")
|
||||||
endforeach ()
|
endforeach()
|
||||||
|
|
||||||
# Set up commands which will be run to generate coverage data
|
# Set up commands which will be run to generate coverage data
|
||||||
# If EXECUTABLE is not set, the user is expected to run the tests manually
|
# If EXECUTABLE is not set, the user is expected to run the tests manually
|
||||||
# before running the coverage target NAME
|
# before running the coverage target NAME
|
||||||
if (DEFINED Coverage_EXECUTABLE)
|
if(DEFINED Coverage_EXECUTABLE)
|
||||||
set(GCOVR_EXEC_TESTS_CMD ${Coverage_EXECUTABLE} ${Coverage_EXECUTABLE_ARGS})
|
set(GCOVR_EXEC_TESTS_CMD
|
||||||
endif ()
|
${Coverage_EXECUTABLE}
|
||||||
|
${Coverage_EXECUTABLE_ARGS}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Create folder
|
# Create folder
|
||||||
if (DEFINED GCOVR_CREATE_FOLDER)
|
if(DEFINED GCOVR_CREATE_FOLDER)
|
||||||
set(GCOVR_FOLDER_CMD ${CMAKE_COMMAND} -E make_directory ${GCOVR_CREATE_FOLDER})
|
set(GCOVR_FOLDER_CMD
|
||||||
endif ()
|
${CMAKE_COMMAND}
|
||||||
|
-E
|
||||||
|
make_directory
|
||||||
|
${GCOVR_CREATE_FOLDER}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Running gcovr
|
# Running gcovr
|
||||||
set(GCOVR_CMD
|
set(GCOVR_CMD
|
||||||
@@ -422,56 +498,95 @@ function (setup_target_for_coverage_gcovr)
|
|||||||
${BASEDIR}
|
${BASEDIR}
|
||||||
${GCOVR_ADDITIONAL_ARGS}
|
${GCOVR_ADDITIONAL_ARGS}
|
||||||
${GCOVR_EXCLUDE_ARGS}
|
${GCOVR_EXCLUDE_ARGS}
|
||||||
--object-directory=${PROJECT_BINARY_DIR})
|
--object-directory=${PROJECT_BINARY_DIR}
|
||||||
|
)
|
||||||
|
|
||||||
if (CODE_COVERAGE_VERBOSE)
|
if(CODE_COVERAGE_VERBOSE)
|
||||||
message(STATUS "Executed command report")
|
message(STATUS "Executed command report")
|
||||||
|
|
||||||
if (NOT "${GCOVR_EXEC_TESTS_CMD}" STREQUAL "")
|
if(NOT "${GCOVR_EXEC_TESTS_CMD}" STREQUAL "")
|
||||||
message(STATUS "Command to run tests: ")
|
message(STATUS "Command to run tests: ")
|
||||||
string(REPLACE ";" " " GCOVR_EXEC_TESTS_CMD_SPACED "${GCOVR_EXEC_TESTS_CMD}")
|
string(
|
||||||
|
REPLACE ";"
|
||||||
|
" "
|
||||||
|
GCOVR_EXEC_TESTS_CMD_SPACED
|
||||||
|
"${GCOVR_EXEC_TESTS_CMD}"
|
||||||
|
)
|
||||||
message(STATUS "${GCOVR_EXEC_TESTS_CMD_SPACED}")
|
message(STATUS "${GCOVR_EXEC_TESTS_CMD_SPACED}")
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
if (NOT "${GCOVR_FOLDER_CMD}" STREQUAL "")
|
if(NOT "${GCOVR_FOLDER_CMD}" STREQUAL "")
|
||||||
message(STATUS "Command to create a folder: ")
|
message(STATUS "Command to create a folder: ")
|
||||||
string(REPLACE ";" " " GCOVR_FOLDER_CMD_SPACED "${GCOVR_FOLDER_CMD}")
|
string(
|
||||||
|
REPLACE ";"
|
||||||
|
" "
|
||||||
|
GCOVR_FOLDER_CMD_SPACED
|
||||||
|
"${GCOVR_FOLDER_CMD}"
|
||||||
|
)
|
||||||
message(STATUS "${GCOVR_FOLDER_CMD_SPACED}")
|
message(STATUS "${GCOVR_FOLDER_CMD_SPACED}")
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
message(STATUS "Command to generate gcovr coverage data: ")
|
message(STATUS "Command to generate gcovr coverage data: ")
|
||||||
string(REPLACE ";" " " GCOVR_CMD_SPACED "${GCOVR_CMD}")
|
string(REPLACE ";" " " GCOVR_CMD_SPACED "${GCOVR_CMD}")
|
||||||
message(STATUS "${GCOVR_CMD_SPACED}")
|
message(STATUS "${GCOVR_CMD_SPACED}")
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
add_custom_target(${Coverage_NAME}
|
add_custom_target(
|
||||||
COMMAND ${GCOVR_EXEC_TESTS_CMD}
|
${Coverage_NAME}
|
||||||
COMMAND ${GCOVR_FOLDER_CMD}
|
COMMAND ${GCOVR_EXEC_TESTS_CMD}
|
||||||
COMMAND ${GCOVR_CMD}
|
COMMAND ${GCOVR_FOLDER_CMD}
|
||||||
BYPRODUCTS ${GCOVR_OUTPUT_FILE}
|
COMMAND ${GCOVR_CMD}
|
||||||
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
BYPRODUCTS ${GCOVR_OUTPUT_FILE}
|
||||||
DEPENDS ${Coverage_DEPENDENCIES}
|
WORKING_DIRECTORY ${PROJECT_BINARY_DIR}
|
||||||
VERBATIM # Protect arguments to commands
|
DEPENDS ${Coverage_DEPENDENCIES}
|
||||||
COMMENT "Running gcovr to produce code coverage report.")
|
VERBATIM # Protect arguments to commands
|
||||||
|
COMMENT "Running gcovr to produce code coverage report."
|
||||||
|
)
|
||||||
|
|
||||||
# Show info where to find the report
|
# Show info where to find the report
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
TARGET ${Coverage_NAME} POST_BUILD COMMAND echo
|
TARGET ${Coverage_NAME}
|
||||||
COMMENT "Code coverage report saved in ${GCOVR_OUTPUT_FILE} formatted as ${Coverage_FORMAT}"
|
POST_BUILD
|
||||||
|
COMMAND echo
|
||||||
|
COMMENT
|
||||||
|
"Code coverage report saved in ${GCOVR_OUTPUT_FILE} formatted as ${Coverage_FORMAT}"
|
||||||
)
|
)
|
||||||
endfunction () # setup_target_for_coverage_gcovr
|
endfunction() # setup_target_for_coverage_gcovr
|
||||||
|
|
||||||
function (add_code_coverage_to_target name scope)
|
function(add_code_coverage_to_target name scope)
|
||||||
separate_arguments(COVERAGE_CXX_COMPILER_FLAGS NATIVE_COMMAND "${COVERAGE_CXX_COMPILER_FLAGS}")
|
separate_arguments(
|
||||||
separate_arguments(COVERAGE_C_COMPILER_FLAGS NATIVE_COMMAND "${COVERAGE_C_COMPILER_FLAGS}")
|
COVERAGE_CXX_COMPILER_FLAGS
|
||||||
separate_arguments(COVERAGE_CXX_LINKER_FLAGS NATIVE_COMMAND "${COVERAGE_CXX_LINKER_FLAGS}")
|
NATIVE_COMMAND
|
||||||
separate_arguments(COVERAGE_C_LINKER_FLAGS NATIVE_COMMAND "${COVERAGE_C_LINKER_FLAGS}")
|
"${COVERAGE_CXX_COMPILER_FLAGS}"
|
||||||
|
)
|
||||||
|
separate_arguments(
|
||||||
|
COVERAGE_C_COMPILER_FLAGS
|
||||||
|
NATIVE_COMMAND
|
||||||
|
"${COVERAGE_C_COMPILER_FLAGS}"
|
||||||
|
)
|
||||||
|
separate_arguments(
|
||||||
|
COVERAGE_CXX_LINKER_FLAGS
|
||||||
|
NATIVE_COMMAND
|
||||||
|
"${COVERAGE_CXX_LINKER_FLAGS}"
|
||||||
|
)
|
||||||
|
separate_arguments(
|
||||||
|
COVERAGE_C_LINKER_FLAGS
|
||||||
|
NATIVE_COMMAND
|
||||||
|
"${COVERAGE_C_LINKER_FLAGS}"
|
||||||
|
)
|
||||||
|
|
||||||
# Add compiler options to the target
|
# Add compiler options to the target
|
||||||
target_compile_options(
|
target_compile_options(
|
||||||
${name} ${scope} $<$<COMPILE_LANGUAGE:CXX>:${COVERAGE_CXX_COMPILER_FLAGS}>
|
${name}
|
||||||
$<$<COMPILE_LANGUAGE:C>:${COVERAGE_C_COMPILER_FLAGS}>)
|
${scope}
|
||||||
|
$<$<COMPILE_LANGUAGE:CXX>:${COVERAGE_CXX_COMPILER_FLAGS}>
|
||||||
|
$<$<COMPILE_LANGUAGE:C>:${COVERAGE_C_COMPILER_FLAGS}>
|
||||||
|
)
|
||||||
|
|
||||||
target_link_libraries(${name} ${scope} $<$<LINK_LANGUAGE:CXX>:${COVERAGE_CXX_LINKER_FLAGS}>
|
target_link_libraries(
|
||||||
$<$<LINK_LANGUAGE:C>:${COVERAGE_C_LINKER_FLAGS}>)
|
${name}
|
||||||
endfunction () # add_code_coverage_to_target
|
${scope}
|
||||||
|
$<$<LINK_LANGUAGE:CXX>:${COVERAGE_CXX_LINKER_FLAGS}>
|
||||||
|
$<$<LINK_LANGUAGE:C>:${COVERAGE_C_LINKER_FLAGS}>
|
||||||
|
)
|
||||||
|
endfunction() # add_code_coverage_to_target
|
||||||
|
|||||||
@@ -14,20 +14,20 @@ set(is_gcc FALSE)
|
|||||||
set(is_msvc FALSE)
|
set(is_msvc FALSE)
|
||||||
set(is_xcode FALSE)
|
set(is_xcode FALSE)
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") # Clang or AppleClang
|
if(CMAKE_CXX_COMPILER_ID MATCHES ".*Clang") # Clang or AppleClang
|
||||||
set(is_clang TRUE)
|
set(is_clang TRUE)
|
||||||
elseif (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
elseif(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||||
set(is_gcc TRUE)
|
set(is_gcc TRUE)
|
||||||
elseif (MSVC)
|
elseif(MSVC)
|
||||||
set(is_msvc TRUE)
|
set(is_msvc TRUE)
|
||||||
else ()
|
else()
|
||||||
message(FATAL_ERROR "Unsupported C++ compiler: ${CMAKE_CXX_COMPILER_ID}")
|
message(FATAL_ERROR "Unsupported C++ compiler: ${CMAKE_CXX_COMPILER_ID}")
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
# Xcode generator detection
|
# Xcode generator detection
|
||||||
if (CMAKE_GENERATOR STREQUAL "Xcode")
|
if(CMAKE_GENERATOR STREQUAL "Xcode")
|
||||||
set(is_xcode TRUE)
|
set(is_xcode TRUE)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
# Operating system detection
|
# Operating system detection
|
||||||
@@ -36,23 +36,23 @@ set(is_linux FALSE)
|
|||||||
set(is_windows FALSE)
|
set(is_windows FALSE)
|
||||||
set(is_macos FALSE)
|
set(is_macos FALSE)
|
||||||
|
|
||||||
if (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
if(CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
||||||
set(is_linux TRUE)
|
set(is_linux TRUE)
|
||||||
elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
||||||
set(is_windows TRUE)
|
set(is_windows TRUE)
|
||||||
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
elseif(CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
||||||
set(is_macos TRUE)
|
set(is_macos TRUE)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
# Architecture
|
# Architecture
|
||||||
# --------------------------------------------------------------------
|
# --------------------------------------------------------------------
|
||||||
set(is_amd64 FALSE)
|
set(is_amd64 FALSE)
|
||||||
set(is_arm64 FALSE)
|
set(is_arm64 FALSE)
|
||||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64|AMD64")
|
||||||
set(is_amd64 TRUE)
|
set(is_amd64 TRUE)
|
||||||
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64|ARM64")
|
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64|arm64|ARM64")
|
||||||
set(is_arm64 TRUE)
|
set(is_arm64 TRUE)
|
||||||
else ()
|
else()
|
||||||
message(FATAL_ERROR "Unknown architecture: ${CMAKE_SYSTEM_PROCESSOR}")
|
message(FATAL_ERROR "Unknown architecture: ${CMAKE_SYSTEM_PROCESSOR}")
|
||||||
endif ()
|
endif()
|
||||||
|
|||||||
@@ -4,18 +4,25 @@ set(GIT_BUILD_BRANCH "")
|
|||||||
set(GIT_COMMIT_HASH "")
|
set(GIT_COMMIT_HASH "")
|
||||||
|
|
||||||
find_package(Git)
|
find_package(Git)
|
||||||
if (NOT Git_FOUND)
|
if(NOT Git_FOUND)
|
||||||
message(WARNING "Git not found. Git branch and commit hash will be empty.")
|
message(WARNING "Git not found. Git branch and commit hash will be empty.")
|
||||||
return()
|
return()
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
set(GIT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/.git)
|
set(GIT_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/.git)
|
||||||
|
|
||||||
execute_process(COMMAND ${GIT_EXECUTABLE} --git-dir=${GIT_DIRECTORY} rev-parse --abbrev-ref HEAD
|
execute_process(
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE GIT_BUILD_BRANCH)
|
COMMAND
|
||||||
|
${GIT_EXECUTABLE} --git-dir=${GIT_DIRECTORY} rev-parse --abbrev-ref HEAD
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
OUTPUT_VARIABLE GIT_BUILD_BRANCH
|
||||||
|
)
|
||||||
|
|
||||||
execute_process(COMMAND ${GIT_EXECUTABLE} --git-dir=${GIT_DIRECTORY} rev-parse HEAD
|
execute_process(
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE OUTPUT_VARIABLE GIT_COMMIT_HASH)
|
COMMAND ${GIT_EXECUTABLE} --git-dir=${GIT_DIRECTORY} rev-parse HEAD
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
OUTPUT_VARIABLE GIT_COMMIT_HASH
|
||||||
|
)
|
||||||
|
|
||||||
message(STATUS "Git branch: ${GIT_BUILD_BRANCH}")
|
message(STATUS "Git branch: ${GIT_BUILD_BRANCH}")
|
||||||
message(STATUS "Git commit hash: ${GIT_COMMIT_HASH}")
|
message(STATUS "Git commit hash: ${GIT_COMMIT_HASH}")
|
||||||
|
|||||||
@@ -1,13 +1,22 @@
|
|||||||
include(isolate_headers)
|
include(isolate_headers)
|
||||||
|
|
||||||
function (xrpl_add_test name)
|
function(xrpl_add_test name)
|
||||||
set(target ${PROJECT_NAME}.test.${name})
|
set(target ${PROJECT_NAME}.test.${name})
|
||||||
|
|
||||||
file(GLOB_RECURSE sources CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/${name}/*.cpp"
|
file(
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/${name}.cpp")
|
GLOB_RECURSE sources
|
||||||
|
CONFIGURE_DEPENDS
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/${name}/*.cpp"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/${name}.cpp"
|
||||||
|
)
|
||||||
add_executable(${target} ${ARGN} ${sources})
|
add_executable(${target} ${ARGN} ${sources})
|
||||||
|
|
||||||
isolate_headers(${target} "${CMAKE_SOURCE_DIR}" "${CMAKE_SOURCE_DIR}/tests/${name}" PRIVATE)
|
isolate_headers(
|
||||||
|
${target}
|
||||||
|
"${CMAKE_SOURCE_DIR}"
|
||||||
|
"${CMAKE_SOURCE_DIR}/tests/${name}"
|
||||||
|
PRIVATE
|
||||||
|
)
|
||||||
|
|
||||||
add_test(NAME ${target} COMMAND ${target})
|
add_test(NAME ${target} COMMAND ${target})
|
||||||
endfunction ()
|
endfunction()
|
||||||
|
|||||||
@@ -14,33 +14,42 @@ include(XrplSanitizers)
|
|||||||
# add a single global dependency on this interface lib
|
# add a single global dependency on this interface lib
|
||||||
link_libraries(Xrpl::common)
|
link_libraries(Xrpl::common)
|
||||||
# Respect CMAKE_POSITION_INDEPENDENT_CODE setting (may be set by Conan toolchain)
|
# Respect CMAKE_POSITION_INDEPENDENT_CODE setting (may be set by Conan toolchain)
|
||||||
if (NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE)
|
if(NOT DEFINED CMAKE_POSITION_INDEPENDENT_CODE)
|
||||||
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||||
endif ()
|
endif()
|
||||||
set_target_properties(common PROPERTIES INTERFACE_POSITION_INDEPENDENT_CODE
|
set_target_properties(
|
||||||
${CMAKE_POSITION_INDEPENDENT_CODE})
|
common
|
||||||
|
PROPERTIES
|
||||||
|
INTERFACE_POSITION_INDEPENDENT_CODE ${CMAKE_POSITION_INDEPENDENT_CODE}
|
||||||
|
)
|
||||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
common
|
common
|
||||||
INTERFACE $<$<CONFIG:Debug>:DEBUG
|
INTERFACE
|
||||||
_DEBUG>
|
$<$<CONFIG:Debug>:DEBUG
|
||||||
#[===[
|
_DEBUG>
|
||||||
|
#[===[
|
||||||
NOTE: CMAKE release builds already have NDEBUG defined, so no need to add it
|
NOTE: CMAKE release builds already have NDEBUG defined, so no need to add it
|
||||||
explicitly except for the special case of (profile ON) and (assert OFF).
|
explicitly except for the special case of (profile ON) and (assert OFF).
|
||||||
Presumably this is because we don't want profile builds asserting unless
|
Presumably this is because we don't want profile builds asserting unless
|
||||||
asserts were specifically requested.
|
asserts were specifically requested.
|
||||||
]===]
|
]===]
|
||||||
$<$<AND:$<BOOL:${profile}>,$<NOT:$<BOOL:${assert}>>>:NDEBUG>
|
$<$<AND:$<BOOL:${profile}>,$<NOT:$<BOOL:${assert}>>>:NDEBUG>
|
||||||
# TODO: Remove once we have migrated functions from OpenSSL 1.x to 3.x.
|
# TODO: Remove once we have migrated functions from OpenSSL 1.x to 3.x.
|
||||||
OPENSSL_SUPPRESS_DEPRECATED)
|
OPENSSL_SUPPRESS_DEPRECATED
|
||||||
|
)
|
||||||
|
|
||||||
if (MSVC)
|
if(MSVC)
|
||||||
# remove existing exception flag since we set it to -EHa
|
# remove existing exception flag since we set it to -EHa
|
||||||
string(REGEX REPLACE "[-/]EH[a-z]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
string(REGEX REPLACE "[-/]EH[a-z]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
|
||||||
|
|
||||||
foreach (var_ CMAKE_C_FLAGS_DEBUG CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_DEBUG
|
foreach(
|
||||||
CMAKE_CXX_FLAGS_RELEASE)
|
var_
|
||||||
|
CMAKE_C_FLAGS_DEBUG
|
||||||
|
CMAKE_C_FLAGS_RELEASE
|
||||||
|
CMAKE_CXX_FLAGS_DEBUG
|
||||||
|
CMAKE_CXX_FLAGS_RELEASE
|
||||||
|
)
|
||||||
# also remove dynamic runtime
|
# also remove dynamic runtime
|
||||||
string(REGEX REPLACE "[-/]MD[d]*" " " ${var_} "${${var_}}")
|
string(REGEX REPLACE "[-/]MD[d]*" " " ${var_} "${${var_}}")
|
||||||
|
|
||||||
@@ -48,120 +57,143 @@ if (MSVC)
|
|||||||
string(REPLACE "/ZI" "/Zi" ${var_} "${${var_}}")
|
string(REPLACE "/ZI" "/Zi" ${var_} "${${var_}}")
|
||||||
|
|
||||||
# omit debug info completely under CI (not needed)
|
# omit debug info completely under CI (not needed)
|
||||||
if (is_ci)
|
if(is_ci)
|
||||||
string(REPLACE "/Zi" " " ${var_} "${${var_}}")
|
string(REPLACE "/Zi" " " ${var_} "${${var_}}")
|
||||||
string(REPLACE "/Z7" " " ${var_} "${${var_}}")
|
string(REPLACE "/Z7" " " ${var_} "${${var_}}")
|
||||||
endif ()
|
endif()
|
||||||
endforeach ()
|
endforeach()
|
||||||
|
|
||||||
target_compile_options(
|
target_compile_options(
|
||||||
common
|
common
|
||||||
INTERFACE # Increase object file max size
|
INTERFACE # Increase object file max size
|
||||||
-bigobj
|
-bigobj
|
||||||
# Floating point behavior
|
# Floating point behavior
|
||||||
-fp:precise
|
-fp:precise
|
||||||
# __cdecl calling convention
|
# __cdecl calling convention
|
||||||
-Gd
|
-Gd
|
||||||
# Minimal rebuild: disabled
|
# Minimal rebuild: disabled
|
||||||
-Gm-
|
-Gm-
|
||||||
# Function level linking: disabled
|
# Function level linking: disabled
|
||||||
-Gy-
|
-Gy-
|
||||||
# Multiprocessor compilation
|
# Multiprocessor compilation
|
||||||
-MP
|
-MP
|
||||||
# pragma omp: disabled
|
# pragma omp: disabled
|
||||||
-openmp-
|
-openmp-
|
||||||
# No error reporting to Internet
|
# No error reporting to Internet
|
||||||
-errorReport:none
|
-errorReport:none
|
||||||
# Suppress login banner
|
# Suppress login banner
|
||||||
-nologo
|
-nologo
|
||||||
# Disable signed/unsigned comparison warnings
|
# Disable signed/unsigned comparison warnings
|
||||||
-wd4018
|
-wd4018
|
||||||
# Disable float to int possible loss of data warnings
|
# Disable float to int possible loss of data warnings
|
||||||
-wd4244
|
-wd4244
|
||||||
# Disable size_t to T possible loss of data warnings
|
# Disable size_t to T possible loss of data warnings
|
||||||
-wd4267
|
-wd4267
|
||||||
# Disable C4800(int to bool performance)
|
# Disable C4800(int to bool performance)
|
||||||
-wd4800
|
-wd4800
|
||||||
# Decorated name length exceeded, name was truncated
|
# Decorated name length exceeded, name was truncated
|
||||||
-wd4503
|
-wd4503
|
||||||
$<$<COMPILE_LANGUAGE:CXX>:
|
$<$<COMPILE_LANGUAGE:CXX>:
|
||||||
-EHa
|
-EHa
|
||||||
-GR
|
-GR
|
||||||
>
|
>
|
||||||
$<$<CONFIG:Release>:-Ox>
|
$<$<CONFIG:Release>:-Ox>
|
||||||
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:Debug>>:
|
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:Debug>>:
|
||||||
-GS
|
-GS
|
||||||
-Zc:forScope
|
-Zc:forScope
|
||||||
>
|
>
|
||||||
# static runtime
|
# static runtime
|
||||||
$<$<CONFIG:Debug>:-MTd>
|
$<$<CONFIG:Debug>:-MTd>
|
||||||
$<$<NOT:$<CONFIG:Debug>>:-MT>
|
$<$<NOT:$<CONFIG:Debug>>:-MT>
|
||||||
$<$<BOOL:${werr}>:-WX>)
|
$<$<BOOL:${werr}>:-WX>
|
||||||
|
)
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
common
|
common
|
||||||
INTERFACE _WIN32_WINNT=0x6000
|
INTERFACE
|
||||||
_SCL_SECURE_NO_WARNINGS
|
_WIN32_WINNT=0x6000
|
||||||
_CRT_SECURE_NO_WARNINGS
|
_SCL_SECURE_NO_WARNINGS
|
||||||
WIN32_CONSOLE
|
_CRT_SECURE_NO_WARNINGS
|
||||||
WIN32_LEAN_AND_MEAN
|
WIN32_CONSOLE
|
||||||
NOMINMAX
|
WIN32_LEAN_AND_MEAN
|
||||||
# TODO: Resolve these warnings, don't just silence them
|
NOMINMAX
|
||||||
_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS
|
# TODO: Resolve these warnings, don't just silence them
|
||||||
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:Debug>>:_CRTDBG_MAP_ALLOC>)
|
_SILENCE_ALL_CXX17_DEPRECATION_WARNINGS
|
||||||
|
$<$<AND:$<COMPILE_LANGUAGE:CXX>,$<CONFIG:Debug>>:_CRTDBG_MAP_ALLOC>
|
||||||
|
)
|
||||||
target_link_libraries(common INTERFACE -errorreport:none -machine:X64)
|
target_link_libraries(common INTERFACE -errorreport:none -machine:X64)
|
||||||
else ()
|
else()
|
||||||
target_compile_options(
|
target_compile_options(
|
||||||
common
|
common
|
||||||
INTERFACE -Wall
|
INTERFACE
|
||||||
-Wdeprecated
|
-Wall
|
||||||
$<$<BOOL:${is_clang}>:-Wno-deprecated-declarations>
|
-Wdeprecated
|
||||||
$<$<BOOL:${wextra}>:-Wextra
|
$<$<BOOL:${is_clang}>:-Wno-deprecated-declarations>
|
||||||
-Wno-unused-parameter>
|
$<$<BOOL:${wextra}>:-Wextra
|
||||||
$<$<BOOL:${werr}>:-Werror>
|
-Wno-unused-parameter>
|
||||||
-fstack-protector
|
$<$<BOOL:${werr}>:-Werror>
|
||||||
-Wno-sign-compare
|
-fstack-protector
|
||||||
-Wno-unused-but-set-variable
|
-Wno-sign-compare
|
||||||
$<$<NOT:$<CONFIG:Debug>>:-fno-strict-aliasing>
|
-Wno-unused-but-set-variable
|
||||||
# tweak gcc optimization for debug
|
$<$<NOT:$<CONFIG:Debug>>:-fno-strict-aliasing>
|
||||||
$<$<AND:$<BOOL:${is_gcc}>,$<CONFIG:Debug>>:-O0>
|
# tweak gcc optimization for debug
|
||||||
# Add debug symbols to release config
|
$<$<AND:$<BOOL:${is_gcc}>,$<CONFIG:Debug>>:-O0>
|
||||||
$<$<CONFIG:Release>:-g>)
|
# Add debug symbols to release config
|
||||||
|
$<$<CONFIG:Release>:-g>
|
||||||
|
)
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
common
|
common
|
||||||
INTERFACE -rdynamic
|
INTERFACE
|
||||||
$<$<BOOL:${is_linux}>:-Wl,-z,relro,-z,now,--build-id>
|
-rdynamic
|
||||||
# link to static libc/c++ iff: * static option set and * NOT APPLE (AppleClang does not support static
|
$<$<BOOL:${is_linux}>:-Wl,-z,relro,-z,now,--build-id>
|
||||||
# libc/c++) and * NOT SANITIZERS (sanitizers typically don't work with static libc/c++)
|
# link to static libc/c++ iff: * static option set and * NOT APPLE (AppleClang does not support static
|
||||||
$<$<AND:$<BOOL:${static}>,$<NOT:$<BOOL:${APPLE}>>,$<NOT:$<BOOL:${SANITIZERS_ENABLED}>>>:
|
# libc/c++) and * NOT SANITIZERS (sanitizers typically don't work with static libc/c++)
|
||||||
-static-libstdc++
|
$<$<AND:$<BOOL:${static}>,$<NOT:$<BOOL:${APPLE}>>,$<NOT:$<BOOL:${SANITIZERS_ENABLED}>>>:
|
||||||
-static-libgcc
|
-static-libstdc++
|
||||||
>)
|
-static-libgcc
|
||||||
endif ()
|
>
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Antithesis instrumentation will only be built and deployed using machines running Linux.
|
# Antithesis instrumentation will only be built and deployed using machines running Linux.
|
||||||
if (voidstar)
|
if(voidstar)
|
||||||
if (NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if(NOT CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
message(FATAL_ERROR "Antithesis instrumentation requires Debug build type, aborting...")
|
message(
|
||||||
elseif (NOT is_linux)
|
FATAL_ERROR
|
||||||
message(FATAL_ERROR "Antithesis instrumentation requires Linux, aborting...")
|
"Antithesis instrumentation requires Debug build type, aborting..."
|
||||||
elseif (NOT (is_clang AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0))
|
|
||||||
message(FATAL_ERROR "Antithesis instrumentation requires Clang version 16 or later, aborting..."
|
|
||||||
)
|
)
|
||||||
endif ()
|
elseif(NOT is_linux)
|
||||||
endif ()
|
message(
|
||||||
|
FATAL_ERROR
|
||||||
|
"Antithesis instrumentation requires Linux, aborting..."
|
||||||
|
)
|
||||||
|
elseif(
|
||||||
|
NOT (is_clang AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 16.0)
|
||||||
|
)
|
||||||
|
message(
|
||||||
|
FATAL_ERROR
|
||||||
|
"Antithesis instrumentation requires Clang version 16 or later, aborting..."
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if (use_mold)
|
if(use_mold)
|
||||||
# use mold linker if available
|
# use mold linker if available
|
||||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -fuse-ld=mold -Wl,--version ERROR_QUIET
|
execute_process(
|
||||||
OUTPUT_VARIABLE LD_VERSION)
|
COMMAND ${CMAKE_CXX_COMPILER} -fuse-ld=mold -Wl,--version
|
||||||
if ("${LD_VERSION}" MATCHES "mold")
|
ERROR_QUIET
|
||||||
|
OUTPUT_VARIABLE LD_VERSION
|
||||||
|
)
|
||||||
|
if("${LD_VERSION}" MATCHES "mold")
|
||||||
target_link_libraries(common INTERFACE -fuse-ld=mold)
|
target_link_libraries(common INTERFACE -fuse-ld=mold)
|
||||||
endif ()
|
endif()
|
||||||
unset(LD_VERSION)
|
unset(LD_VERSION)
|
||||||
elseif (use_gold AND is_gcc)
|
elseif(use_gold AND is_gcc)
|
||||||
# use gold linker if available
|
# use gold linker if available
|
||||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -fuse-ld=gold -Wl,--version ERROR_QUIET
|
execute_process(
|
||||||
OUTPUT_VARIABLE LD_VERSION)
|
COMMAND ${CMAKE_CXX_COMPILER} -fuse-ld=gold -Wl,--version
|
||||||
|
ERROR_QUIET
|
||||||
|
OUTPUT_VARIABLE LD_VERSION
|
||||||
|
)
|
||||||
#[=========================================================[
|
#[=========================================================[
|
||||||
NOTE: THE gold linker inserts -rpath as DT_RUNPATH by
|
NOTE: THE gold linker inserts -rpath as DT_RUNPATH by
|
||||||
default instead of DT_RPATH, so you might have slightly
|
default instead of DT_RPATH, so you might have slightly
|
||||||
@@ -175,32 +207,37 @@ elseif (use_gold AND is_gcc)
|
|||||||
disabling would be to figure out all the settings
|
disabling would be to figure out all the settings
|
||||||
required to make gold play nicely with jemalloc.
|
required to make gold play nicely with jemalloc.
|
||||||
#]=========================================================]
|
#]=========================================================]
|
||||||
if (("${LD_VERSION}" MATCHES "GNU gold") AND (NOT jemalloc))
|
if(("${LD_VERSION}" MATCHES "GNU gold") AND (NOT jemalloc))
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
common
|
common
|
||||||
INTERFACE -fuse-ld=gold
|
INTERFACE
|
||||||
-Wl,--no-as-needed
|
-fuse-ld=gold
|
||||||
#[=========================================================[
|
-Wl,--no-as-needed
|
||||||
|
#[=========================================================[
|
||||||
see https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1253638/comments/5
|
see https://bugs.launchpad.net/ubuntu/+source/eglibc/+bug/1253638/comments/5
|
||||||
DT_RUNPATH does not work great for transitive
|
DT_RUNPATH does not work great for transitive
|
||||||
dependencies (of which boost has a few) - so just
|
dependencies (of which boost has a few) - so just
|
||||||
switch to DT_RPATH if doing dynamic linking with gold
|
switch to DT_RPATH if doing dynamic linking with gold
|
||||||
#]=========================================================]
|
#]=========================================================]
|
||||||
$<$<NOT:$<BOOL:${static}>>:-Wl,--disable-new-dtags>)
|
$<$<NOT:$<BOOL:${static}>>:-Wl,--disable-new-dtags>
|
||||||
endif ()
|
)
|
||||||
|
endif()
|
||||||
unset(LD_VERSION)
|
unset(LD_VERSION)
|
||||||
elseif (use_lld)
|
elseif(use_lld)
|
||||||
# use lld linker if available
|
# use lld linker if available
|
||||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -fuse-ld=lld -Wl,--version ERROR_QUIET
|
execute_process(
|
||||||
OUTPUT_VARIABLE LD_VERSION)
|
COMMAND ${CMAKE_CXX_COMPILER} -fuse-ld=lld -Wl,--version
|
||||||
if ("${LD_VERSION}" MATCHES "LLD")
|
ERROR_QUIET
|
||||||
|
OUTPUT_VARIABLE LD_VERSION
|
||||||
|
)
|
||||||
|
if("${LD_VERSION}" MATCHES "LLD")
|
||||||
target_link_libraries(common INTERFACE -fuse-ld=lld)
|
target_link_libraries(common INTERFACE -fuse-ld=lld)
|
||||||
endif ()
|
endif()
|
||||||
unset(LD_VERSION)
|
unset(LD_VERSION)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
if (assert)
|
if(assert)
|
||||||
foreach (var_ CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE)
|
foreach(var_ CMAKE_C_FLAGS_RELEASE CMAKE_CXX_FLAGS_RELEASE)
|
||||||
string(REGEX REPLACE "[-/]DNDEBUG" "" ${var_} "${${var_}}")
|
string(REGEX REPLACE "[-/]DNDEBUG" "" ${var_} "${${var_}}")
|
||||||
endforeach ()
|
endforeach()
|
||||||
endif ()
|
endif()
|
||||||
|
|||||||
@@ -3,50 +3,58 @@ include(CMakeFindDependencyMacro)
|
|||||||
#[=========================================================[
|
#[=========================================================[
|
||||||
Boost
|
Boost
|
||||||
#]=========================================================]
|
#]=========================================================]
|
||||||
if (static OR APPLE OR MSVC)
|
if(static OR APPLE OR MSVC)
|
||||||
set(Boost_USE_STATIC_LIBS ON)
|
set(Boost_USE_STATIC_LIBS ON)
|
||||||
endif ()
|
endif()
|
||||||
set(Boost_USE_MULTITHREADED ON)
|
set(Boost_USE_MULTITHREADED ON)
|
||||||
if (static OR MSVC)
|
if(static OR MSVC)
|
||||||
set(Boost_USE_STATIC_RUNTIME ON)
|
set(Boost_USE_STATIC_RUNTIME ON)
|
||||||
else ()
|
else()
|
||||||
set(Boost_USE_STATIC_RUNTIME OFF)
|
set(Boost_USE_STATIC_RUNTIME OFF)
|
||||||
endif ()
|
endif()
|
||||||
find_dependency(Boost
|
find_dependency(
|
||||||
COMPONENTS
|
Boost
|
||||||
chrono
|
COMPONENTS
|
||||||
container
|
chrono
|
||||||
context
|
container
|
||||||
coroutine
|
context
|
||||||
date_time
|
coroutine
|
||||||
filesystem
|
date_time
|
||||||
program_options
|
filesystem
|
||||||
regex
|
program_options
|
||||||
system
|
regex
|
||||||
thread)
|
system
|
||||||
|
thread
|
||||||
|
)
|
||||||
#[=========================================================[
|
#[=========================================================[
|
||||||
OpenSSL
|
OpenSSL
|
||||||
#]=========================================================]
|
#]=========================================================]
|
||||||
if (NOT DEFINED OPENSSL_ROOT_DIR)
|
if(NOT DEFINED OPENSSL_ROOT_DIR)
|
||||||
if (DEFINED ENV{OPENSSL_ROOT})
|
if(DEFINED ENV{OPENSSL_ROOT})
|
||||||
set(OPENSSL_ROOT_DIR $ENV{OPENSSL_ROOT})
|
set(OPENSSL_ROOT_DIR $ENV{OPENSSL_ROOT})
|
||||||
elseif (APPLE)
|
elseif(APPLE)
|
||||||
find_program(homebrew brew)
|
find_program(homebrew brew)
|
||||||
if (homebrew)
|
if(homebrew)
|
||||||
execute_process(COMMAND ${homebrew} --prefix openssl OUTPUT_VARIABLE OPENSSL_ROOT_DIR
|
execute_process(
|
||||||
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
COMMAND ${homebrew} --prefix openssl
|
||||||
endif ()
|
OUTPUT_VARIABLE OPENSSL_ROOT_DIR
|
||||||
endif ()
|
OUTPUT_STRIP_TRAILING_WHITESPACE
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
file(TO_CMAKE_PATH "${OPENSSL_ROOT_DIR}" OPENSSL_ROOT_DIR)
|
file(TO_CMAKE_PATH "${OPENSSL_ROOT_DIR}" OPENSSL_ROOT_DIR)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
if (static OR APPLE OR MSVC)
|
if(static OR APPLE OR MSVC)
|
||||||
set(OPENSSL_USE_STATIC_LIBS ON)
|
set(OPENSSL_USE_STATIC_LIBS ON)
|
||||||
endif ()
|
endif()
|
||||||
set(OPENSSL_MSVC_STATIC_RT ON)
|
set(OPENSSL_MSVC_STATIC_RT ON)
|
||||||
find_dependency(OpenSSL REQUIRED)
|
find_dependency(OpenSSL REQUIRED)
|
||||||
find_dependency(ZLIB)
|
find_dependency(ZLIB)
|
||||||
find_dependency(date)
|
find_dependency(date)
|
||||||
if (TARGET ZLIB::ZLIB)
|
if(TARGET ZLIB::ZLIB)
|
||||||
set_target_properties(OpenSSL::Crypto PROPERTIES INTERFACE_LINK_LIBRARIES ZLIB::ZLIB)
|
set_target_properties(
|
||||||
endif ()
|
OpenSSL::Crypto
|
||||||
|
PROPERTIES INTERFACE_LINK_LIBRARIES ZLIB::ZLIB
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|||||||
@@ -10,25 +10,44 @@ include(target_protobuf_sources)
|
|||||||
# so we just build them as a separate library.
|
# so we just build them as a separate library.
|
||||||
add_library(xrpl.libpb)
|
add_library(xrpl.libpb)
|
||||||
set_target_properties(xrpl.libpb PROPERTIES UNITY_BUILD OFF)
|
set_target_properties(xrpl.libpb PROPERTIES UNITY_BUILD OFF)
|
||||||
target_protobuf_sources(xrpl.libpb xrpl/proto LANGUAGE cpp IMPORT_DIRS include/xrpl/proto
|
target_protobuf_sources(
|
||||||
PROTOS include/xrpl/proto/xrpl.proto)
|
xrpl.libpb
|
||||||
|
xrpl/proto
|
||||||
|
LANGUAGE cpp
|
||||||
|
IMPORT_DIRS include/xrpl/proto
|
||||||
|
PROTOS include/xrpl/proto/xrpl.proto
|
||||||
|
)
|
||||||
|
|
||||||
file(GLOB_RECURSE protos "include/xrpl/proto/org/*.proto")
|
file(GLOB_RECURSE protos "include/xrpl/proto/org/*.proto")
|
||||||
target_protobuf_sources(xrpl.libpb xrpl/proto LANGUAGE cpp IMPORT_DIRS include/xrpl/proto
|
|
||||||
PROTOS "${protos}")
|
|
||||||
target_protobuf_sources(
|
target_protobuf_sources(
|
||||||
xrpl.libpb xrpl/proto
|
xrpl.libpb
|
||||||
|
xrpl/proto
|
||||||
|
LANGUAGE cpp
|
||||||
|
IMPORT_DIRS include/xrpl/proto
|
||||||
|
PROTOS "${protos}"
|
||||||
|
)
|
||||||
|
target_protobuf_sources(
|
||||||
|
xrpl.libpb
|
||||||
|
xrpl/proto
|
||||||
LANGUAGE grpc
|
LANGUAGE grpc
|
||||||
IMPORT_DIRS include/xrpl/proto
|
IMPORT_DIRS include/xrpl/proto
|
||||||
PROTOS "${protos}"
|
PROTOS "${protos}"
|
||||||
PLUGIN protoc-gen-grpc=$<TARGET_FILE:gRPC::grpc_cpp_plugin>
|
PLUGIN protoc-gen-grpc=$<TARGET_FILE:gRPC::grpc_cpp_plugin>
|
||||||
GENERATE_EXTENSIONS .grpc.pb.h .grpc.pb.cc)
|
GENERATE_EXTENSIONS .grpc.pb.h .grpc.pb.cc
|
||||||
|
)
|
||||||
|
|
||||||
target_compile_options(
|
target_compile_options(
|
||||||
xrpl.libpb
|
xrpl.libpb
|
||||||
PUBLIC $<$<BOOL:${is_msvc}>:-wd4996> $<$<BOOL:${is_xcode}>:
|
PUBLIC
|
||||||
--system-header-prefix="google/protobuf" -Wno-deprecated-dynamic-exception-spec >
|
$<$<BOOL:${is_msvc}>:-wd4996>
|
||||||
PRIVATE $<$<BOOL:${is_msvc}>:-wd4065> $<$<NOT:$<BOOL:${is_msvc}>>:-Wno-deprecated-declarations>)
|
$<$<BOOL:${is_xcode}>:
|
||||||
|
--system-header-prefix="google/protobuf"
|
||||||
|
-Wno-deprecated-dynamic-exception-spec
|
||||||
|
>
|
||||||
|
PRIVATE
|
||||||
|
$<$<BOOL:${is_msvc}>:-wd4065>
|
||||||
|
$<$<NOT:$<BOOL:${is_msvc}>>:-Wno-deprecated-declarations>
|
||||||
|
)
|
||||||
|
|
||||||
target_link_libraries(xrpl.libpb PUBLIC protobuf::libprotobuf gRPC::grpc++)
|
target_link_libraries(xrpl.libpb PUBLIC protobuf::libprotobuf gRPC::grpc++)
|
||||||
|
|
||||||
@@ -37,19 +56,21 @@ add_library(xrpl.imports.main INTERFACE)
|
|||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
xrpl.imports.main
|
xrpl.imports.main
|
||||||
INTERFACE absl::random_random
|
INTERFACE
|
||||||
date::date
|
absl::random_random
|
||||||
ed25519::ed25519
|
date::date
|
||||||
LibArchive::LibArchive
|
ed25519::ed25519
|
||||||
OpenSSL::Crypto
|
LibArchive::LibArchive
|
||||||
Xrpl::boost
|
OpenSSL::Crypto
|
||||||
Xrpl::libs
|
Xrpl::boost
|
||||||
Xrpl::opts
|
Xrpl::libs
|
||||||
Xrpl::syslibs
|
Xrpl::opts
|
||||||
secp256k1::secp256k1
|
Xrpl::syslibs
|
||||||
xrpl.libpb
|
secp256k1::secp256k1
|
||||||
xxHash::xxhash
|
xrpl.libpb
|
||||||
$<$<BOOL:${voidstar}>:antithesis-sdk-cpp>)
|
xxHash::xxhash
|
||||||
|
$<$<BOOL:${voidstar}>:antithesis-sdk-cpp>
|
||||||
|
)
|
||||||
|
|
||||||
include(add_module)
|
include(add_module)
|
||||||
include(target_link_modules)
|
include(target_link_modules)
|
||||||
@@ -60,8 +81,12 @@ target_link_libraries(xrpl.libxrpl.beast PUBLIC xrpl.imports.main)
|
|||||||
|
|
||||||
include(GitInfo)
|
include(GitInfo)
|
||||||
add_module(xrpl git)
|
add_module(xrpl git)
|
||||||
target_compile_definitions(xrpl.libxrpl.git PRIVATE GIT_COMMIT_HASH="${GIT_COMMIT_HASH}"
|
target_compile_definitions(
|
||||||
GIT_BUILD_BRANCH="${GIT_BUILD_BRANCH}")
|
xrpl.libxrpl.git
|
||||||
|
PRIVATE
|
||||||
|
GIT_COMMIT_HASH="${GIT_COMMIT_HASH}"
|
||||||
|
GIT_BUILD_BRANCH="${GIT_BUILD_BRANCH}"
|
||||||
|
)
|
||||||
target_link_libraries(xrpl.libxrpl.git PUBLIC xrpl.imports.main)
|
target_link_libraries(xrpl.libxrpl.git PUBLIC xrpl.imports.main)
|
||||||
|
|
||||||
# Level 02
|
# Level 02
|
||||||
@@ -77,13 +102,17 @@ target_link_libraries(xrpl.libxrpl.crypto PUBLIC xrpl.libxrpl.basics)
|
|||||||
|
|
||||||
# Level 04
|
# Level 04
|
||||||
add_module(xrpl protocol)
|
add_module(xrpl protocol)
|
||||||
target_link_libraries(xrpl.libxrpl.protocol PUBLIC xrpl.libxrpl.crypto xrpl.libxrpl.git
|
target_link_libraries(
|
||||||
xrpl.libxrpl.json)
|
xrpl.libxrpl.protocol
|
||||||
|
PUBLIC xrpl.libxrpl.crypto xrpl.libxrpl.git xrpl.libxrpl.json
|
||||||
|
)
|
||||||
|
|
||||||
# Level 05
|
# Level 05
|
||||||
add_module(xrpl core)
|
add_module(xrpl core)
|
||||||
target_link_libraries(xrpl.libxrpl.core PUBLIC xrpl.libxrpl.basics xrpl.libxrpl.json
|
target_link_libraries(
|
||||||
xrpl.libxrpl.protocol)
|
xrpl.libxrpl.core
|
||||||
|
PUBLIC xrpl.libxrpl.basics xrpl.libxrpl.json xrpl.libxrpl.protocol
|
||||||
|
)
|
||||||
|
|
||||||
# Level 06
|
# Level 06
|
||||||
add_module(xrpl resource)
|
add_module(xrpl resource)
|
||||||
@@ -91,23 +120,46 @@ target_link_libraries(xrpl.libxrpl.resource PUBLIC xrpl.libxrpl.protocol)
|
|||||||
|
|
||||||
# Level 07
|
# Level 07
|
||||||
add_module(xrpl net)
|
add_module(xrpl net)
|
||||||
target_link_libraries(xrpl.libxrpl.net PUBLIC xrpl.libxrpl.basics xrpl.libxrpl.json
|
target_link_libraries(
|
||||||
xrpl.libxrpl.protocol xrpl.libxrpl.resource)
|
xrpl.libxrpl.net
|
||||||
|
PUBLIC
|
||||||
|
xrpl.libxrpl.basics
|
||||||
|
xrpl.libxrpl.json
|
||||||
|
xrpl.libxrpl.protocol
|
||||||
|
xrpl.libxrpl.resource
|
||||||
|
)
|
||||||
|
|
||||||
add_module(xrpl nodestore)
|
add_module(xrpl nodestore)
|
||||||
target_link_libraries(xrpl.libxrpl.nodestore PUBLIC xrpl.libxrpl.basics xrpl.libxrpl.json
|
target_link_libraries(
|
||||||
xrpl.libxrpl.protocol)
|
xrpl.libxrpl.nodestore
|
||||||
|
PUBLIC xrpl.libxrpl.basics xrpl.libxrpl.json xrpl.libxrpl.protocol
|
||||||
|
)
|
||||||
|
|
||||||
add_module(xrpl shamap)
|
add_module(xrpl shamap)
|
||||||
target_link_libraries(xrpl.libxrpl.shamap PUBLIC xrpl.libxrpl.basics xrpl.libxrpl.crypto
|
target_link_libraries(
|
||||||
xrpl.libxrpl.protocol xrpl.libxrpl.nodestore)
|
xrpl.libxrpl.shamap
|
||||||
|
PUBLIC
|
||||||
|
xrpl.libxrpl.basics
|
||||||
|
xrpl.libxrpl.crypto
|
||||||
|
xrpl.libxrpl.protocol
|
||||||
|
xrpl.libxrpl.nodestore
|
||||||
|
)
|
||||||
|
|
||||||
add_module(xrpl rdb)
|
add_module(xrpl rdb)
|
||||||
target_link_libraries(xrpl.libxrpl.rdb PUBLIC xrpl.libxrpl.basics xrpl.libxrpl.core)
|
target_link_libraries(
|
||||||
|
xrpl.libxrpl.rdb
|
||||||
|
PUBLIC xrpl.libxrpl.basics xrpl.libxrpl.core
|
||||||
|
)
|
||||||
|
|
||||||
add_module(xrpl server)
|
add_module(xrpl server)
|
||||||
target_link_libraries(xrpl.libxrpl.server PUBLIC xrpl.libxrpl.protocol xrpl.libxrpl.core
|
target_link_libraries(
|
||||||
xrpl.libxrpl.rdb xrpl.libxrpl.resource)
|
xrpl.libxrpl.server
|
||||||
|
PUBLIC
|
||||||
|
xrpl.libxrpl.protocol
|
||||||
|
xrpl.libxrpl.core
|
||||||
|
xrpl.libxrpl.rdb
|
||||||
|
xrpl.libxrpl.resource
|
||||||
|
)
|
||||||
|
|
||||||
add_module(xrpl conditions)
|
add_module(xrpl conditions)
|
||||||
target_link_libraries(xrpl.libxrpl.conditions PUBLIC xrpl.libxrpl.server)
|
target_link_libraries(xrpl.libxrpl.conditions PUBLIC xrpl.libxrpl.server)
|
||||||
@@ -115,13 +167,15 @@ target_link_libraries(xrpl.libxrpl.conditions PUBLIC xrpl.libxrpl.server)
|
|||||||
add_module(xrpl ledger)
|
add_module(xrpl ledger)
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
xrpl.libxrpl.ledger
|
xrpl.libxrpl.ledger
|
||||||
PUBLIC xrpl.libxrpl.basics
|
PUBLIC
|
||||||
xrpl.libxrpl.json
|
xrpl.libxrpl.basics
|
||||||
xrpl.libxrpl.protocol
|
xrpl.libxrpl.json
|
||||||
xrpl.libxrpl.rdb
|
xrpl.libxrpl.protocol
|
||||||
xrpl.libxrpl.server
|
xrpl.libxrpl.rdb
|
||||||
xrpl.libxrpl.shamap
|
xrpl.libxrpl.server
|
||||||
xrpl.libxrpl.conditions)
|
xrpl.libxrpl.shamap
|
||||||
|
xrpl.libxrpl.conditions
|
||||||
|
)
|
||||||
|
|
||||||
add_module(xrpl tx)
|
add_module(xrpl tx)
|
||||||
target_link_libraries(xrpl.libxrpl.tx PUBLIC xrpl.libxrpl.ledger)
|
target_link_libraries(xrpl.libxrpl.tx PUBLIC xrpl.libxrpl.ledger)
|
||||||
@@ -131,7 +185,11 @@ set_target_properties(xrpl.libxrpl PROPERTIES OUTPUT_NAME xrpl)
|
|||||||
|
|
||||||
add_library(xrpl::libxrpl ALIAS xrpl.libxrpl)
|
add_library(xrpl::libxrpl ALIAS xrpl.libxrpl)
|
||||||
|
|
||||||
file(GLOB_RECURSE sources CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/libxrpl/*.cpp")
|
file(
|
||||||
|
GLOB_RECURSE sources
|
||||||
|
CONFIGURE_DEPENDS
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/libxrpl/*.cpp"
|
||||||
|
)
|
||||||
target_sources(xrpl.libxrpl PRIVATE ${sources})
|
target_sources(xrpl.libxrpl PRIVATE ${sources})
|
||||||
|
|
||||||
target_link_modules(
|
target_link_modules(
|
||||||
@@ -152,7 +210,8 @@ target_link_modules(
|
|||||||
resource
|
resource
|
||||||
server
|
server
|
||||||
shamap
|
shamap
|
||||||
tx)
|
tx
|
||||||
|
)
|
||||||
|
|
||||||
# All headers in libxrpl are in modules.
|
# All headers in libxrpl are in modules.
|
||||||
# Uncomment this stanza if you have not yet moved new headers into a module.
|
# Uncomment this stanza if you have not yet moved new headers into a module.
|
||||||
@@ -163,34 +222,51 @@ target_link_modules(
|
|||||||
# $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
# $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
|
||||||
# $<INSTALL_INTERFACE:include>)
|
# $<INSTALL_INTERFACE:include>)
|
||||||
|
|
||||||
if (xrpld)
|
if(xrpld)
|
||||||
add_executable(xrpld)
|
add_executable(xrpld)
|
||||||
if (tests)
|
if(tests)
|
||||||
target_compile_definitions(xrpld PUBLIC ENABLE_TESTS)
|
target_compile_definitions(xrpld PUBLIC ENABLE_TESTS)
|
||||||
target_compile_definitions(xrpld PRIVATE UNIT_TEST_REFERENCE_FEE=${UNIT_TEST_REFERENCE_FEE})
|
target_compile_definitions(
|
||||||
endif ()
|
xrpld
|
||||||
target_include_directories(xrpld PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>)
|
PRIVATE UNIT_TEST_REFERENCE_FEE=${UNIT_TEST_REFERENCE_FEE}
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
target_include_directories(
|
||||||
|
xrpld
|
||||||
|
PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
|
||||||
|
)
|
||||||
|
|
||||||
file(GLOB_RECURSE sources CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/xrpld/*.cpp")
|
file(
|
||||||
|
GLOB_RECURSE sources
|
||||||
|
CONFIGURE_DEPENDS
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/xrpld/*.cpp"
|
||||||
|
)
|
||||||
target_sources(xrpld PRIVATE ${sources})
|
target_sources(xrpld PRIVATE ${sources})
|
||||||
|
|
||||||
if (tests)
|
if(tests)
|
||||||
file(GLOB_RECURSE sources CONFIGURE_DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/src/test/*.cpp")
|
file(
|
||||||
|
GLOB_RECURSE sources
|
||||||
|
CONFIGURE_DEPENDS
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/test/*.cpp"
|
||||||
|
)
|
||||||
target_sources(xrpld PRIVATE ${sources})
|
target_sources(xrpld PRIVATE ${sources})
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
target_link_libraries(xrpld Xrpl::boost Xrpl::opts Xrpl::libs xrpl.libxrpl)
|
target_link_libraries(xrpld Xrpl::boost Xrpl::opts Xrpl::libs xrpl.libxrpl)
|
||||||
exclude_if_included(xrpld)
|
exclude_if_included(xrpld)
|
||||||
# define a macro for tests that might need to
|
# define a macro for tests that might need to
|
||||||
# be excluded or run differently in CI environment
|
# be excluded or run differently in CI environment
|
||||||
if (is_ci)
|
if(is_ci)
|
||||||
target_compile_definitions(xrpld PRIVATE XRPL_RUNNING_IN_CI)
|
target_compile_definitions(xrpld PRIVATE XRPL_RUNNING_IN_CI)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
if (voidstar)
|
if(voidstar)
|
||||||
target_compile_options(xrpld PRIVATE -fsanitize-coverage=trace-pc-guard)
|
target_compile_options(xrpld PRIVATE -fsanitize-coverage=trace-pc-guard)
|
||||||
# xrpld requires access to antithesis-sdk-cpp implementation file
|
# xrpld requires access to antithesis-sdk-cpp implementation file
|
||||||
# antithesis_instrumentation.h, which is not exported as INTERFACE
|
# antithesis_instrumentation.h, which is not exported as INTERFACE
|
||||||
target_include_directories(xrpld PRIVATE ${CMAKE_SOURCE_DIR}/external/antithesis-sdk)
|
target_include_directories(
|
||||||
endif ()
|
xrpld
|
||||||
endif ()
|
PRIVATE ${CMAKE_SOURCE_DIR}/external/antithesis-sdk
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|||||||
@@ -2,14 +2,17 @@
|
|||||||
coverage report target
|
coverage report target
|
||||||
#]===================================================================]
|
#]===================================================================]
|
||||||
|
|
||||||
if (NOT coverage)
|
if(NOT coverage)
|
||||||
message(FATAL_ERROR "Code coverage not enabled! Aborting ...")
|
message(FATAL_ERROR "Code coverage not enabled! Aborting ...")
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
if (CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC")
|
||||||
message(WARNING "Code coverage on Windows is not supported, ignoring 'coverage' flag")
|
message(
|
||||||
|
WARNING
|
||||||
|
"Code coverage on Windows is not supported, ignoring 'coverage' flag"
|
||||||
|
)
|
||||||
return()
|
return()
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
include(ProcessorCount)
|
include(ProcessorCount)
|
||||||
ProcessorCount(PROCESSOR_COUNT)
|
ProcessorCount(PROCESSOR_COUNT)
|
||||||
@@ -21,32 +24,30 @@ include(CodeCoverage)
|
|||||||
# `CodeCoverage.cmake`)
|
# `CodeCoverage.cmake`)
|
||||||
|
|
||||||
set(GCOVR_ADDITIONAL_ARGS ${coverage_extra_args})
|
set(GCOVR_ADDITIONAL_ARGS ${coverage_extra_args})
|
||||||
if (NOT GCOVR_ADDITIONAL_ARGS STREQUAL "")
|
if(NOT GCOVR_ADDITIONAL_ARGS STREQUAL "")
|
||||||
separate_arguments(GCOVR_ADDITIONAL_ARGS)
|
separate_arguments(GCOVR_ADDITIONAL_ARGS)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
list(APPEND
|
list(
|
||||||
GCOVR_ADDITIONAL_ARGS
|
APPEND GCOVR_ADDITIONAL_ARGS
|
||||||
--exclude-throw-branches
|
--exclude-throw-branches
|
||||||
--exclude-noncode-lines
|
--exclude-noncode-lines
|
||||||
--exclude-unreachable-branches
|
--exclude-unreachable-branches
|
||||||
-s
|
-s
|
||||||
-j
|
-j
|
||||||
${PROCESSOR_COUNT})
|
${PROCESSOR_COUNT}
|
||||||
|
)
|
||||||
|
|
||||||
setup_target_for_coverage_gcovr(
|
setup_target_for_coverage_gcovr(
|
||||||
NAME
|
NAME coverage
|
||||||
coverage
|
FORMAT ${coverage_format}
|
||||||
FORMAT
|
|
||||||
${coverage_format}
|
|
||||||
EXCLUDE
|
EXCLUDE
|
||||||
"src/test"
|
"src/test"
|
||||||
"src/tests"
|
"src/tests"
|
||||||
"include/xrpl/beast/test"
|
"include/xrpl/beast/test"
|
||||||
"include/xrpl/beast/unit_test"
|
"include/xrpl/beast/unit_test"
|
||||||
"${CMAKE_BINARY_DIR}/pb-xrpl.libpb"
|
"${CMAKE_BINARY_DIR}/pb-xrpl.libpb"
|
||||||
DEPENDENCIES
|
DEPENDENCIES xrpld xrpl.tests
|
||||||
xrpld
|
)
|
||||||
xrpl.tests)
|
|
||||||
|
|
||||||
add_code_coverage_to_target(opts INTERFACE)
|
add_code_coverage_to_target(opts INTERFACE)
|
||||||
|
|||||||
@@ -2,71 +2,90 @@
|
|||||||
docs target (optional)
|
docs target (optional)
|
||||||
#]===================================================================]
|
#]===================================================================]
|
||||||
|
|
||||||
if (NOT only_docs)
|
if(NOT only_docs)
|
||||||
return()
|
return()
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
find_package(Doxygen)
|
find_package(Doxygen)
|
||||||
if (NOT TARGET Doxygen::doxygen)
|
if(NOT TARGET Doxygen::doxygen)
|
||||||
message(STATUS "doxygen executable not found -- skipping docs target")
|
message(STATUS "doxygen executable not found -- skipping docs target")
|
||||||
return()
|
return()
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
set(doxygen_output_directory "${CMAKE_BINARY_DIR}/docs")
|
set(doxygen_output_directory "${CMAKE_BINARY_DIR}/docs")
|
||||||
set(doxygen_include_path "${CMAKE_CURRENT_SOURCE_DIR}/src")
|
set(doxygen_include_path "${CMAKE_CURRENT_SOURCE_DIR}/src")
|
||||||
set(doxygen_index_file "${doxygen_output_directory}/html/index.html")
|
set(doxygen_index_file "${doxygen_output_directory}/html/index.html")
|
||||||
set(doxyfile "${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile")
|
set(doxyfile "${CMAKE_CURRENT_SOURCE_DIR}/docs/Doxyfile")
|
||||||
|
|
||||||
file(GLOB_RECURSE
|
file(
|
||||||
doxygen_input
|
GLOB_RECURSE doxygen_input
|
||||||
docs/*.md
|
docs/*.md
|
||||||
include/*.h
|
include/*.h
|
||||||
include/*.cpp
|
include/*.cpp
|
||||||
include/*.md
|
include/*.md
|
||||||
src/*.h
|
src/*.h
|
||||||
src/*.cpp
|
src/*.cpp
|
||||||
src/*.md
|
src/*.md
|
||||||
Builds/*.md
|
Builds/*.md
|
||||||
*.md)
|
*.md
|
||||||
|
)
|
||||||
list(APPEND doxygen_input external/README.md)
|
list(APPEND doxygen_input external/README.md)
|
||||||
set(dependencies "${doxygen_input}" "${doxyfile}")
|
set(dependencies "${doxygen_input}" "${doxyfile}")
|
||||||
|
|
||||||
function (verbose_find_path variable name)
|
function(verbose_find_path variable name)
|
||||||
# find_path sets a CACHE variable, so don't try using a "local" variable.
|
# find_path sets a CACHE variable, so don't try using a "local" variable.
|
||||||
find_path(${variable} "${name}" ${ARGN})
|
find_path(${variable} "${name}" ${ARGN})
|
||||||
if (NOT ${variable})
|
if(NOT ${variable})
|
||||||
message(NOTICE "could not find ${name}")
|
message(NOTICE "could not find ${name}")
|
||||||
else ()
|
else()
|
||||||
message(STATUS "found ${name}: ${${variable}}/${name}")
|
message(STATUS "found ${name}: ${${variable}}/${name}")
|
||||||
endif ()
|
endif()
|
||||||
endfunction ()
|
endfunction()
|
||||||
|
|
||||||
verbose_find_path(doxygen_plantuml_jar_path plantuml.jar PATH_SUFFIXES share/plantuml)
|
verbose_find_path(
|
||||||
|
doxygen_plantuml_jar_path
|
||||||
|
plantuml.jar
|
||||||
|
PATH_SUFFIXES share/plantuml
|
||||||
|
)
|
||||||
verbose_find_path(doxygen_dot_path dot)
|
verbose_find_path(doxygen_dot_path dot)
|
||||||
|
|
||||||
# https://en.cppreference.com/w/Cppreference:Archives
|
# https://en.cppreference.com/w/Cppreference:Archives
|
||||||
# https://stackoverflow.com/questions/60822559/how-to-move-a-file-download-from-configure-step-to-build-step
|
# https://stackoverflow.com/questions/60822559/how-to-move-a-file-download-from-configure-step-to-build-step
|
||||||
set(download_script "${CMAKE_BINARY_DIR}/docs/download-cppreference.cmake")
|
set(download_script "${CMAKE_BINARY_DIR}/docs/download-cppreference.cmake")
|
||||||
file(WRITE "${download_script}"
|
file(
|
||||||
"file(DOWNLOAD \
|
WRITE "${download_script}"
|
||||||
|
"file(DOWNLOAD \
|
||||||
https://github.com/PeterFeicht/cppreference-doc/releases/download/v20250209/html-book-20250209.zip \
|
https://github.com/PeterFeicht/cppreference-doc/releases/download/v20250209/html-book-20250209.zip \
|
||||||
${CMAKE_BINARY_DIR}/docs/cppreference.zip \
|
${CMAKE_BINARY_DIR}/docs/cppreference.zip \
|
||||||
EXPECTED_HASH MD5=bda585f72fbca4b817b29a3d5746567b \
|
EXPECTED_HASH MD5=bda585f72fbca4b817b29a3d5746567b \
|
||||||
)\n \
|
)\n \
|
||||||
execute_process( \
|
execute_process( \
|
||||||
COMMAND \"${CMAKE_COMMAND}\" -E tar -xf cppreference.zip \
|
COMMAND \"${CMAKE_COMMAND}\" -E tar -xf cppreference.zip \
|
||||||
)\n")
|
)\n"
|
||||||
|
)
|
||||||
set(tagfile "${CMAKE_BINARY_DIR}/docs/cppreference-doxygen-web.tag.xml")
|
set(tagfile "${CMAKE_BINARY_DIR}/docs/cppreference-doxygen-web.tag.xml")
|
||||||
add_custom_command(OUTPUT "${tagfile}" COMMAND "${CMAKE_COMMAND}" -P "${download_script}"
|
add_custom_command(
|
||||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/docs")
|
OUTPUT "${tagfile}"
|
||||||
|
COMMAND "${CMAKE_COMMAND}" -P "${download_script}"
|
||||||
|
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/docs"
|
||||||
|
)
|
||||||
set(doxygen_tagfiles "${tagfile}=http://en.cppreference.com/w/")
|
set(doxygen_tagfiles "${tagfile}=http://en.cppreference.com/w/")
|
||||||
|
|
||||||
add_custom_command(
|
add_custom_command(
|
||||||
OUTPUT "${doxygen_index_file}"
|
OUTPUT "${doxygen_index_file}"
|
||||||
COMMAND "${CMAKE_COMMAND}" -E env "DOXYGEN_OUTPUT_DIRECTORY=${doxygen_output_directory}"
|
COMMAND
|
||||||
"DOXYGEN_INCLUDE_PATH=${doxygen_include_path}" "DOXYGEN_TAGFILES=${doxygen_tagfiles}"
|
"${CMAKE_COMMAND}" -E env
|
||||||
"DOXYGEN_PLANTUML_JAR_PATH=${doxygen_plantuml_jar_path}"
|
"DOXYGEN_OUTPUT_DIRECTORY=${doxygen_output_directory}"
|
||||||
"DOXYGEN_DOT_PATH=${doxygen_dot_path}" "${DOXYGEN_EXECUTABLE}" "${doxyfile}"
|
"DOXYGEN_INCLUDE_PATH=${doxygen_include_path}"
|
||||||
|
"DOXYGEN_TAGFILES=${doxygen_tagfiles}"
|
||||||
|
"DOXYGEN_PLANTUML_JAR_PATH=${doxygen_plantuml_jar_path}"
|
||||||
|
"DOXYGEN_DOT_PATH=${doxygen_dot_path}" "${DOXYGEN_EXECUTABLE}"
|
||||||
|
"${doxyfile}"
|
||||||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}"
|
||||||
DEPENDS "${dependencies}" "${tagfile}")
|
DEPENDS "${dependencies}" "${tagfile}"
|
||||||
add_custom_target(docs DEPENDS "${doxygen_index_file}" SOURCES "${dependencies}")
|
)
|
||||||
|
add_custom_target(
|
||||||
|
docs
|
||||||
|
DEPENDS "${doxygen_index_file}"
|
||||||
|
SOURCES "${dependencies}"
|
||||||
|
)
|
||||||
|
|||||||
@@ -6,57 +6,71 @@ include(create_symbolic_link)
|
|||||||
|
|
||||||
# If no suffix is defined for executables (e.g. Windows uses .exe but Linux
|
# If no suffix is defined for executables (e.g. Windows uses .exe but Linux
|
||||||
# and macOS use none), then explicitly set it to the empty string.
|
# and macOS use none), then explicitly set it to the empty string.
|
||||||
if (NOT DEFINED suffix)
|
if(NOT DEFINED suffix)
|
||||||
set(suffix "")
|
set(suffix "")
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
install(TARGETS common
|
install(
|
||||||
opts
|
TARGETS
|
||||||
xrpl_boost
|
common
|
||||||
xrpl_libs
|
opts
|
||||||
xrpl_syslibs
|
xrpl_boost
|
||||||
xrpl.imports.main
|
xrpl_libs
|
||||||
xrpl.libpb
|
xrpl_syslibs
|
||||||
xrpl.libxrpl
|
xrpl.imports.main
|
||||||
xrpl.libxrpl.basics
|
xrpl.libpb
|
||||||
xrpl.libxrpl.beast
|
xrpl.libxrpl
|
||||||
xrpl.libxrpl.conditions
|
xrpl.libxrpl.basics
|
||||||
xrpl.libxrpl.core
|
xrpl.libxrpl.beast
|
||||||
xrpl.libxrpl.crypto
|
xrpl.libxrpl.conditions
|
||||||
xrpl.libxrpl.git
|
xrpl.libxrpl.core
|
||||||
xrpl.libxrpl.json
|
xrpl.libxrpl.crypto
|
||||||
xrpl.libxrpl.rdb
|
xrpl.libxrpl.git
|
||||||
xrpl.libxrpl.ledger
|
xrpl.libxrpl.json
|
||||||
xrpl.libxrpl.net
|
xrpl.libxrpl.rdb
|
||||||
xrpl.libxrpl.nodestore
|
xrpl.libxrpl.ledger
|
||||||
xrpl.libxrpl.protocol
|
xrpl.libxrpl.net
|
||||||
xrpl.libxrpl.resource
|
xrpl.libxrpl.nodestore
|
||||||
xrpl.libxrpl.server
|
xrpl.libxrpl.protocol
|
||||||
xrpl.libxrpl.shamap
|
xrpl.libxrpl.resource
|
||||||
xrpl.libxrpl.tx
|
xrpl.libxrpl.server
|
||||||
antithesis-sdk-cpp
|
xrpl.libxrpl.shamap
|
||||||
EXPORT XrplExports
|
xrpl.libxrpl.tx
|
||||||
LIBRARY DESTINATION lib
|
antithesis-sdk-cpp
|
||||||
ARCHIVE DESTINATION lib
|
EXPORT XrplExports
|
||||||
RUNTIME DESTINATION bin
|
LIBRARY DESTINATION lib
|
||||||
INCLUDES
|
ARCHIVE DESTINATION lib
|
||||||
DESTINATION include)
|
RUNTIME DESTINATION bin
|
||||||
|
INCLUDES DESTINATION include
|
||||||
|
)
|
||||||
|
|
||||||
install(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/xrpl"
|
install(
|
||||||
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}")
|
DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/include/xrpl"
|
||||||
|
DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}"
|
||||||
|
)
|
||||||
|
|
||||||
install(EXPORT XrplExports FILE XrplTargets.cmake NAMESPACE Xrpl:: DESTINATION lib/cmake/xrpl)
|
install(
|
||||||
|
EXPORT XrplExports
|
||||||
|
FILE XrplTargets.cmake
|
||||||
|
NAMESPACE Xrpl::
|
||||||
|
DESTINATION lib/cmake/xrpl
|
||||||
|
)
|
||||||
include(CMakePackageConfigHelpers)
|
include(CMakePackageConfigHelpers)
|
||||||
write_basic_package_version_file(XrplConfigVersion.cmake VERSION ${xrpld_version}
|
write_basic_package_version_file(
|
||||||
COMPATIBILITY SameMajorVersion)
|
XrplConfigVersion.cmake
|
||||||
|
VERSION ${xrpld_version}
|
||||||
|
COMPATIBILITY SameMajorVersion
|
||||||
|
)
|
||||||
|
|
||||||
if (is_root_project AND TARGET xrpld)
|
if(is_root_project AND TARGET xrpld)
|
||||||
install(TARGETS xrpld RUNTIME DESTINATION bin)
|
install(TARGETS xrpld RUNTIME DESTINATION bin)
|
||||||
set_target_properties(xrpld PROPERTIES INSTALL_RPATH_USE_LINK_PATH ON)
|
set_target_properties(xrpld PROPERTIES INSTALL_RPATH_USE_LINK_PATH ON)
|
||||||
# sample configs should not overwrite existing files
|
# sample configs should not overwrite existing files
|
||||||
# install if-not-exists workaround as suggested by
|
# install if-not-exists workaround as suggested by
|
||||||
# https://cmake.org/Bug/view.php?id=12646
|
# https://cmake.org/Bug/view.php?id=12646
|
||||||
install(CODE "
|
install(
|
||||||
|
CODE
|
||||||
|
"
|
||||||
macro (copy_if_not_exists SRC DEST NEWNAME)
|
macro (copy_if_not_exists SRC DEST NEWNAME)
|
||||||
if (NOT EXISTS \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\${DEST}/\${NEWNAME}\")
|
if (NOT EXISTS \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\${DEST}/\${NEWNAME}\")
|
||||||
file (INSTALL FILE_PERMISSIONS OWNER_READ OWNER_WRITE DESTINATION \"\${CMAKE_INSTALL_PREFIX}/\${DEST}\" FILES \"\${SRC}\" RENAME \"\${NEWNAME}\")
|
file (INSTALL FILE_PERMISSIONS OWNER_READ OWNER_WRITE DESTINATION \"\${CMAKE_INSTALL_PREFIX}/\${DEST}\" FILES \"\${SRC}\" RENAME \"\${NEWNAME}\")
|
||||||
@@ -66,14 +80,22 @@ if (is_root_project AND TARGET xrpld)
|
|||||||
endmacro()
|
endmacro()
|
||||||
copy_if_not_exists(\"${CMAKE_CURRENT_SOURCE_DIR}/cfg/xrpld-example.cfg\" etc xrpld.cfg)
|
copy_if_not_exists(\"${CMAKE_CURRENT_SOURCE_DIR}/cfg/xrpld-example.cfg\" etc xrpld.cfg)
|
||||||
copy_if_not_exists(\"${CMAKE_CURRENT_SOURCE_DIR}/cfg/validators-example.txt\" etc validators.txt)
|
copy_if_not_exists(\"${CMAKE_CURRENT_SOURCE_DIR}/cfg/validators-example.txt\" etc validators.txt)
|
||||||
")
|
"
|
||||||
install(CODE "
|
)
|
||||||
|
install(
|
||||||
|
CODE
|
||||||
|
"
|
||||||
set(CMAKE_MODULE_PATH \"${CMAKE_MODULE_PATH}\")
|
set(CMAKE_MODULE_PATH \"${CMAKE_MODULE_PATH}\")
|
||||||
include(create_symbolic_link)
|
include(create_symbolic_link)
|
||||||
create_symbolic_link(xrpld${suffix} \
|
create_symbolic_link(xrpld${suffix} \
|
||||||
\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/rippled${suffix})
|
\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_BINDIR}/rippled${suffix})
|
||||||
")
|
"
|
||||||
endif ()
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/cmake/XrplConfig.cmake
|
install(
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/XrplConfigVersion.cmake DESTINATION lib/cmake/xrpl)
|
FILES
|
||||||
|
${CMAKE_CURRENT_SOURCE_DIR}/cmake/XrplConfig.cmake
|
||||||
|
${CMAKE_CURRENT_BINARY_DIR}/XrplConfigVersion.cmake
|
||||||
|
DESTINATION lib/cmake/xrpl
|
||||||
|
)
|
||||||
|
|||||||
@@ -5,47 +5,55 @@
|
|||||||
include(CompilationEnv)
|
include(CompilationEnv)
|
||||||
|
|
||||||
# Set defaults for optional variables to avoid uninitialized variable warnings
|
# Set defaults for optional variables to avoid uninitialized variable warnings
|
||||||
if (NOT DEFINED voidstar)
|
if(NOT DEFINED voidstar)
|
||||||
set(voidstar OFF)
|
set(voidstar OFF)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
add_library(opts INTERFACE)
|
add_library(opts INTERFACE)
|
||||||
add_library(Xrpl::opts ALIAS opts)
|
add_library(Xrpl::opts ALIAS opts)
|
||||||
target_compile_definitions(
|
target_compile_definitions(
|
||||||
opts
|
opts
|
||||||
INTERFACE BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS
|
INTERFACE
|
||||||
BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT
|
BOOST_ASIO_DISABLE_HANDLER_TYPE_REQUIREMENTS
|
||||||
BOOST_CONTAINER_FWD_BAD_DEQUE
|
BOOST_ASIO_USE_TS_EXECUTOR_AS_DEFAULT
|
||||||
HAS_UNCAUGHT_EXCEPTIONS=1
|
BOOST_CONTAINER_FWD_BAD_DEQUE
|
||||||
$<$<BOOL:${boost_show_deprecated}>:
|
HAS_UNCAUGHT_EXCEPTIONS=1
|
||||||
BOOST_ASIO_NO_DEPRECATED
|
$<$<BOOL:${boost_show_deprecated}>:
|
||||||
BOOST_FILESYSTEM_NO_DEPRECATED
|
BOOST_ASIO_NO_DEPRECATED
|
||||||
>
|
BOOST_FILESYSTEM_NO_DEPRECATED
|
||||||
$<$<NOT:$<BOOL:${boost_show_deprecated}>>:
|
>
|
||||||
BOOST_COROUTINES_NO_DEPRECATION_WARNING
|
$<$<NOT:$<BOOL:${boost_show_deprecated}>>:
|
||||||
BOOST_BEAST_ALLOW_DEPRECATED
|
BOOST_COROUTINES_NO_DEPRECATION_WARNING
|
||||||
BOOST_FILESYSTEM_DEPRECATED
|
BOOST_BEAST_ALLOW_DEPRECATED
|
||||||
>
|
BOOST_FILESYSTEM_DEPRECATED
|
||||||
$<$<BOOL:${beast_no_unit_test_inline}>:BEAST_NO_UNIT_TEST_INLINE=1>
|
>
|
||||||
$<$<BOOL:${beast_disable_autolink}>:BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES=1>
|
$<$<BOOL:${beast_no_unit_test_inline}>:BEAST_NO_UNIT_TEST_INLINE=1>
|
||||||
$<$<BOOL:${single_io_service_thread}>:XRPL_SINGLE_IO_SERVICE_THREAD=1>
|
$<$<BOOL:${beast_disable_autolink}>:BEAST_DONT_AUTOLINK_TO_WIN32_LIBRARIES=1>
|
||||||
$<$<BOOL:${voidstar}>:ENABLE_VOIDSTAR>)
|
$<$<BOOL:${single_io_service_thread}>:XRPL_SINGLE_IO_SERVICE_THREAD=1>
|
||||||
|
$<$<BOOL:${voidstar}>:ENABLE_VOIDSTAR>
|
||||||
|
)
|
||||||
target_compile_options(
|
target_compile_options(
|
||||||
opts
|
opts
|
||||||
INTERFACE $<$<AND:$<BOOL:${is_gcc}>,$<COMPILE_LANGUAGE:CXX>>:-Wsuggest-override>
|
INTERFACE
|
||||||
$<$<BOOL:${is_gcc}>:-Wno-maybe-uninitialized>
|
$<$<AND:$<BOOL:${is_gcc}>,$<COMPILE_LANGUAGE:CXX>>:-Wsuggest-override>
|
||||||
$<$<BOOL:${perf}>:-fno-omit-frame-pointer>
|
$<$<BOOL:${is_gcc}>:-Wno-maybe-uninitialized>
|
||||||
$<$<BOOL:${profile}>:-pg>
|
$<$<BOOL:${perf}>:-fno-omit-frame-pointer>
|
||||||
$<$<AND:$<BOOL:${is_gcc}>,$<BOOL:${profile}>>:-p>)
|
$<$<BOOL:${profile}>:-pg>
|
||||||
|
$<$<AND:$<BOOL:${is_gcc}>,$<BOOL:${profile}>>:-p>
|
||||||
|
)
|
||||||
|
|
||||||
target_link_libraries(opts INTERFACE $<$<BOOL:${profile}>:-pg>
|
target_link_libraries(
|
||||||
$<$<AND:$<BOOL:${is_gcc}>,$<BOOL:${profile}>>:-p>)
|
opts
|
||||||
|
INTERFACE
|
||||||
|
$<$<BOOL:${profile}>:-pg>
|
||||||
|
$<$<AND:$<BOOL:${is_gcc}>,$<BOOL:${profile}>>:-p>
|
||||||
|
)
|
||||||
|
|
||||||
if (jemalloc)
|
if(jemalloc)
|
||||||
find_package(jemalloc REQUIRED)
|
find_package(jemalloc REQUIRED)
|
||||||
target_compile_definitions(opts INTERFACE PROFILE_JEMALLOC)
|
target_compile_definitions(opts INTERFACE PROFILE_JEMALLOC)
|
||||||
target_link_libraries(opts INTERFACE jemalloc::jemalloc)
|
target_link_libraries(opts INTERFACE jemalloc::jemalloc)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
#[===================================================================[
|
#[===================================================================[
|
||||||
xrpld transitive library deps via an interface library
|
xrpld transitive library deps via an interface library
|
||||||
@@ -55,31 +63,33 @@ add_library(xrpl_syslibs INTERFACE)
|
|||||||
add_library(Xrpl::syslibs ALIAS xrpl_syslibs)
|
add_library(Xrpl::syslibs ALIAS xrpl_syslibs)
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
xrpl_syslibs
|
xrpl_syslibs
|
||||||
INTERFACE $<$<BOOL:${is_msvc}>:
|
INTERFACE
|
||||||
legacy_stdio_definitions.lib
|
$<$<BOOL:${is_msvc}>:
|
||||||
Shlwapi
|
legacy_stdio_definitions.lib
|
||||||
kernel32
|
Shlwapi
|
||||||
user32
|
kernel32
|
||||||
gdi32
|
user32
|
||||||
winspool
|
gdi32
|
||||||
comdlg32
|
winspool
|
||||||
advapi32
|
comdlg32
|
||||||
shell32
|
advapi32
|
||||||
ole32
|
shell32
|
||||||
oleaut32
|
ole32
|
||||||
uuid
|
oleaut32
|
||||||
odbc32
|
uuid
|
||||||
odbccp32
|
odbc32
|
||||||
crypt32
|
odbccp32
|
||||||
>
|
crypt32
|
||||||
$<$<NOT:$<BOOL:${is_msvc}>>:dl>
|
>
|
||||||
$<$<NOT:$<OR:$<BOOL:${is_msvc}>,$<BOOL:${is_macos}>>>:rt>)
|
$<$<NOT:$<BOOL:${is_msvc}>>:dl>
|
||||||
|
$<$<NOT:$<OR:$<BOOL:${is_msvc}>,$<BOOL:${is_macos}>>>:rt>
|
||||||
|
)
|
||||||
|
|
||||||
if (NOT is_msvc)
|
if(NOT is_msvc)
|
||||||
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
set(THREADS_PREFER_PTHREAD_FLAG ON)
|
||||||
find_package(Threads)
|
find_package(Threads)
|
||||||
target_link_libraries(xrpl_syslibs INTERFACE Threads::Threads)
|
target_link_libraries(xrpl_syslibs INTERFACE Threads::Threads)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
add_library(xrpl_libs INTERFACE)
|
add_library(xrpl_libs INTERFACE)
|
||||||
add_library(Xrpl::libs ALIAS xrpl_libs)
|
add_library(Xrpl::libs ALIAS xrpl_libs)
|
||||||
|
|||||||
@@ -44,23 +44,26 @@ include(CompilationEnv)
|
|||||||
|
|
||||||
# Read environment variable
|
# Read environment variable
|
||||||
set(SANITIZERS "")
|
set(SANITIZERS "")
|
||||||
if (DEFINED ENV{SANITIZERS})
|
if(DEFINED ENV{SANITIZERS})
|
||||||
set(SANITIZERS "$ENV{SANITIZERS}")
|
set(SANITIZERS "$ENV{SANITIZERS}")
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
# Set SANITIZERS_ENABLED flag for use in other modules
|
# Set SANITIZERS_ENABLED flag for use in other modules
|
||||||
if (SANITIZERS MATCHES "address|thread|undefinedbehavior")
|
if(SANITIZERS MATCHES "address|thread|undefinedbehavior")
|
||||||
set(SANITIZERS_ENABLED TRUE)
|
set(SANITIZERS_ENABLED TRUE)
|
||||||
else ()
|
else()
|
||||||
set(SANITIZERS_ENABLED FALSE)
|
set(SANITIZERS_ENABLED FALSE)
|
||||||
return()
|
return()
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
# Sanitizers are not supported on Windows/MSVC
|
# Sanitizers are not supported on Windows/MSVC
|
||||||
if (is_msvc)
|
if(is_msvc)
|
||||||
message(FATAL_ERROR "Sanitizers are not supported on Windows/MSVC. "
|
message(
|
||||||
"Please unset the SANITIZERS environment variable.")
|
FATAL_ERROR
|
||||||
endif ()
|
"Sanitizers are not supported on Windows/MSVC. "
|
||||||
|
"Please unset the SANITIZERS environment variable."
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
message(STATUS "Configuring sanitizers: ${SANITIZERS}")
|
message(STATUS "Configuring sanitizers: ${SANITIZERS}")
|
||||||
|
|
||||||
@@ -74,24 +77,30 @@ set(san_list "${SANITIZERS}")
|
|||||||
string(REPLACE "," ";" san_list "${san_list}")
|
string(REPLACE "," ";" san_list "${san_list}")
|
||||||
separate_arguments(san_list)
|
separate_arguments(san_list)
|
||||||
|
|
||||||
foreach (san IN LISTS san_list)
|
foreach(san IN LISTS san_list)
|
||||||
if (san STREQUAL "address")
|
if(san STREQUAL "address")
|
||||||
set(enable_asan TRUE)
|
set(enable_asan TRUE)
|
||||||
elseif (san STREQUAL "thread")
|
elseif(san STREQUAL "thread")
|
||||||
set(enable_tsan TRUE)
|
set(enable_tsan TRUE)
|
||||||
elseif (san STREQUAL "undefinedbehavior")
|
elseif(san STREQUAL "undefinedbehavior")
|
||||||
set(enable_ubsan TRUE)
|
set(enable_ubsan TRUE)
|
||||||
else ()
|
else()
|
||||||
message(FATAL_ERROR "Unsupported sanitizer type: ${san}"
|
message(
|
||||||
"Supported: address, thread, undefinedbehavior and their combinations.")
|
FATAL_ERROR
|
||||||
endif ()
|
"Unsupported sanitizer type: ${san}"
|
||||||
endforeach ()
|
"Supported: address, thread, undefinedbehavior and their combinations."
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endforeach()
|
||||||
|
|
||||||
# Validate sanitizer compatibility
|
# Validate sanitizer compatibility
|
||||||
if (enable_asan AND enable_tsan)
|
if(enable_asan AND enable_tsan)
|
||||||
message(FATAL_ERROR "AddressSanitizer and ThreadSanitizer are incompatible and cannot be enabled simultaneously. "
|
message(
|
||||||
"Use 'address' or 'thread', optionally with 'undefinedbehavior'.")
|
FATAL_ERROR
|
||||||
endif ()
|
"AddressSanitizer and ThreadSanitizer are incompatible and cannot be enabled simultaneously. "
|
||||||
|
"Use 'address' or 'thread', optionally with 'undefinedbehavior'."
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
# Frame pointer is required for meaningful stack traces. Sanitizers recommend minimum of -O1 for reasonable performance
|
# Frame pointer is required for meaningful stack traces. Sanitizers recommend minimum of -O1 for reasonable performance
|
||||||
set(SANITIZERS_COMPILE_FLAGS "-fno-omit-frame-pointer" "-O1")
|
set(SANITIZERS_COMPILE_FLAGS "-fno-omit-frame-pointer" "-O1")
|
||||||
@@ -99,66 +108,79 @@ set(SANITIZERS_COMPILE_FLAGS "-fno-omit-frame-pointer" "-O1")
|
|||||||
# Build the sanitizer flags list
|
# Build the sanitizer flags list
|
||||||
set(SANITIZER_TYPES)
|
set(SANITIZER_TYPES)
|
||||||
|
|
||||||
if (enable_asan)
|
if(enable_asan)
|
||||||
list(APPEND SANITIZER_TYPES "address")
|
list(APPEND SANITIZER_TYPES "address")
|
||||||
elseif (enable_tsan)
|
elseif(enable_tsan)
|
||||||
list(APPEND SANITIZER_TYPES "thread")
|
list(APPEND SANITIZER_TYPES "thread")
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
if (enable_ubsan)
|
if(enable_ubsan)
|
||||||
# UB sanitizer flags
|
# UB sanitizer flags
|
||||||
list(APPEND SANITIZER_TYPES "undefined" "float-divide-by-zero")
|
list(APPEND SANITIZER_TYPES "undefined" "float-divide-by-zero")
|
||||||
if (is_clang)
|
if(is_clang)
|
||||||
# Clang supports additional UB checks. More info here
|
# Clang supports additional UB checks. More info here
|
||||||
# https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
|
# https://clang.llvm.org/docs/UndefinedBehaviorSanitizer.html
|
||||||
list(APPEND SANITIZER_TYPES "unsigned-integer-overflow")
|
list(APPEND SANITIZER_TYPES "unsigned-integer-overflow")
|
||||||
endif ()
|
endif()
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
# Configure code model for GCC on amd64 Use large code model for ASAN to avoid relocation errors Use medium code model
|
# Configure code model for GCC on amd64 Use large code model for ASAN to avoid relocation errors Use medium code model
|
||||||
# for TSAN (large is not compatible with TSAN)
|
# for TSAN (large is not compatible with TSAN)
|
||||||
set(SANITIZERS_RELOCATION_FLAGS)
|
set(SANITIZERS_RELOCATION_FLAGS)
|
||||||
|
|
||||||
# Compiler-specific configuration
|
# Compiler-specific configuration
|
||||||
if (is_gcc)
|
if(is_gcc)
|
||||||
# Disable mold, gold and lld linkers for GCC with sanitizers Use default linker (bfd/ld) which is more lenient with
|
# Disable mold, gold and lld linkers for GCC with sanitizers Use default linker (bfd/ld) which is more lenient with
|
||||||
# mixed code models This is needed since the size of instrumented binary exceeds the limits set by mold, lld and
|
# mixed code models This is needed since the size of instrumented binary exceeds the limits set by mold, lld and
|
||||||
# gold linkers
|
# gold linkers
|
||||||
set(use_mold OFF CACHE BOOL "Use mold linker" FORCE)
|
set(use_mold OFF CACHE BOOL "Use mold linker" FORCE)
|
||||||
set(use_gold OFF CACHE BOOL "Use gold linker" FORCE)
|
set(use_gold OFF CACHE BOOL "Use gold linker" FORCE)
|
||||||
set(use_lld OFF CACHE BOOL "Use lld linker" FORCE)
|
set(use_lld OFF CACHE BOOL "Use lld linker" FORCE)
|
||||||
message(STATUS " Disabled mold, gold, and lld linkers for GCC with sanitizers")
|
message(
|
||||||
|
STATUS
|
||||||
|
" Disabled mold, gold, and lld linkers for GCC with sanitizers"
|
||||||
|
)
|
||||||
|
|
||||||
# Suppress false positive warnings in GCC with stringop-overflow
|
# Suppress false positive warnings in GCC with stringop-overflow
|
||||||
list(APPEND SANITIZERS_COMPILE_FLAGS "-Wno-stringop-overflow")
|
list(APPEND SANITIZERS_COMPILE_FLAGS "-Wno-stringop-overflow")
|
||||||
|
|
||||||
if (is_amd64 AND enable_asan)
|
if(is_amd64 AND enable_asan)
|
||||||
message(STATUS " Using large code model (-mcmodel=large)")
|
message(STATUS " Using large code model (-mcmodel=large)")
|
||||||
list(APPEND SANITIZERS_COMPILE_FLAGS "-mcmodel=large")
|
list(APPEND SANITIZERS_COMPILE_FLAGS "-mcmodel=large")
|
||||||
list(APPEND SANITIZERS_RELOCATION_FLAGS "-mcmodel=large")
|
list(APPEND SANITIZERS_RELOCATION_FLAGS "-mcmodel=large")
|
||||||
elseif (enable_tsan)
|
elseif(enable_tsan)
|
||||||
# GCC doesn't support atomic_thread_fence with tsan. Suppress warnings.
|
# GCC doesn't support atomic_thread_fence with tsan. Suppress warnings.
|
||||||
list(APPEND SANITIZERS_COMPILE_FLAGS "-Wno-tsan")
|
list(APPEND SANITIZERS_COMPILE_FLAGS "-Wno-tsan")
|
||||||
message(STATUS " Using medium code model (-mcmodel=medium)")
|
message(STATUS " Using medium code model (-mcmodel=medium)")
|
||||||
list(APPEND SANITIZERS_COMPILE_FLAGS "-mcmodel=medium")
|
list(APPEND SANITIZERS_COMPILE_FLAGS "-mcmodel=medium")
|
||||||
list(APPEND SANITIZERS_RELOCATION_FLAGS "-mcmodel=medium")
|
list(APPEND SANITIZERS_RELOCATION_FLAGS "-mcmodel=medium")
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
# Join sanitizer flags with commas for -fsanitize option
|
# Join sanitizer flags with commas for -fsanitize option
|
||||||
list(JOIN SANITIZER_TYPES "," SANITIZER_TYPES_STR)
|
list(JOIN SANITIZER_TYPES "," SANITIZER_TYPES_STR)
|
||||||
|
|
||||||
# Add sanitizer to compile and link flags
|
# Add sanitizer to compile and link flags
|
||||||
list(APPEND SANITIZERS_COMPILE_FLAGS "-fsanitize=${SANITIZER_TYPES_STR}")
|
list(APPEND SANITIZERS_COMPILE_FLAGS "-fsanitize=${SANITIZER_TYPES_STR}")
|
||||||
set(SANITIZERS_LINK_FLAGS "${SANITIZERS_RELOCATION_FLAGS}" "-fsanitize=${SANITIZER_TYPES_STR}")
|
set(SANITIZERS_LINK_FLAGS
|
||||||
|
"${SANITIZERS_RELOCATION_FLAGS}"
|
||||||
elseif (is_clang)
|
"-fsanitize=${SANITIZER_TYPES_STR}"
|
||||||
|
)
|
||||||
|
elseif(is_clang)
|
||||||
# Add ignorelist for Clang (GCC doesn't support this) Use CMAKE_SOURCE_DIR to get the path to the ignorelist
|
# Add ignorelist for Clang (GCC doesn't support this) Use CMAKE_SOURCE_DIR to get the path to the ignorelist
|
||||||
set(IGNORELIST_PATH "${CMAKE_SOURCE_DIR}/sanitizers/suppressions/sanitizer-ignorelist.txt")
|
set(IGNORELIST_PATH
|
||||||
if (NOT EXISTS "${IGNORELIST_PATH}")
|
"${CMAKE_SOURCE_DIR}/sanitizers/suppressions/sanitizer-ignorelist.txt"
|
||||||
message(FATAL_ERROR "Sanitizer ignorelist not found: ${IGNORELIST_PATH}")
|
)
|
||||||
endif ()
|
if(NOT EXISTS "${IGNORELIST_PATH}")
|
||||||
|
message(
|
||||||
|
FATAL_ERROR
|
||||||
|
"Sanitizer ignorelist not found: ${IGNORELIST_PATH}"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|
||||||
list(APPEND SANITIZERS_COMPILE_FLAGS "-fsanitize-ignorelist=${IGNORELIST_PATH}")
|
list(
|
||||||
|
APPEND SANITIZERS_COMPILE_FLAGS
|
||||||
|
"-fsanitize-ignorelist=${IGNORELIST_PATH}"
|
||||||
|
)
|
||||||
message(STATUS " Using sanitizer ignorelist: ${IGNORELIST_PATH}")
|
message(STATUS " Using sanitizer ignorelist: ${IGNORELIST_PATH}")
|
||||||
|
|
||||||
# Join sanitizer flags with commas for -fsanitize option
|
# Join sanitizer flags with commas for -fsanitize option
|
||||||
@@ -167,31 +189,35 @@ elseif (is_clang)
|
|||||||
# Add sanitizer to compile and link flags
|
# Add sanitizer to compile and link flags
|
||||||
list(APPEND SANITIZERS_COMPILE_FLAGS "-fsanitize=${SANITIZER_TYPES_STR}")
|
list(APPEND SANITIZERS_COMPILE_FLAGS "-fsanitize=${SANITIZER_TYPES_STR}")
|
||||||
set(SANITIZERS_LINK_FLAGS "-fsanitize=${SANITIZER_TYPES_STR}")
|
set(SANITIZERS_LINK_FLAGS "-fsanitize=${SANITIZER_TYPES_STR}")
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
message(STATUS " Compile flags: ${SANITIZERS_COMPILE_FLAGS}")
|
message(STATUS " Compile flags: ${SANITIZERS_COMPILE_FLAGS}")
|
||||||
message(STATUS " Link flags: ${SANITIZERS_LINK_FLAGS}")
|
message(STATUS " Link flags: ${SANITIZERS_LINK_FLAGS}")
|
||||||
|
|
||||||
# Apply the sanitizer flags to the 'common' interface library This is the same library used by XrplCompiler.cmake
|
# Apply the sanitizer flags to the 'common' interface library This is the same library used by XrplCompiler.cmake
|
||||||
target_compile_options(common INTERFACE $<$<COMPILE_LANGUAGE:CXX>:${SANITIZERS_COMPILE_FLAGS}>
|
target_compile_options(
|
||||||
$<$<COMPILE_LANGUAGE:C>:${SANITIZERS_COMPILE_FLAGS}>)
|
common
|
||||||
|
INTERFACE
|
||||||
|
$<$<COMPILE_LANGUAGE:CXX>:${SANITIZERS_COMPILE_FLAGS}>
|
||||||
|
$<$<COMPILE_LANGUAGE:C>:${SANITIZERS_COMPILE_FLAGS}>
|
||||||
|
)
|
||||||
|
|
||||||
# Apply linker flags
|
# Apply linker flags
|
||||||
target_link_options(common INTERFACE ${SANITIZERS_LINK_FLAGS})
|
target_link_options(common INTERFACE ${SANITIZERS_LINK_FLAGS})
|
||||||
|
|
||||||
# Define SANITIZERS macro for BuildInfo.cpp
|
# Define SANITIZERS macro for BuildInfo.cpp
|
||||||
set(sanitizers_list)
|
set(sanitizers_list)
|
||||||
if (enable_asan)
|
if(enable_asan)
|
||||||
list(APPEND sanitizers_list "ASAN")
|
list(APPEND sanitizers_list "ASAN")
|
||||||
endif ()
|
endif()
|
||||||
if (enable_tsan)
|
if(enable_tsan)
|
||||||
list(APPEND sanitizers_list "TSAN")
|
list(APPEND sanitizers_list "TSAN")
|
||||||
endif ()
|
endif()
|
||||||
if (enable_ubsan)
|
if(enable_ubsan)
|
||||||
list(APPEND sanitizers_list "UBSAN")
|
list(APPEND sanitizers_list "UBSAN")
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
if (sanitizers_list)
|
if(sanitizers_list)
|
||||||
list(JOIN sanitizers_list "." sanitizers_str)
|
list(JOIN sanitizers_list "." sanitizers_str)
|
||||||
target_compile_definitions(common INTERFACE SANITIZERS=${sanitizers_str})
|
target_compile_definitions(common INTERFACE SANITIZERS=${sanitizers_str})
|
||||||
endif ()
|
endif()
|
||||||
|
|||||||
@@ -7,40 +7,49 @@ include(CompilationEnv)
|
|||||||
get_property(is_multiconfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
get_property(is_multiconfig GLOBAL PROPERTY GENERATOR_IS_MULTI_CONFIG)
|
||||||
|
|
||||||
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
|
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "" FORCE)
|
||||||
if (NOT is_multiconfig)
|
if(NOT is_multiconfig)
|
||||||
if (NOT CMAKE_BUILD_TYPE)
|
if(NOT CMAKE_BUILD_TYPE)
|
||||||
message(STATUS "Build type not specified - defaulting to Release")
|
message(STATUS "Build type not specified - defaulting to Release")
|
||||||
set(CMAKE_BUILD_TYPE Release CACHE STRING "build type" FORCE)
|
set(CMAKE_BUILD_TYPE Release CACHE STRING "build type" FORCE)
|
||||||
elseif (NOT (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL Release))
|
elseif(
|
||||||
|
NOT (CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL Release)
|
||||||
|
)
|
||||||
# for simplicity, these are the only two config types we care about. Limiting the build types simplifies dealing
|
# for simplicity, these are the only two config types we care about. Limiting the build types simplifies dealing
|
||||||
# with external project builds especially
|
# with external project builds especially
|
||||||
message(FATAL_ERROR " *** Only Debug or Release build types are currently supported ***")
|
message(
|
||||||
endif ()
|
FATAL_ERROR
|
||||||
endif ()
|
" *** Only Debug or Release build types are currently supported ***"
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if (is_clang) # both Clang and AppleClang
|
if(is_clang) # both Clang and AppleClang
|
||||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS
|
if(
|
||||||
16.0)
|
"${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang"
|
||||||
|
AND CMAKE_CXX_COMPILER_VERSION VERSION_LESS 16.0
|
||||||
|
)
|
||||||
message(FATAL_ERROR "This project requires clang 16 or later")
|
message(FATAL_ERROR "This project requires clang 16 or later")
|
||||||
endif ()
|
endif()
|
||||||
elseif (is_gcc)
|
elseif(is_gcc)
|
||||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0)
|
if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS 12.0)
|
||||||
message(FATAL_ERROR "This project requires GCC 12 or later")
|
message(FATAL_ERROR "This project requires GCC 12 or later")
|
||||||
endif ()
|
endif()
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
# check for in-source build and fail
|
# check for in-source build and fail
|
||||||
if ("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
if("${CMAKE_CURRENT_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}")
|
||||||
message(FATAL_ERROR "Builds (in-source) are not allowed in "
|
message(
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}. Please remove CMakeCache.txt and the CMakeFiles "
|
FATAL_ERROR
|
||||||
"directory from ${CMAKE_CURRENT_SOURCE_DIR} and try building in a separate directory."
|
"Builds (in-source) are not allowed in "
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}. Please remove CMakeCache.txt and the CMakeFiles "
|
||||||
|
"directory from ${CMAKE_CURRENT_SOURCE_DIR} and try building in a separate directory."
|
||||||
)
|
)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
if (MSVC AND CMAKE_GENERATOR_PLATFORM STREQUAL "Win32")
|
if(MSVC AND CMAKE_GENERATOR_PLATFORM STREQUAL "Win32")
|
||||||
message(FATAL_ERROR "Visual Studio 32-bit build is not supported.")
|
message(FATAL_ERROR "Visual Studio 32-bit build is not supported.")
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
if (APPLE AND NOT HOMEBREW)
|
if(APPLE AND NOT HOMEBREW)
|
||||||
find_program(HOMEBREW brew)
|
find_program(HOMEBREW brew)
|
||||||
endif ()
|
endif()
|
||||||
|
|||||||
@@ -5,59 +5,67 @@
|
|||||||
include(CompilationEnv)
|
include(CompilationEnv)
|
||||||
|
|
||||||
set(is_ci FALSE)
|
set(is_ci FALSE)
|
||||||
if (DEFINED ENV{CI})
|
if(DEFINED ENV{CI})
|
||||||
if ("$ENV{CI}" STREQUAL "true")
|
if("$ENV{CI}" STREQUAL "true")
|
||||||
set(is_ci TRUE)
|
set(is_ci TRUE)
|
||||||
endif ()
|
endif()
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
get_directory_property(has_parent PARENT_DIRECTORY)
|
get_directory_property(has_parent PARENT_DIRECTORY)
|
||||||
if (has_parent)
|
if(has_parent)
|
||||||
set(is_root_project OFF)
|
set(is_root_project OFF)
|
||||||
else ()
|
else()
|
||||||
set(is_root_project ON)
|
set(is_root_project ON)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
option(assert "Enables asserts, even in release builds" OFF)
|
option(assert "Enables asserts, even in release builds" OFF)
|
||||||
|
|
||||||
option(xrpld "Build xrpld" ON)
|
option(xrpld "Build xrpld" ON)
|
||||||
|
|
||||||
option(tests "Build tests" ON)
|
option(tests "Build tests" ON)
|
||||||
if (tests)
|
if(tests)
|
||||||
# This setting allows making a separate workflow to test fees other than default 10
|
# This setting allows making a separate workflow to test fees other than default 10
|
||||||
if (NOT UNIT_TEST_REFERENCE_FEE)
|
if(NOT UNIT_TEST_REFERENCE_FEE)
|
||||||
set(UNIT_TEST_REFERENCE_FEE "10" CACHE STRING "")
|
set(UNIT_TEST_REFERENCE_FEE "10" CACHE STRING "")
|
||||||
endif ()
|
endif()
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
option(unity "Creates a build using UNITY support in cmake." OFF)
|
option(unity "Creates a build using UNITY support in cmake." OFF)
|
||||||
if (unity)
|
if(unity)
|
||||||
if (NOT is_ci)
|
if(NOT is_ci)
|
||||||
set(CMAKE_UNITY_BUILD_BATCH_SIZE 15 CACHE STRING "")
|
set(CMAKE_UNITY_BUILD_BATCH_SIZE 15 CACHE STRING "")
|
||||||
endif ()
|
endif()
|
||||||
set(CMAKE_UNITY_BUILD ON CACHE BOOL "Do a unity build")
|
set(CMAKE_UNITY_BUILD ON CACHE BOOL "Do a unity build")
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
if (is_clang AND is_linux)
|
if(is_clang AND is_linux)
|
||||||
option(voidstar "Enable Antithesis instrumentation." OFF)
|
option(voidstar "Enable Antithesis instrumentation." OFF)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
if (is_gcc OR is_clang)
|
if(is_gcc OR is_clang)
|
||||||
include(ProcessorCount)
|
include(ProcessorCount)
|
||||||
ProcessorCount(PROCESSOR_COUNT)
|
ProcessorCount(PROCESSOR_COUNT)
|
||||||
|
|
||||||
option(coverage "Generates coverage info." OFF)
|
option(coverage "Generates coverage info." OFF)
|
||||||
option(profile "Add profiling flags" OFF)
|
option(profile "Add profiling flags" OFF)
|
||||||
set(coverage_format "html-details" CACHE STRING "Output format of the coverage report.")
|
set(coverage_format
|
||||||
set(coverage_extra_args "" CACHE STRING "Additional arguments to pass to gcovr.")
|
"html-details"
|
||||||
|
CACHE STRING
|
||||||
|
"Output format of the coverage report."
|
||||||
|
)
|
||||||
|
set(coverage_extra_args
|
||||||
|
""
|
||||||
|
CACHE STRING
|
||||||
|
"Additional arguments to pass to gcovr."
|
||||||
|
)
|
||||||
option(wextra "compile with extra gcc/clang warnings enabled" ON)
|
option(wextra "compile with extra gcc/clang warnings enabled" ON)
|
||||||
else ()
|
else()
|
||||||
set(profile OFF CACHE BOOL "gcc/clang only" FORCE)
|
set(profile OFF CACHE BOOL "gcc/clang only" FORCE)
|
||||||
set(coverage OFF CACHE BOOL "gcc/clang only" FORCE)
|
set(coverage OFF CACHE BOOL "gcc/clang only" FORCE)
|
||||||
set(wextra OFF CACHE BOOL "gcc/clang only" FORCE)
|
set(wextra OFF CACHE BOOL "gcc/clang only" FORCE)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
if (is_linux AND NOT SANITIZER)
|
if(is_linux AND NOT SANITIZER)
|
||||||
option(BUILD_SHARED_LIBS "build shared xrpl libraries" OFF)
|
option(BUILD_SHARED_LIBS "build shared xrpl libraries" OFF)
|
||||||
option(static "link protobuf, openssl, libc++, and boost statically" ON)
|
option(static "link protobuf, openssl, libc++, and boost statically" ON)
|
||||||
option(perf "Enables flags that assist with perf recording" OFF)
|
option(perf "Enables flags that assist with perf recording" OFF)
|
||||||
@@ -65,53 +73,83 @@ if (is_linux AND NOT SANITIZER)
|
|||||||
option(use_mold "enables detection of mold (binutils) linker" ON)
|
option(use_mold "enables detection of mold (binutils) linker" ON)
|
||||||
# Set a default value for the log flag based on the build type. This provides a sensible default (on for debug, off
|
# Set a default value for the log flag based on the build type. This provides a sensible default (on for debug, off
|
||||||
# for release) while still allowing the user to override it for any build.
|
# for release) while still allowing the user to override it for any build.
|
||||||
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
|
if(CMAKE_BUILD_TYPE STREQUAL "Debug")
|
||||||
set(TRUNCATED_LOGS_DEFAULT ON)
|
set(TRUNCATED_LOGS_DEFAULT ON)
|
||||||
else ()
|
else()
|
||||||
set(TRUNCATED_LOGS_DEFAULT OFF)
|
set(TRUNCATED_LOGS_DEFAULT OFF)
|
||||||
endif ()
|
endif()
|
||||||
option(TRUNCATED_THREAD_NAME_LOGS "Show warnings about truncated thread names on Linux."
|
option(
|
||||||
${TRUNCATED_LOGS_DEFAULT})
|
TRUNCATED_THREAD_NAME_LOGS
|
||||||
if (TRUNCATED_THREAD_NAME_LOGS)
|
"Show warnings about truncated thread names on Linux."
|
||||||
|
${TRUNCATED_LOGS_DEFAULT}
|
||||||
|
)
|
||||||
|
if(TRUNCATED_THREAD_NAME_LOGS)
|
||||||
add_compile_definitions(TRUNCATED_THREAD_NAME_LOGS)
|
add_compile_definitions(TRUNCATED_THREAD_NAME_LOGS)
|
||||||
endif ()
|
endif()
|
||||||
else ()
|
else()
|
||||||
# we are not ready to allow shared-libs on windows because it would require export declarations. On macos it's more
|
# we are not ready to allow shared-libs on windows because it would require export declarations. On macos it's more
|
||||||
# feasible, but static openssl produces odd linker errors, thus we disable shared lib builds for now.
|
# feasible, but static openssl produces odd linker errors, thus we disable shared lib builds for now.
|
||||||
set(BUILD_SHARED_LIBS OFF CACHE BOOL "build shared xrpl libraries - OFF for win/macos" FORCE)
|
set(BUILD_SHARED_LIBS
|
||||||
|
OFF
|
||||||
|
CACHE BOOL
|
||||||
|
"build shared xrpl libraries - OFF for win/macos"
|
||||||
|
FORCE
|
||||||
|
)
|
||||||
set(static ON CACHE BOOL "static link, linux only. ON for WIN/macos" FORCE)
|
set(static ON CACHE BOOL "static link, linux only. ON for WIN/macos" FORCE)
|
||||||
set(perf OFF CACHE BOOL "perf flags, linux only" FORCE)
|
set(perf OFF CACHE BOOL "perf flags, linux only" FORCE)
|
||||||
set(use_gold OFF CACHE BOOL "gold linker, linux only" FORCE)
|
set(use_gold OFF CACHE BOOL "gold linker, linux only" FORCE)
|
||||||
set(use_mold OFF CACHE BOOL "mold linker, linux only" FORCE)
|
set(use_mold OFF CACHE BOOL "mold linker, linux only" FORCE)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
if (is_clang)
|
if(is_clang)
|
||||||
option(use_lld "enables detection of lld linker" ON)
|
option(use_lld "enables detection of lld linker" ON)
|
||||||
else ()
|
else()
|
||||||
set(use_lld OFF CACHE BOOL "try lld linker, clang only" FORCE)
|
set(use_lld OFF CACHE BOOL "try lld linker, clang only" FORCE)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
option(jemalloc "Enables jemalloc for heap profiling" OFF)
|
option(jemalloc "Enables jemalloc for heap profiling" OFF)
|
||||||
option(werr "treat warnings as errors" OFF)
|
option(werr "treat warnings as errors" OFF)
|
||||||
option(local_protobuf
|
option(
|
||||||
"Force a local build of protobuf instead of looking for an installed version." OFF)
|
local_protobuf
|
||||||
option(local_grpc "Force a local build of gRPC instead of looking for an installed version." OFF)
|
"Force a local build of protobuf instead of looking for an installed version."
|
||||||
|
OFF
|
||||||
|
)
|
||||||
|
option(
|
||||||
|
local_grpc
|
||||||
|
"Force a local build of gRPC instead of looking for an installed version."
|
||||||
|
OFF
|
||||||
|
)
|
||||||
|
|
||||||
# the remaining options are obscure and rarely used
|
# the remaining options are obscure and rarely used
|
||||||
option(beast_no_unit_test_inline
|
option(
|
||||||
"Prevents unit test definitions from being inserted into global table" OFF)
|
beast_no_unit_test_inline
|
||||||
option(single_io_service_thread "Restricts the number of threads calling io_context::run to one. \
|
"Prevents unit test definitions from being inserted into global table"
|
||||||
This can be useful when debugging." OFF)
|
OFF
|
||||||
option(boost_show_deprecated "Allow boost to fail on deprecated usage. Only useful if you're trying\
|
)
|
||||||
to find deprecated calls." OFF)
|
option(
|
||||||
|
single_io_service_thread
|
||||||
|
"Restricts the number of threads calling io_context::run to one. \
|
||||||
|
This can be useful when debugging."
|
||||||
|
OFF
|
||||||
|
)
|
||||||
|
option(
|
||||||
|
boost_show_deprecated
|
||||||
|
"Allow boost to fail on deprecated usage. Only useful if you're trying\
|
||||||
|
to find deprecated calls."
|
||||||
|
OFF
|
||||||
|
)
|
||||||
|
|
||||||
if (WIN32)
|
if(WIN32)
|
||||||
option(beast_disable_autolink "Disables autolinking of system libraries on WIN32" OFF)
|
option(
|
||||||
else ()
|
beast_disable_autolink
|
||||||
|
"Disables autolinking of system libraries on WIN32"
|
||||||
|
OFF
|
||||||
|
)
|
||||||
|
else()
|
||||||
set(beast_disable_autolink OFF CACHE BOOL "WIN32 only" FORCE)
|
set(beast_disable_autolink OFF CACHE BOOL "WIN32 only" FORCE)
|
||||||
endif ()
|
endif()
|
||||||
|
|
||||||
if (coverage)
|
if(coverage)
|
||||||
message(STATUS "coverage build requested - forcing Debug build")
|
message(STATUS "coverage build requested - forcing Debug build")
|
||||||
set(CMAKE_BUILD_TYPE Debug CACHE STRING "build type" FORCE)
|
set(CMAKE_BUILD_TYPE Debug CACHE STRING "build type" FORCE)
|
||||||
endif ()
|
endif()
|
||||||
|
|||||||
@@ -1,20 +1,26 @@
|
|||||||
option(validator_keys
|
option(
|
||||||
"Enables building of validator-keys tool as a separate target (imported via FetchContent)"
|
validator_keys
|
||||||
OFF)
|
"Enables building of validator-keys tool as a separate target (imported via FetchContent)"
|
||||||
|
OFF
|
||||||
|
)
|
||||||
|
|
||||||
if (validator_keys)
|
if(validator_keys)
|
||||||
git_branch(current_branch)
|
git_branch(current_branch)
|
||||||
# default to tracking VK master branch unless we are on release
|
# default to tracking VK master branch unless we are on release
|
||||||
if (NOT (current_branch STREQUAL "release"))
|
if(NOT (current_branch STREQUAL "release"))
|
||||||
set(current_branch "master")
|
set(current_branch "master")
|
||||||
endif ()
|
endif()
|
||||||
message(STATUS "Tracking ValidatorKeys branch: ${current_branch}")
|
message(STATUS "Tracking ValidatorKeys branch: ${current_branch}")
|
||||||
|
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
validator_keys GIT_REPOSITORY https://github.com/ripple/validator-keys-tool.git
|
validator_keys
|
||||||
GIT_TAG "${current_branch}")
|
GIT_REPOSITORY https://github.com/ripple/validator-keys-tool.git
|
||||||
|
GIT_TAG "${current_branch}"
|
||||||
|
)
|
||||||
FetchContent_MakeAvailable(validator_keys)
|
FetchContent_MakeAvailable(validator_keys)
|
||||||
set_target_properties(validator-keys PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}")
|
set_target_properties(
|
||||||
|
validator-keys
|
||||||
|
PROPERTIES RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}"
|
||||||
|
)
|
||||||
install(TARGETS validator-keys RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
install(TARGETS validator-keys RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
|
endif()
|
||||||
endif ()
|
|
||||||
|
|||||||
@@ -3,13 +3,13 @@
|
|||||||
#]===================================================================]
|
#]===================================================================]
|
||||||
|
|
||||||
file(STRINGS src/libxrpl/protocol/BuildInfo.cpp BUILD_INFO)
|
file(STRINGS src/libxrpl/protocol/BuildInfo.cpp BUILD_INFO)
|
||||||
foreach (line_ ${BUILD_INFO})
|
foreach(line_ ${BUILD_INFO})
|
||||||
if (line_ MATCHES "versionString[ ]*=[ ]*\"(.+)\"")
|
if(line_ MATCHES "versionString[ ]*=[ ]*\"(.+)\"")
|
||||||
set(xrpld_version ${CMAKE_MATCH_1})
|
set(xrpld_version ${CMAKE_MATCH_1})
|
||||||
endif ()
|
endif()
|
||||||
endforeach ()
|
endforeach()
|
||||||
if (xrpld_version)
|
if(xrpld_version)
|
||||||
message(STATUS "xrpld version: ${xrpld_version}")
|
message(STATUS "xrpld version: ${xrpld_version}")
|
||||||
else ()
|
else()
|
||||||
message(FATAL_ERROR "unable to determine xrpld version")
|
message(FATAL_ERROR "unable to determine xrpld version")
|
||||||
endif ()
|
endif()
|
||||||
|
|||||||
@@ -12,15 +12,29 @@ include(isolate_headers)
|
|||||||
# add_module(parent a)
|
# add_module(parent a)
|
||||||
# add_module(parent b)
|
# add_module(parent b)
|
||||||
# target_link_libraries(project.libparent.b PUBLIC project.libparent.a)
|
# target_link_libraries(project.libparent.b PUBLIC project.libparent.a)
|
||||||
function (add_module parent name)
|
function(add_module parent name)
|
||||||
set(target ${PROJECT_NAME}.lib${parent}.${name})
|
set(target ${PROJECT_NAME}.lib${parent}.${name})
|
||||||
add_library(${target} OBJECT)
|
add_library(${target} OBJECT)
|
||||||
file(GLOB_RECURSE sources CONFIGURE_DEPENDS
|
file(
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/lib${parent}/${name}/*.cpp")
|
GLOB_RECURSE sources
|
||||||
|
CONFIGURE_DEPENDS
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/lib${parent}/${name}/*.cpp"
|
||||||
|
)
|
||||||
target_sources(${target} PRIVATE ${sources})
|
target_sources(${target} PRIVATE ${sources})
|
||||||
target_include_directories(${target} PUBLIC "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>")
|
target_include_directories(
|
||||||
isolate_headers(${target} "${CMAKE_CURRENT_SOURCE_DIR}/include"
|
${target}
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/include/${parent}/${name}" PUBLIC)
|
PUBLIC "$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
|
||||||
isolate_headers(${target} "${CMAKE_CURRENT_SOURCE_DIR}/src"
|
)
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/src/lib${parent}/${name}" PRIVATE)
|
isolate_headers(
|
||||||
endfunction ()
|
${target}
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/include"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/include/${parent}/${name}"
|
||||||
|
PUBLIC
|
||||||
|
)
|
||||||
|
isolate_headers(
|
||||||
|
${target}
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/src"
|
||||||
|
"${CMAKE_CURRENT_SOURCE_DIR}/src/lib${parent}/${name}"
|
||||||
|
PRIVATE
|
||||||
|
)
|
||||||
|
endfunction()
|
||||||
|
|||||||
@@ -1,19 +1,21 @@
|
|||||||
# file(CREATE_SYMLINK) only works on Windows with administrator privileges. https://stackoverflow.com/a/61244115/618906
|
# file(CREATE_SYMLINK) only works on Windows with administrator privileges. https://stackoverflow.com/a/61244115/618906
|
||||||
function (create_symbolic_link target link)
|
function(create_symbolic_link target link)
|
||||||
if (WIN32)
|
if(WIN32)
|
||||||
if (NOT IS_SYMLINK "${link}")
|
if(NOT IS_SYMLINK "${link}")
|
||||||
if (NOT IS_ABSOLUTE "${target}")
|
if(NOT IS_ABSOLUTE "${target}")
|
||||||
# Relative links work do not work on Windows.
|
# Relative links work do not work on Windows.
|
||||||
set(target "${link}/../${target}")
|
set(target "${link}/../${target}")
|
||||||
endif ()
|
endif()
|
||||||
file(TO_NATIVE_PATH "${target}" target)
|
file(TO_NATIVE_PATH "${target}" target)
|
||||||
file(TO_NATIVE_PATH "${link}" link)
|
file(TO_NATIVE_PATH "${link}" link)
|
||||||
execute_process(COMMAND cmd.exe /c mklink /J "${link}" "${target}")
|
execute_process(
|
||||||
endif ()
|
COMMAND cmd.exe /c mklink /J "${link}" "${target}"
|
||||||
else ()
|
)
|
||||||
|
endif()
|
||||||
|
else()
|
||||||
file(CREATE_LINK "${target}" "${link}" SYMBOLIC)
|
file(CREATE_LINK "${target}" "${link}" SYMBOLIC)
|
||||||
endif ()
|
endif()
|
||||||
if (NOT IS_SYMLINK "${link}")
|
if(NOT IS_SYMLINK "${link}")
|
||||||
message(ERROR "failed to create symlink: <${link}>")
|
message(ERROR "failed to create symlink: <${link}>")
|
||||||
endif ()
|
endif()
|
||||||
endfunction ()
|
endfunction()
|
||||||
|
|||||||
@@ -1,45 +1,60 @@
|
|||||||
include(CompilationEnv)
|
include(CompilationEnv)
|
||||||
include(XrplSanitizers)
|
include(XrplSanitizers)
|
||||||
|
|
||||||
find_package(Boost REQUIRED
|
find_package(
|
||||||
COMPONENTS chrono
|
Boost
|
||||||
container
|
REQUIRED
|
||||||
coroutine
|
COMPONENTS
|
||||||
date_time
|
chrono
|
||||||
filesystem
|
container
|
||||||
json
|
coroutine
|
||||||
program_options
|
date_time
|
||||||
regex
|
filesystem
|
||||||
system
|
json
|
||||||
thread)
|
program_options
|
||||||
|
regex
|
||||||
|
system
|
||||||
|
thread
|
||||||
|
)
|
||||||
|
|
||||||
add_library(xrpl_boost INTERFACE)
|
add_library(xrpl_boost INTERFACE)
|
||||||
add_library(Xrpl::boost ALIAS xrpl_boost)
|
add_library(Xrpl::boost ALIAS xrpl_boost)
|
||||||
|
|
||||||
target_link_libraries(
|
target_link_libraries(
|
||||||
xrpl_boost
|
xrpl_boost
|
||||||
INTERFACE Boost::headers
|
INTERFACE
|
||||||
Boost::chrono
|
Boost::headers
|
||||||
Boost::container
|
Boost::chrono
|
||||||
Boost::coroutine
|
Boost::container
|
||||||
Boost::date_time
|
Boost::coroutine
|
||||||
Boost::filesystem
|
Boost::date_time
|
||||||
Boost::json
|
Boost::filesystem
|
||||||
Boost::process
|
Boost::json
|
||||||
Boost::program_options
|
Boost::process
|
||||||
Boost::regex
|
Boost::program_options
|
||||||
Boost::thread)
|
Boost::regex
|
||||||
if (Boost_COMPILER)
|
Boost::thread
|
||||||
|
)
|
||||||
|
if(Boost_COMPILER)
|
||||||
target_link_libraries(xrpl_boost INTERFACE Boost::disable_autolinking)
|
target_link_libraries(xrpl_boost INTERFACE Boost::disable_autolinking)
|
||||||
endif ()
|
endif()
|
||||||
if (SANITIZERS_ENABLED AND is_clang)
|
if(SANITIZERS_ENABLED AND is_clang)
|
||||||
# TODO: gcc does not support -fsanitize-blacklist...can we do something else for gcc ?
|
# TODO: gcc does not support -fsanitize-blacklist...can we do something else for gcc ?
|
||||||
if (NOT Boost_INCLUDE_DIRS AND TARGET Boost::headers)
|
if(NOT Boost_INCLUDE_DIRS AND TARGET Boost::headers)
|
||||||
get_target_property(Boost_INCLUDE_DIRS Boost::headers INTERFACE_INCLUDE_DIRECTORIES)
|
get_target_property(
|
||||||
endif ()
|
Boost_INCLUDE_DIRS
|
||||||
|
Boost::headers
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES
|
||||||
|
)
|
||||||
|
endif()
|
||||||
message(STATUS "Adding [${Boost_INCLUDE_DIRS}] to sanitizer blacklist")
|
message(STATUS "Adding [${Boost_INCLUDE_DIRS}] to sanitizer blacklist")
|
||||||
file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/san_bl.txt "src:${Boost_INCLUDE_DIRS}/*")
|
file(
|
||||||
|
WRITE ${CMAKE_CURRENT_BINARY_DIR}/san_bl.txt
|
||||||
|
"src:${Boost_INCLUDE_DIRS}/*"
|
||||||
|
)
|
||||||
target_compile_options(
|
target_compile_options(
|
||||||
opts INTERFACE # ignore boost headers for sanitizing
|
opts
|
||||||
-fsanitize-blacklist=${CMAKE_CURRENT_BINARY_DIR}/san_bl.txt)
|
INTERFACE # ignore boost headers for sanitizing
|
||||||
endif ()
|
-fsanitize-blacklist=${CMAKE_CURRENT_BINARY_DIR}/san_bl.txt
|
||||||
|
)
|
||||||
|
endif()
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ include(create_symbolic_link)
|
|||||||
# `${CMAKE_CURRENT_BINARY_DIR}/include/${target}`.
|
# `${CMAKE_CURRENT_BINARY_DIR}/include/${target}`.
|
||||||
#
|
#
|
||||||
# isolate_headers(target A B scope)
|
# isolate_headers(target A B scope)
|
||||||
function (isolate_headers target A B scope)
|
function(isolate_headers target A B scope)
|
||||||
file(RELATIVE_PATH C "${A}" "${B}")
|
file(RELATIVE_PATH C "${A}" "${B}")
|
||||||
set(X "${CMAKE_CURRENT_BINARY_DIR}/modules/${target}")
|
set(X "${CMAKE_CURRENT_BINARY_DIR}/modules/${target}")
|
||||||
set(Y "${X}/${C}")
|
set(Y "${X}/${C}")
|
||||||
@@ -45,4 +45,4 @@ function (isolate_headers target A B scope)
|
|||||||
file(MAKE_DIRECTORY "${parent}")
|
file(MAKE_DIRECTORY "${parent}")
|
||||||
create_symbolic_link("${B}" "${Y}")
|
create_symbolic_link("${B}" "${Y}")
|
||||||
target_include_directories(${target} ${scope} "$<BUILD_INTERFACE:${X}>")
|
target_include_directories(${target} ${scope} "$<BUILD_INTERFACE:${X}>")
|
||||||
endfunction ()
|
endfunction()
|
||||||
|
|||||||
@@ -6,9 +6,9 @@
|
|||||||
# target_link_libraries(project.libparent.b PUBLIC project.libparent.a)
|
# target_link_libraries(project.libparent.b PUBLIC project.libparent.a)
|
||||||
# add_library(project.libparent)
|
# add_library(project.libparent)
|
||||||
# target_link_modules(parent PUBLIC a b)
|
# target_link_modules(parent PUBLIC a b)
|
||||||
function (target_link_modules parent scope)
|
function(target_link_modules parent scope)
|
||||||
set(library ${PROJECT_NAME}.lib${parent})
|
set(library ${PROJECT_NAME}.lib${parent})
|
||||||
foreach (name ${ARGN})
|
foreach(name ${ARGN})
|
||||||
set(module ${library}.${name})
|
set(module ${library}.${name})
|
||||||
get_target_property(sources ${library} SOURCES)
|
get_target_property(sources ${library} SOURCES)
|
||||||
list(LENGTH sources before)
|
list(LENGTH sources before)
|
||||||
@@ -17,8 +17,11 @@ function (target_link_modules parent scope)
|
|||||||
list(REMOVE_ITEM sources ${dupes})
|
list(REMOVE_ITEM sources ${dupes})
|
||||||
list(LENGTH sources after)
|
list(LENGTH sources after)
|
||||||
math(EXPR actual "${before} - ${after}")
|
math(EXPR actual "${before} - ${after}")
|
||||||
message(STATUS "${module} with ${expected} sources took ${actual} sources from ${library}")
|
message(
|
||||||
|
STATUS
|
||||||
|
"${module} with ${expected} sources took ${actual} sources from ${library}"
|
||||||
|
)
|
||||||
set_target_properties(${library} PROPERTIES SOURCES "${sources}")
|
set_target_properties(${library} PROPERTIES SOURCES "${sources}")
|
||||||
target_link_libraries(${library} ${scope} ${module})
|
target_link_libraries(${library} ${scope} ${module})
|
||||||
endforeach ()
|
endforeach()
|
||||||
endfunction ()
|
endfunction()
|
||||||
|
|||||||
@@ -35,20 +35,31 @@ find_package(Protobuf REQUIRED)
|
|||||||
# This prefix should appear at the start of all your consumer includes.
|
# This prefix should appear at the start of all your consumer includes.
|
||||||
# ARGN:
|
# ARGN:
|
||||||
# A list of .proto files.
|
# A list of .proto files.
|
||||||
function (target_protobuf_sources target prefix)
|
function(target_protobuf_sources target prefix)
|
||||||
set(dir "${CMAKE_CURRENT_BINARY_DIR}/pb-${target}")
|
set(dir "${CMAKE_CURRENT_BINARY_DIR}/pb-${target}")
|
||||||
file(MAKE_DIRECTORY "${dir}/${prefix}")
|
file(MAKE_DIRECTORY "${dir}/${prefix}")
|
||||||
|
|
||||||
protobuf_generate(TARGET ${target} PROTOC_OUT_DIR "${dir}/${prefix}" "${ARGN}")
|
protobuf_generate(
|
||||||
|
TARGET ${target}
|
||||||
|
PROTOC_OUT_DIR "${dir}/${prefix}"
|
||||||
|
"${ARGN}"
|
||||||
|
)
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
${target} SYSTEM
|
${target}
|
||||||
|
SYSTEM
|
||||||
PUBLIC # Allows #include <package/path/to/file.proto> used by consumer files.
|
PUBLIC # Allows #include <package/path/to/file.proto> used by consumer files.
|
||||||
$<BUILD_INTERFACE:${dir}>
|
$<BUILD_INTERFACE:${dir}>
|
||||||
# Allows #include "path/to/file.proto" used by generated files.
|
# Allows #include "path/to/file.proto" used by generated files.
|
||||||
$<BUILD_INTERFACE:${dir}/${prefix}>
|
$<BUILD_INTERFACE:${dir}/${prefix}>
|
||||||
# Allows #include <package/path/to/file.proto> used by consumer files.
|
# Allows #include <package/path/to/file.proto> used by consumer files.
|
||||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>
|
||||||
# Allows #include "path/to/file.proto" used by generated files.
|
# Allows #include "path/to/file.proto" used by generated files.
|
||||||
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${prefix}>)
|
$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/${prefix}>
|
||||||
install(DIRECTORY ${dir}/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} FILES_MATCHING PATTERN "*.h")
|
)
|
||||||
endfunction ()
|
install(
|
||||||
|
DIRECTORY ${dir}/
|
||||||
|
DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
|
||||||
|
FILES_MATCHING
|
||||||
|
PATTERN "*.h"
|
||||||
|
)
|
||||||
|
endfunction()
|
||||||
|
|||||||
155
include/xrpl/basics/Mutex.hpp
Normal file
155
include/xrpl/basics/Mutex.hpp
Normal file
@@ -0,0 +1,155 @@
|
|||||||
|
/*
|
||||||
|
This file is part of clio: https://github.com/XRPLF/clio
|
||||||
|
Copyright (c) 2024, the clio developers.
|
||||||
|
|
||||||
|
Permission to use, copy, modify, and distribute this software for any
|
||||||
|
purpose with or without fee is hereby granted, provided that the above
|
||||||
|
copyright notice and this permission notice appear in all copies.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <mutex>
|
||||||
|
#include <type_traits>
|
||||||
|
|
||||||
|
namespace xrpl {
|
||||||
|
|
||||||
|
template <typename ProtectedDataType, typename MutexType>
|
||||||
|
class Mutex;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief A lock on a mutex that provides access to the protected data.
|
||||||
|
*
|
||||||
|
* @tparam ProtectedDataType data type to hold
|
||||||
|
* @tparam LockType type of lock
|
||||||
|
* @tparam MutexType type of mutex
|
||||||
|
*/
|
||||||
|
template <typename ProtectedDataType, template <typename...> typename LockType, typename MutexType>
|
||||||
|
class Lock
|
||||||
|
{
|
||||||
|
LockType<MutexType> lock_;
|
||||||
|
ProtectedDataType& data_;
|
||||||
|
|
||||||
|
public:
|
||||||
|
/** @cond */
|
||||||
|
ProtectedDataType const&
|
||||||
|
operator*() const
|
||||||
|
{
|
||||||
|
return data_;
|
||||||
|
}
|
||||||
|
|
||||||
|
ProtectedDataType&
|
||||||
|
operator*()
|
||||||
|
{
|
||||||
|
return data_;
|
||||||
|
}
|
||||||
|
|
||||||
|
ProtectedDataType const&
|
||||||
|
get() const
|
||||||
|
{
|
||||||
|
return data_;
|
||||||
|
}
|
||||||
|
|
||||||
|
ProtectedDataType&
|
||||||
|
get()
|
||||||
|
{
|
||||||
|
return data_;
|
||||||
|
}
|
||||||
|
|
||||||
|
ProtectedDataType const*
|
||||||
|
operator->() const
|
||||||
|
{
|
||||||
|
return &data_;
|
||||||
|
}
|
||||||
|
|
||||||
|
ProtectedDataType*
|
||||||
|
operator->()
|
||||||
|
{
|
||||||
|
return &data_;
|
||||||
|
}
|
||||||
|
|
||||||
|
operator LockType<MutexType>&() &
|
||||||
|
{
|
||||||
|
return lock_;
|
||||||
|
}
|
||||||
|
|
||||||
|
operator LockType<MutexType> const&() const&
|
||||||
|
{
|
||||||
|
return lock_;
|
||||||
|
}
|
||||||
|
/** @endcond */
|
||||||
|
|
||||||
|
private:
|
||||||
|
friend class Mutex<std::remove_const_t<ProtectedDataType>, MutexType>;
|
||||||
|
|
||||||
|
Lock(MutexType& mutex, ProtectedDataType& data) : lock_(mutex), data_(data)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief A container for data that is protected by a mutex. Inspired by Mutex in Rust.
|
||||||
|
*
|
||||||
|
* @tparam ProtectedDataType data type to hold
|
||||||
|
* @tparam MutexType type of mutex
|
||||||
|
*/
|
||||||
|
template <typename ProtectedDataType, typename MutexType = std::mutex>
|
||||||
|
class Mutex
|
||||||
|
{
|
||||||
|
mutable MutexType mutex_;
|
||||||
|
ProtectedDataType data_{};
|
||||||
|
|
||||||
|
public:
|
||||||
|
Mutex() = default;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Construct a new Mutex object with the given data
|
||||||
|
*
|
||||||
|
* @param data The data to protect
|
||||||
|
*/
|
||||||
|
explicit Mutex(ProtectedDataType data) : data_(std::move(data))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Make a new Mutex object with the given data
|
||||||
|
*
|
||||||
|
* @tparam Args The types of the arguments to forward to the constructor of the protected data
|
||||||
|
* @param args The arguments to forward to the constructor of the protected data
|
||||||
|
* @return The Mutex object that protects the given data
|
||||||
|
*/
|
||||||
|
template <typename... Args>
|
||||||
|
static Mutex
|
||||||
|
make(Args&&... args)
|
||||||
|
{
|
||||||
|
return Mutex{ProtectedDataType{std::forward<Args>(args)...}};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Lock the mutex and get a lock object allowing access to the protected data
|
||||||
|
*
|
||||||
|
* @tparam LockType The type of lock to use
|
||||||
|
* @return A lock on the mutex and a reference to the protected data
|
||||||
|
*/
|
||||||
|
template <template <typename...> typename LockType = std::lock_guard>
|
||||||
|
Lock<ProtectedDataType const, LockType, MutexType>
|
||||||
|
lock() const
|
||||||
|
{
|
||||||
|
return {mutex_, data_};
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Lock the mutex and get a lock object allowing access to the protected data
|
||||||
|
*
|
||||||
|
* @tparam LockType The type of lock to use
|
||||||
|
* @return A lock on the mutex and a reference to the protected data
|
||||||
|
*/
|
||||||
|
template <template <typename...> typename LockType = std::lock_guard>
|
||||||
|
Lock<ProtectedDataType, LockType, MutexType>
|
||||||
|
lock()
|
||||||
|
{
|
||||||
|
return {mutex_, data_};
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace xrpl
|
||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
/** This transaction type executes a payment. */
|
/** This transaction type executes a payment. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Payment.h>
|
# include <xrpl/tx/transactors/payment/Payment.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttPAYMENT, 0, Payment,
|
TRANSACTION(ttPAYMENT, 0, Payment,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -42,7 +42,7 @@ TRANSACTION(ttPAYMENT, 0, Payment,
|
|||||||
|
|
||||||
/** This transaction type creates an escrow object. */
|
/** This transaction type creates an escrow object. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Escrow.h>
|
# include <xrpl/tx/transactors/escrow/Escrow.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttESCROW_CREATE, 1, EscrowCreate,
|
TRANSACTION(ttESCROW_CREATE, 1, EscrowCreate,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -73,7 +73,7 @@ TRANSACTION(ttESCROW_FINISH, 2, EscrowFinish,
|
|||||||
|
|
||||||
/** This transaction type adjusts various account settings. */
|
/** This transaction type adjusts various account settings. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/SetAccount.h>
|
# include <xrpl/tx/transactors/account/SetAccount.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttACCOUNT_SET, 3, AccountSet,
|
TRANSACTION(ttACCOUNT_SET, 3, AccountSet,
|
||||||
Delegation::notDelegable,
|
Delegation::notDelegable,
|
||||||
@@ -94,7 +94,7 @@ TRANSACTION(ttACCOUNT_SET, 3, AccountSet,
|
|||||||
|
|
||||||
/** This transaction type cancels an existing escrow. */
|
/** This transaction type cancels an existing escrow. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Escrow.h>
|
# include <xrpl/tx/transactors/escrow/Escrow.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttESCROW_CANCEL, 4, EscrowCancel,
|
TRANSACTION(ttESCROW_CANCEL, 4, EscrowCancel,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -107,7 +107,7 @@ TRANSACTION(ttESCROW_CANCEL, 4, EscrowCancel,
|
|||||||
|
|
||||||
/** This transaction type sets or clears an account's "regular key". */
|
/** This transaction type sets or clears an account's "regular key". */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/SetRegularKey.h>
|
# include <xrpl/tx/transactors/account/SetRegularKey.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttREGULAR_KEY_SET, 5, SetRegularKey,
|
TRANSACTION(ttREGULAR_KEY_SET, 5, SetRegularKey,
|
||||||
Delegation::notDelegable,
|
Delegation::notDelegable,
|
||||||
@@ -121,7 +121,7 @@ TRANSACTION(ttREGULAR_KEY_SET, 5, SetRegularKey,
|
|||||||
|
|
||||||
/** This transaction type creates an offer to trade one asset for another. */
|
/** This transaction type creates an offer to trade one asset for another. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Offer/CreateOffer.h>
|
# include <xrpl/tx/transactors/dex/CreateOffer.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttOFFER_CREATE, 7, OfferCreate,
|
TRANSACTION(ttOFFER_CREATE, 7, OfferCreate,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -137,7 +137,7 @@ TRANSACTION(ttOFFER_CREATE, 7, OfferCreate,
|
|||||||
|
|
||||||
/** This transaction type cancels existing offers to trade one asset for another. */
|
/** This transaction type cancels existing offers to trade one asset for another. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Offer/CancelOffer.h>
|
# include <xrpl/tx/transactors/dex/CancelOffer.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttOFFER_CANCEL, 8, OfferCancel,
|
TRANSACTION(ttOFFER_CANCEL, 8, OfferCancel,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -151,7 +151,7 @@ TRANSACTION(ttOFFER_CANCEL, 8, OfferCancel,
|
|||||||
|
|
||||||
/** This transaction type creates a new set of tickets. */
|
/** This transaction type creates a new set of tickets. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/CreateTicket.h>
|
# include <xrpl/tx/transactors/system/CreateTicket.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttTICKET_CREATE, 10, TicketCreate,
|
TRANSACTION(ttTICKET_CREATE, 10, TicketCreate,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -167,7 +167,7 @@ TRANSACTION(ttTICKET_CREATE, 10, TicketCreate,
|
|||||||
// The SignerEntries are optional because a SignerList is deleted by
|
// The SignerEntries are optional because a SignerList is deleted by
|
||||||
// setting the SignerQuorum to zero and omitting SignerEntries.
|
// setting the SignerQuorum to zero and omitting SignerEntries.
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/SetSignerList.h>
|
# include <xrpl/tx/transactors/account/SetSignerList.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttSIGNER_LIST_SET, 12, SignerListSet,
|
TRANSACTION(ttSIGNER_LIST_SET, 12, SignerListSet,
|
||||||
Delegation::notDelegable,
|
Delegation::notDelegable,
|
||||||
@@ -180,7 +180,7 @@ TRANSACTION(ttSIGNER_LIST_SET, 12, SignerListSet,
|
|||||||
|
|
||||||
/** This transaction type creates a new unidirectional XRP payment channel. */
|
/** This transaction type creates a new unidirectional XRP payment channel. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/PayChan.h>
|
# include <xrpl/tx/transactors/payment_channel/PayChan.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttPAYCHAN_CREATE, 13, PaymentChannelCreate,
|
TRANSACTION(ttPAYCHAN_CREATE, 13, PaymentChannelCreate,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -222,7 +222,7 @@ TRANSACTION(ttPAYCHAN_CLAIM, 15, PaymentChannelClaim,
|
|||||||
|
|
||||||
/** This transaction type creates a new check. */
|
/** This transaction type creates a new check. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Check/CreateCheck.h>
|
# include <xrpl/tx/transactors/check/CreateCheck.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttCHECK_CREATE, 16, CheckCreate,
|
TRANSACTION(ttCHECK_CREATE, 16, CheckCreate,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -238,7 +238,7 @@ TRANSACTION(ttCHECK_CREATE, 16, CheckCreate,
|
|||||||
|
|
||||||
/** This transaction type cashes an existing check. */
|
/** This transaction type cashes an existing check. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Check/CashCheck.h>
|
# include <xrpl/tx/transactors/check/CashCheck.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttCHECK_CASH, 17, CheckCash,
|
TRANSACTION(ttCHECK_CASH, 17, CheckCash,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -252,7 +252,7 @@ TRANSACTION(ttCHECK_CASH, 17, CheckCash,
|
|||||||
|
|
||||||
/** This transaction type cancels an existing check. */
|
/** This transaction type cancels an existing check. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Check/CancelCheck.h>
|
# include <xrpl/tx/transactors/check/CancelCheck.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttCHECK_CANCEL, 18, CheckCancel,
|
TRANSACTION(ttCHECK_CANCEL, 18, CheckCancel,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -264,7 +264,7 @@ TRANSACTION(ttCHECK_CANCEL, 18, CheckCancel,
|
|||||||
|
|
||||||
/** This transaction type grants or revokes authorization to transfer funds. */
|
/** This transaction type grants or revokes authorization to transfer funds. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/DepositPreauth.h>
|
# include <xrpl/tx/transactors/payment/DepositPreauth.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttDEPOSIT_PREAUTH, 19, DepositPreauth,
|
TRANSACTION(ttDEPOSIT_PREAUTH, 19, DepositPreauth,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -279,7 +279,7 @@ TRANSACTION(ttDEPOSIT_PREAUTH, 19, DepositPreauth,
|
|||||||
|
|
||||||
/** This transaction type modifies a trustline between two accounts. */
|
/** This transaction type modifies a trustline between two accounts. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/SetTrust.h>
|
# include <xrpl/tx/transactors/token/SetTrust.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttTRUST_SET, 20, TrustSet,
|
TRANSACTION(ttTRUST_SET, 20, TrustSet,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -293,7 +293,7 @@ TRANSACTION(ttTRUST_SET, 20, TrustSet,
|
|||||||
|
|
||||||
/** This transaction type deletes an existing account. */
|
/** This transaction type deletes an existing account. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/DeleteAccount.h>
|
# include <xrpl/tx/transactors/account/DeleteAccount.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttACCOUNT_DELETE, 21, AccountDelete,
|
TRANSACTION(ttACCOUNT_DELETE, 21, AccountDelete,
|
||||||
Delegation::notDelegable,
|
Delegation::notDelegable,
|
||||||
@@ -309,7 +309,7 @@ TRANSACTION(ttACCOUNT_DELETE, 21, AccountDelete,
|
|||||||
|
|
||||||
/** This transaction mints a new NFT. */
|
/** This transaction mints a new NFT. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/NFT/NFTokenMint.h>
|
# include <xrpl/tx/transactors/nft/NFTokenMint.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttNFTOKEN_MINT, 25, NFTokenMint,
|
TRANSACTION(ttNFTOKEN_MINT, 25, NFTokenMint,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -327,7 +327,7 @@ TRANSACTION(ttNFTOKEN_MINT, 25, NFTokenMint,
|
|||||||
|
|
||||||
/** This transaction burns (i.e. destroys) an existing NFT. */
|
/** This transaction burns (i.e. destroys) an existing NFT. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/NFT/NFTokenBurn.h>
|
# include <xrpl/tx/transactors/nft/NFTokenBurn.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttNFTOKEN_BURN, 26, NFTokenBurn,
|
TRANSACTION(ttNFTOKEN_BURN, 26, NFTokenBurn,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -340,7 +340,7 @@ TRANSACTION(ttNFTOKEN_BURN, 26, NFTokenBurn,
|
|||||||
|
|
||||||
/** This transaction creates a new offer to buy or sell an NFT. */
|
/** This transaction creates a new offer to buy or sell an NFT. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/NFT/NFTokenCreateOffer.h>
|
# include <xrpl/tx/transactors/nft/NFTokenCreateOffer.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttNFTOKEN_CREATE_OFFER, 27, NFTokenCreateOffer,
|
TRANSACTION(ttNFTOKEN_CREATE_OFFER, 27, NFTokenCreateOffer,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -356,7 +356,7 @@ TRANSACTION(ttNFTOKEN_CREATE_OFFER, 27, NFTokenCreateOffer,
|
|||||||
|
|
||||||
/** This transaction cancels an existing offer to buy or sell an existing NFT. */
|
/** This transaction cancels an existing offer to buy or sell an existing NFT. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/NFT/NFTokenCancelOffer.h>
|
# include <xrpl/tx/transactors/nft/NFTokenCancelOffer.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttNFTOKEN_CANCEL_OFFER, 28, NFTokenCancelOffer,
|
TRANSACTION(ttNFTOKEN_CANCEL_OFFER, 28, NFTokenCancelOffer,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -368,7 +368,7 @@ TRANSACTION(ttNFTOKEN_CANCEL_OFFER, 28, NFTokenCancelOffer,
|
|||||||
|
|
||||||
/** This transaction accepts an existing offer to buy or sell an existing NFT. */
|
/** This transaction accepts an existing offer to buy or sell an existing NFT. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/NFT/NFTokenAcceptOffer.h>
|
# include <xrpl/tx/transactors/nft/NFTokenAcceptOffer.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttNFTOKEN_ACCEPT_OFFER, 29, NFTokenAcceptOffer,
|
TRANSACTION(ttNFTOKEN_ACCEPT_OFFER, 29, NFTokenAcceptOffer,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -382,7 +382,7 @@ TRANSACTION(ttNFTOKEN_ACCEPT_OFFER, 29, NFTokenAcceptOffer,
|
|||||||
|
|
||||||
/** This transaction claws back issued tokens. */
|
/** This transaction claws back issued tokens. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Clawback.h>
|
# include <xrpl/tx/transactors/token/Clawback.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttCLAWBACK, 30, Clawback,
|
TRANSACTION(ttCLAWBACK, 30, Clawback,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -395,7 +395,7 @@ TRANSACTION(ttCLAWBACK, 30, Clawback,
|
|||||||
|
|
||||||
/** This transaction claws back tokens from an AMM pool. */
|
/** This transaction claws back tokens from an AMM pool. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/AMM/AMMClawback.h>
|
# include <xrpl/tx/transactors/dex/AMMClawback.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttAMM_CLAWBACK, 31, AMMClawback,
|
TRANSACTION(ttAMM_CLAWBACK, 31, AMMClawback,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -410,7 +410,7 @@ TRANSACTION(ttAMM_CLAWBACK, 31, AMMClawback,
|
|||||||
|
|
||||||
/** This transaction type creates an AMM instance */
|
/** This transaction type creates an AMM instance */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/AMM/AMMCreate.h>
|
# include <xrpl/tx/transactors/dex/AMMCreate.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttAMM_CREATE, 35, AMMCreate,
|
TRANSACTION(ttAMM_CREATE, 35, AMMCreate,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -424,7 +424,7 @@ TRANSACTION(ttAMM_CREATE, 35, AMMCreate,
|
|||||||
|
|
||||||
/** This transaction type deposits into an AMM instance */
|
/** This transaction type deposits into an AMM instance */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/AMM/AMMDeposit.h>
|
# include <xrpl/tx/transactors/dex/AMMDeposit.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttAMM_DEPOSIT, 36, AMMDeposit,
|
TRANSACTION(ttAMM_DEPOSIT, 36, AMMDeposit,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -442,7 +442,7 @@ TRANSACTION(ttAMM_DEPOSIT, 36, AMMDeposit,
|
|||||||
|
|
||||||
/** This transaction type withdraws from an AMM instance */
|
/** This transaction type withdraws from an AMM instance */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/AMM/AMMWithdraw.h>
|
# include <xrpl/tx/transactors/dex/AMMWithdraw.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttAMM_WITHDRAW, 37, AMMWithdraw,
|
TRANSACTION(ttAMM_WITHDRAW, 37, AMMWithdraw,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -459,7 +459,7 @@ TRANSACTION(ttAMM_WITHDRAW, 37, AMMWithdraw,
|
|||||||
|
|
||||||
/** This transaction type votes for the trading fee */
|
/** This transaction type votes for the trading fee */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/AMM/AMMVote.h>
|
# include <xrpl/tx/transactors/dex/AMMVote.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttAMM_VOTE, 38, AMMVote,
|
TRANSACTION(ttAMM_VOTE, 38, AMMVote,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -473,7 +473,7 @@ TRANSACTION(ttAMM_VOTE, 38, AMMVote,
|
|||||||
|
|
||||||
/** This transaction type bids for the auction slot */
|
/** This transaction type bids for the auction slot */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/AMM/AMMBid.h>
|
# include <xrpl/tx/transactors/dex/AMMBid.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttAMM_BID, 39, AMMBid,
|
TRANSACTION(ttAMM_BID, 39, AMMBid,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -489,7 +489,7 @@ TRANSACTION(ttAMM_BID, 39, AMMBid,
|
|||||||
|
|
||||||
/** This transaction type deletes AMM in the empty state */
|
/** This transaction type deletes AMM in the empty state */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/AMM/AMMDelete.h>
|
# include <xrpl/tx/transactors/dex/AMMDelete.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttAMM_DELETE, 40, AMMDelete,
|
TRANSACTION(ttAMM_DELETE, 40, AMMDelete,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -502,7 +502,7 @@ TRANSACTION(ttAMM_DELETE, 40, AMMDelete,
|
|||||||
|
|
||||||
/** This transactions creates a crosschain sequence number */
|
/** This transactions creates a crosschain sequence number */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/XChainBridge.h>
|
# include <xrpl/tx/transactors/bridge/XChainBridge.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttXCHAIN_CREATE_CLAIM_ID, 41, XChainCreateClaimID,
|
TRANSACTION(ttXCHAIN_CREATE_CLAIM_ID, 41, XChainCreateClaimID,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -617,7 +617,7 @@ TRANSACTION(ttXCHAIN_CREATE_BRIDGE, 48, XChainCreateBridge,
|
|||||||
|
|
||||||
/** This transaction type creates or updates a DID */
|
/** This transaction type creates or updates a DID */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/DID.h>
|
# include <xrpl/tx/transactors/did/DID.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttDID_SET, 49, DIDSet,
|
TRANSACTION(ttDID_SET, 49, DIDSet,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -638,7 +638,7 @@ TRANSACTION(ttDID_DELETE, 50, DIDDelete,
|
|||||||
|
|
||||||
/** This transaction type creates an Oracle instance */
|
/** This transaction type creates an Oracle instance */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/SetOracle.h>
|
# include <xrpl/tx/transactors/oracle/SetOracle.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttORACLE_SET, 51, OracleSet,
|
TRANSACTION(ttORACLE_SET, 51, OracleSet,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -655,7 +655,7 @@ TRANSACTION(ttORACLE_SET, 51, OracleSet,
|
|||||||
|
|
||||||
/** This transaction type deletes an Oracle instance */
|
/** This transaction type deletes an Oracle instance */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/DeleteOracle.h>
|
# include <xrpl/tx/transactors/oracle/DeleteOracle.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttORACLE_DELETE, 52, OracleDelete,
|
TRANSACTION(ttORACLE_DELETE, 52, OracleDelete,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -667,7 +667,7 @@ TRANSACTION(ttORACLE_DELETE, 52, OracleDelete,
|
|||||||
|
|
||||||
/** This transaction type fixes a problem in the ledger state */
|
/** This transaction type fixes a problem in the ledger state */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/LedgerStateFix.h>
|
# include <xrpl/tx/transactors/system/LedgerStateFix.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttLEDGER_STATE_FIX, 53, LedgerStateFix,
|
TRANSACTION(ttLEDGER_STATE_FIX, 53, LedgerStateFix,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -680,7 +680,7 @@ TRANSACTION(ttLEDGER_STATE_FIX, 53, LedgerStateFix,
|
|||||||
|
|
||||||
/** This transaction type creates a MPTokensIssuance instance */
|
/** This transaction type creates a MPTokensIssuance instance */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/MPT/MPTokenIssuanceCreate.h>
|
# include <xrpl/tx/transactors/token/MPTokenIssuanceCreate.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttMPTOKEN_ISSUANCE_CREATE, 54, MPTokenIssuanceCreate,
|
TRANSACTION(ttMPTOKEN_ISSUANCE_CREATE, 54, MPTokenIssuanceCreate,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -697,7 +697,7 @@ TRANSACTION(ttMPTOKEN_ISSUANCE_CREATE, 54, MPTokenIssuanceCreate,
|
|||||||
|
|
||||||
/** This transaction type destroys a MPTokensIssuance instance */
|
/** This transaction type destroys a MPTokensIssuance instance */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/MPT/MPTokenIssuanceDestroy.h>
|
# include <xrpl/tx/transactors/token/MPTokenIssuanceDestroy.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttMPTOKEN_ISSUANCE_DESTROY, 55, MPTokenIssuanceDestroy,
|
TRANSACTION(ttMPTOKEN_ISSUANCE_DESTROY, 55, MPTokenIssuanceDestroy,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -709,7 +709,7 @@ TRANSACTION(ttMPTOKEN_ISSUANCE_DESTROY, 55, MPTokenIssuanceDestroy,
|
|||||||
|
|
||||||
/** This transaction type sets flags on a MPTokensIssuance or MPToken instance */
|
/** This transaction type sets flags on a MPTokensIssuance or MPToken instance */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/MPT/MPTokenIssuanceSet.h>
|
# include <xrpl/tx/transactors/token/MPTokenIssuanceSet.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttMPTOKEN_ISSUANCE_SET, 56, MPTokenIssuanceSet,
|
TRANSACTION(ttMPTOKEN_ISSUANCE_SET, 56, MPTokenIssuanceSet,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -726,7 +726,7 @@ TRANSACTION(ttMPTOKEN_ISSUANCE_SET, 56, MPTokenIssuanceSet,
|
|||||||
|
|
||||||
/** This transaction type authorizes a MPToken instance */
|
/** This transaction type authorizes a MPToken instance */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/MPT/MPTokenAuthorize.h>
|
# include <xrpl/tx/transactors/token/MPTokenAuthorize.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttMPTOKEN_AUTHORIZE, 57, MPTokenAuthorize,
|
TRANSACTION(ttMPTOKEN_AUTHORIZE, 57, MPTokenAuthorize,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -739,7 +739,7 @@ TRANSACTION(ttMPTOKEN_AUTHORIZE, 57, MPTokenAuthorize,
|
|||||||
|
|
||||||
/** This transaction type create an Credential instance */
|
/** This transaction type create an Credential instance */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Credentials.h>
|
# include <xrpl/tx/transactors/credentials/Credentials.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttCREDENTIAL_CREATE, 58, CredentialCreate,
|
TRANSACTION(ttCREDENTIAL_CREATE, 58, CredentialCreate,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -775,7 +775,7 @@ TRANSACTION(ttCREDENTIAL_DELETE, 60, CredentialDelete,
|
|||||||
|
|
||||||
/** This transaction type modify a NFToken */
|
/** This transaction type modify a NFToken */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/NFT/NFTokenModify.h>
|
# include <xrpl/tx/transactors/nft/NFTokenModify.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttNFTOKEN_MODIFY, 61, NFTokenModify,
|
TRANSACTION(ttNFTOKEN_MODIFY, 61, NFTokenModify,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -789,7 +789,7 @@ TRANSACTION(ttNFTOKEN_MODIFY, 61, NFTokenModify,
|
|||||||
|
|
||||||
/** This transaction type creates or modifies a Permissioned Domain */
|
/** This transaction type creates or modifies a Permissioned Domain */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/PermissionedDomain/PermissionedDomainSet.h>
|
# include <xrpl/tx/transactors/permissioned_domain/PermissionedDomainSet.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttPERMISSIONED_DOMAIN_SET, 62, PermissionedDomainSet,
|
TRANSACTION(ttPERMISSIONED_DOMAIN_SET, 62, PermissionedDomainSet,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -802,7 +802,7 @@ TRANSACTION(ttPERMISSIONED_DOMAIN_SET, 62, PermissionedDomainSet,
|
|||||||
|
|
||||||
/** This transaction type deletes a Permissioned Domain */
|
/** This transaction type deletes a Permissioned Domain */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/PermissionedDomain/PermissionedDomainDelete.h>
|
# include <xrpl/tx/transactors/permissioned_domain/PermissionedDomainDelete.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttPERMISSIONED_DOMAIN_DELETE, 63, PermissionedDomainDelete,
|
TRANSACTION(ttPERMISSIONED_DOMAIN_DELETE, 63, PermissionedDomainDelete,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -814,7 +814,7 @@ TRANSACTION(ttPERMISSIONED_DOMAIN_DELETE, 63, PermissionedDomainDelete,
|
|||||||
|
|
||||||
/** This transaction type delegates authorized account specified permissions */
|
/** This transaction type delegates authorized account specified permissions */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Delegate/DelegateSet.h>
|
# include <xrpl/tx/transactors/delegate/DelegateSet.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttDELEGATE_SET, 64, DelegateSet,
|
TRANSACTION(ttDELEGATE_SET, 64, DelegateSet,
|
||||||
Delegation::notDelegable,
|
Delegation::notDelegable,
|
||||||
@@ -827,7 +827,7 @@ TRANSACTION(ttDELEGATE_SET, 64, DelegateSet,
|
|||||||
|
|
||||||
/** This transaction creates a single asset vault. */
|
/** This transaction creates a single asset vault. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Vault/VaultCreate.h>
|
# include <xrpl/tx/transactors/vault/VaultCreate.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttVAULT_CREATE, 65, VaultCreate,
|
TRANSACTION(ttVAULT_CREATE, 65, VaultCreate,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -845,7 +845,7 @@ TRANSACTION(ttVAULT_CREATE, 65, VaultCreate,
|
|||||||
|
|
||||||
/** This transaction updates a single asset vault. */
|
/** This transaction updates a single asset vault. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Vault/VaultSet.h>
|
# include <xrpl/tx/transactors/vault/VaultSet.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttVAULT_SET, 66, VaultSet,
|
TRANSACTION(ttVAULT_SET, 66, VaultSet,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -860,7 +860,7 @@ TRANSACTION(ttVAULT_SET, 66, VaultSet,
|
|||||||
|
|
||||||
/** This transaction deletes a single asset vault. */
|
/** This transaction deletes a single asset vault. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Vault/VaultDelete.h>
|
# include <xrpl/tx/transactors/vault/VaultDelete.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttVAULT_DELETE, 67, VaultDelete,
|
TRANSACTION(ttVAULT_DELETE, 67, VaultDelete,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -872,7 +872,7 @@ TRANSACTION(ttVAULT_DELETE, 67, VaultDelete,
|
|||||||
|
|
||||||
/** This transaction trades assets for shares with a vault. */
|
/** This transaction trades assets for shares with a vault. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Vault/VaultDeposit.h>
|
# include <xrpl/tx/transactors/vault/VaultDeposit.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttVAULT_DEPOSIT, 68, VaultDeposit,
|
TRANSACTION(ttVAULT_DEPOSIT, 68, VaultDeposit,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -885,7 +885,7 @@ TRANSACTION(ttVAULT_DEPOSIT, 68, VaultDeposit,
|
|||||||
|
|
||||||
/** This transaction trades shares for assets with a vault. */
|
/** This transaction trades shares for assets with a vault. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Vault/VaultWithdraw.h>
|
# include <xrpl/tx/transactors/vault/VaultWithdraw.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttVAULT_WITHDRAW, 69, VaultWithdraw,
|
TRANSACTION(ttVAULT_WITHDRAW, 69, VaultWithdraw,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -900,7 +900,7 @@ TRANSACTION(ttVAULT_WITHDRAW, 69, VaultWithdraw,
|
|||||||
|
|
||||||
/** This transaction claws back tokens from a vault. */
|
/** This transaction claws back tokens from a vault. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Vault/VaultClawback.h>
|
# include <xrpl/tx/transactors/vault/VaultClawback.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttVAULT_CLAWBACK, 70, VaultClawback,
|
TRANSACTION(ttVAULT_CLAWBACK, 70, VaultClawback,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -914,7 +914,7 @@ TRANSACTION(ttVAULT_CLAWBACK, 70, VaultClawback,
|
|||||||
|
|
||||||
/** This transaction type batches together transactions. */
|
/** This transaction type batches together transactions. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Batch.h>
|
# include <xrpl/tx/transactors/system/Batch.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttBATCH, 71, Batch,
|
TRANSACTION(ttBATCH, 71, Batch,
|
||||||
Delegation::notDelegable,
|
Delegation::notDelegable,
|
||||||
@@ -929,7 +929,7 @@ TRANSACTION(ttBATCH, 71, Batch,
|
|||||||
|
|
||||||
/** This transaction creates and updates a Loan Broker */
|
/** This transaction creates and updates a Loan Broker */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Lending/LoanBrokerSet.h>
|
# include <xrpl/tx/transactors/lending/LoanBrokerSet.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttLOAN_BROKER_SET, 74, LoanBrokerSet,
|
TRANSACTION(ttLOAN_BROKER_SET, 74, LoanBrokerSet,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -946,7 +946,7 @@ TRANSACTION(ttLOAN_BROKER_SET, 74, LoanBrokerSet,
|
|||||||
|
|
||||||
/** This transaction deletes a Loan Broker */
|
/** This transaction deletes a Loan Broker */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Lending/LoanBrokerDelete.h>
|
# include <xrpl/tx/transactors/lending/LoanBrokerDelete.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttLOAN_BROKER_DELETE, 75, LoanBrokerDelete,
|
TRANSACTION(ttLOAN_BROKER_DELETE, 75, LoanBrokerDelete,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -957,7 +957,7 @@ TRANSACTION(ttLOAN_BROKER_DELETE, 75, LoanBrokerDelete,
|
|||||||
|
|
||||||
/** This transaction deposits First Loss Capital into a Loan Broker */
|
/** This transaction deposits First Loss Capital into a Loan Broker */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Lending/LoanBrokerCoverDeposit.h>
|
# include <xrpl/tx/transactors/lending/LoanBrokerCoverDeposit.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttLOAN_BROKER_COVER_DEPOSIT, 76, LoanBrokerCoverDeposit,
|
TRANSACTION(ttLOAN_BROKER_COVER_DEPOSIT, 76, LoanBrokerCoverDeposit,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -969,7 +969,7 @@ TRANSACTION(ttLOAN_BROKER_COVER_DEPOSIT, 76, LoanBrokerCoverDeposit,
|
|||||||
|
|
||||||
/** This transaction withdraws First Loss Capital from a Loan Broker */
|
/** This transaction withdraws First Loss Capital from a Loan Broker */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Lending/LoanBrokerCoverWithdraw.h>
|
# include <xrpl/tx/transactors/lending/LoanBrokerCoverWithdraw.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttLOAN_BROKER_COVER_WITHDRAW, 77, LoanBrokerCoverWithdraw,
|
TRANSACTION(ttLOAN_BROKER_COVER_WITHDRAW, 77, LoanBrokerCoverWithdraw,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -984,7 +984,7 @@ TRANSACTION(ttLOAN_BROKER_COVER_WITHDRAW, 77, LoanBrokerCoverWithdraw,
|
|||||||
/** This transaction claws back First Loss Capital from a Loan Broker to
|
/** This transaction claws back First Loss Capital from a Loan Broker to
|
||||||
the issuer of the capital */
|
the issuer of the capital */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Lending/LoanBrokerCoverClawback.h>
|
# include <xrpl/tx/transactors/lending/LoanBrokerCoverClawback.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttLOAN_BROKER_COVER_CLAWBACK, 78, LoanBrokerCoverClawback,
|
TRANSACTION(ttLOAN_BROKER_COVER_CLAWBACK, 78, LoanBrokerCoverClawback,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -996,7 +996,7 @@ TRANSACTION(ttLOAN_BROKER_COVER_CLAWBACK, 78, LoanBrokerCoverClawback,
|
|||||||
|
|
||||||
/** This transaction creates a Loan */
|
/** This transaction creates a Loan */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Lending/LoanSet.h>
|
# include <xrpl/tx/transactors/lending/LoanSet.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttLOAN_SET, 80, LoanSet,
|
TRANSACTION(ttLOAN_SET, 80, LoanSet,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -1023,7 +1023,7 @@ TRANSACTION(ttLOAN_SET, 80, LoanSet,
|
|||||||
|
|
||||||
/** This transaction deletes an existing Loan */
|
/** This transaction deletes an existing Loan */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Lending/LoanDelete.h>
|
# include <xrpl/tx/transactors/lending/LoanDelete.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttLOAN_DELETE, 81, LoanDelete,
|
TRANSACTION(ttLOAN_DELETE, 81, LoanDelete,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -1034,7 +1034,7 @@ TRANSACTION(ttLOAN_DELETE, 81, LoanDelete,
|
|||||||
|
|
||||||
/** This transaction is used to change the delinquency status of an existing Loan */
|
/** This transaction is used to change the delinquency status of an existing Loan */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Lending/LoanManage.h>
|
# include <xrpl/tx/transactors/lending/LoanManage.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttLOAN_MANAGE, 82, LoanManage,
|
TRANSACTION(ttLOAN_MANAGE, 82, LoanManage,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -1048,7 +1048,7 @@ TRANSACTION(ttLOAN_MANAGE, 82, LoanManage,
|
|||||||
|
|
||||||
/** The Borrower uses this transaction to make a Payment on the Loan. */
|
/** The Borrower uses this transaction to make a Payment on the Loan. */
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Lending/LoanPay.h>
|
# include <xrpl/tx/transactors/lending/LoanPay.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttLOAN_PAY, 84, LoanPay,
|
TRANSACTION(ttLOAN_PAY, 84, LoanPay,
|
||||||
Delegation::delegable,
|
Delegation::delegable,
|
||||||
@@ -1063,7 +1063,7 @@ TRANSACTION(ttLOAN_PAY, 84, LoanPay,
|
|||||||
For details, see: https://xrpl.org/amendments.html
|
For details, see: https://xrpl.org/amendments.html
|
||||||
*/
|
*/
|
||||||
#if TRANSACTION_INCLUDE
|
#if TRANSACTION_INCLUDE
|
||||||
# include <xrpl/tx/transactors/Change.h>
|
# include <xrpl/tx/transactors/system/Change.h>
|
||||||
#endif
|
#endif
|
||||||
TRANSACTION(ttAMENDMENT, 100, EnableAmendment,
|
TRANSACTION(ttAMENDMENT, 100, EnableAmendment,
|
||||||
Delegation::notDelegable,
|
Delegation::notDelegable,
|
||||||
|
|||||||
@@ -10,8 +10,8 @@
|
|||||||
#include <xrpl/tx/paths/detail/FlatSets.h>
|
#include <xrpl/tx/paths/detail/FlatSets.h>
|
||||||
#include <xrpl/tx/paths/detail/FlowDebugInfo.h>
|
#include <xrpl/tx/paths/detail/FlowDebugInfo.h>
|
||||||
#include <xrpl/tx/paths/detail/Steps.h>
|
#include <xrpl/tx/paths/detail/Steps.h>
|
||||||
#include <xrpl/tx/transactors/AMM/AMMContext.h>
|
#include <xrpl/tx/transactors/dex/AMMContext.h>
|
||||||
#include <xrpl/tx/transactors/AMM/AMMHelpers.h>
|
#include <xrpl/tx/transactors/dex/AMMHelpers.h>
|
||||||
|
|
||||||
#include <boost/container/flat_set.hpp>
|
#include <boost/container/flat_set.hpp>
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <xrpl/tx/Transactor.h>
|
#include <xrpl/tx/Transactor.h>
|
||||||
#include <xrpl/tx/transactors/Lending/LendingHelpers.h>
|
#include <xrpl/tx/transactors/lending/LendingHelpers.h>
|
||||||
|
|
||||||
namespace xrpl {
|
namespace xrpl {
|
||||||
|
|
||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
#include <xrpl/protocol/nft.h>
|
#include <xrpl/protocol/nft.h>
|
||||||
#include <xrpl/tx/Transactor.h>
|
#include <xrpl/tx/Transactor.h>
|
||||||
#include <xrpl/tx/transactors/NFT/NFTokenUtils.h>
|
#include <xrpl/tx/transactors/nft/NFTokenUtils.h>
|
||||||
|
|
||||||
namespace xrpl {
|
namespace xrpl {
|
||||||
|
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user