Skip to content

Latest commit

 

History

History
23 lines (17 loc) · 1.14 KB

File metadata and controls

23 lines (17 loc) · 1.14 KB

Do CMake Right

Please write CMake scripts in a modern style, and follow the best practices in Effective Modern CMake.

Adding a new CMake target in Bolt

Adding a CMake target into Bolt engine,

Use the bolt_add_library command to add CMake target. It is a wrapper of the add_library command(see here. It will turn this target into an OBJECT target, and categorize and assemble it into the correct Bolt's sub-components.

Take this CMake target bolt_config for example:

# Step 1: turn bolt_config into an OBJECT target.
# Step 2: add bolt_config into bolt_engine sub-component according to its directory hierarchy.
bolt_add_library(bolt_config Config.cpp Context.cpp)

target_link_libraries(bolt_config PUBLIC Folly::folly)

References