Skip to content

Bill-hbrhbr/ystdlib-cpp

 
 

Repository files navigation

ystdlib-cpp

An open-source C++ library developed and used at YScope.

Usage

Via CMake's add_subdirectory()

Clone ystdlib-cpp into your project. Then, in your project's CMakeLists.txt, add the following:

# Set `YSTDLIB_CPP_BUILD_TESTING` to an accepted `FALSE` class value to skip building unit tests.
# option(YSTDLIB_CPP_BUILD_TESTING "" OFF)
add_subdirectory(/path/to/ystdlib-cpp EXCLUDE_FROM_ALL)
target_link_libraries(<target_name> <link_options>
    ystdlib::<lib_1> ystdlib::<lib_2> ... ystdlib::<lib_N>
    # other libs...
)

Ensure that ystdlib-cpp is either within a subdirectory of the folder containing CMakeLists.txt or at the same level.

Contributing

Follow the steps below to develop and contribute to the project.

Requirements

  • Python 3.10 or higher
  • Task 3.40.0 or higher

Set up

Initialize and update submodules:

git submodule update --init --recursive

If you want to open the project in an IDE, run the following command to install any necessary dependencies from source:

task deps:install-all

Building

To build all targets:

task build:all

To build an executable containing all unit tests:

task build:unit-test-all

To build an executable containing a single library's unit tests:

task build:unit-test-<lib_name>

Testing

To build and run all unit tests:

task test-all

To build and run unit tests for a specific library:

task test-<lib_name>

When generating a testing target, the CMake variable BUILD_TESTING is followed (unless overruled by setting YSTDLIB_CPP_BUILD_TESTING to false). By default, if built as a top-level project, BUILD_TESTING is set to true and unit tests are built.

Linting

Before submitting a pull request, ensure you’ve run the linting commands below and have fixed all violations and suppressed all warnings.

To run all linting checks:

task lint:check

To run all linting checks AND fix some violations:

task lint:fix

To see how to run a subset of linters for a specific file type:

task -a

Look for all tasks under the lint namespace (identified by the lint: prefix).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 78.8%
  • CMake 21.2%