Avoid code duplication by making BOOST_TEST_DYN_LINK detection into a CMake
module.
Details
Details
- Reviewers
deadalnix Fabien jasonbcox - Group Reviewers
Restricted Owners Package (Owns No Changed Paths) Restricted Project - Commits
- rSTAGINGe06c742b1b12: Added CMake function to detect BOOST_TEST_DYN_LINK
rABCe06c742b1b12: Added CMake function to detect BOOST_TEST_DYN_LINK
ninja check
Diff Detail
Diff Detail
- Repository
- rABC Bitcoin ABC
- Branch
- BoostDynFunction
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 8080 Build 14150: Bitcoin ABC Buildbot (legacy) Build 14149: arc lint + arc unit
Event Timeline
Comment Actions
This seems to me that it is doing half of the work:
- You set a boost library as a requirement, but you don't search for it
- You add a boost unit test specific definition, but you don't link the executable to the boost library
- Intended that this is test specific, why not put it to the TestSuite.cmake module ? The proposed module, by its name and content will likely never contain anything more than this very specific function.
cmake/modules/DetectBoostDynLink.cmake | ||
---|---|---|
3 ↗ | (On Diff #14063) | You should make it a function so that CMAKE_REQUIRED_LIBRARIES remains scoped. |
14 ↗ | (On Diff #14063) | This is missing include(CheckCXXSourceCompiles) |
Comment Actions
Moved function to TestSuite.cmake. Function now also handles searching for the boost package and linking the library to the executable.
Comment Actions
Function now also adds the unit test files to the test suite by calling add_test_to_suite.