-
Notifications
You must be signed in to change notification settings - Fork 19
this and that #178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
this and that #178
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,13 +7,15 @@ | |
| # Official repository: https://github.com/cppalliance/capy | ||
| # | ||
|
|
||
| include(FetchContent) | ||
| FetchContent_Declare(mimalloc | ||
| GIT_REPOSITORY https://github.com/microsoft/mimalloc | ||
| GIT_TAG v2.2.7 | ||
| GIT_SHALLOW TRUE) | ||
| set(MI_BUILD_TESTS OFF CACHE BOOL "Disable mimalloc tests" FORCE) | ||
| FetchContent_MakeAvailable(mimalloc) | ||
| if(BUILD_SHARED_LIBS) | ||
| include(FetchContent) | ||
| FetchContent_Declare(mimalloc | ||
| GIT_REPOSITORY https://github.com/microsoft/mimalloc | ||
| GIT_TAG v2.2.7 | ||
| GIT_SHALLOW TRUE) | ||
| set(MI_BUILD_TESTS OFF CACHE BOOL "Disable mimalloc tests" FORCE) | ||
| FetchContent_MakeAvailable(mimalloc) | ||
| endif() | ||
|
Comment on lines
+10
to
+18
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Search for BUILD_SHARED_LIBS usage in CMakeLists.txt files
rg -n "BUILD_SHARED_LIBS" --include="CMakeLists.txt" -A2 -B2Repository: cppalliance/capy Length of output: 501 🏁 Script executed: #!/bin/bash
# Read the full example/allocation/CMakeLists.txt file to understand context
cat example/allocation/CMakeLists.txtRepository: cppalliance/capy Length of output: 1186 🏁 Script executed: #!/bin/bash
# Search for mimalloc-related configuration or comments
rg -n "mimalloc" --include="CMakeLists.txt" -B2 -A2Repository: cppalliance/capy Length of output: 501 🏁 Script executed: #!/bin/bash
# Search for BUILD_SHARED_LIBS patterns in CMakeLists.txt files with corrected syntax
fd CMakeLists.txt -x rg "BUILD_SHARED_LIBS" {} -B2 -A2Repository: cppalliance/capy Length of output: 633 🏁 Script executed: #!/bin/bash
# Check the root CMakeLists.txt for any related configuration
cat CMakeLists.txtRepository: cppalliance/capy Length of output: 4087 🏁 Script executed: #!/bin/bash
# Search for any comments or documentation about allocator strategy
rg "mimalloc" -B3 -A3Repository: cppalliance/capy Length of output: 5915 Add clarifying comment explaining the The mimalloc setup (lines 10–18) and linking of Add a comment clarifying the design intent: e.g., whether this avoids ODR/allocator-instance issues when Boost::capy is shared, or whether the condition should be inverted to 🤖 Prompt for AI Agents |
||
|
|
||
| file(GLOB_RECURSE PFILES CONFIGURE_DEPENDS *.cpp *.hpp | ||
| CMakeLists.txt | ||
|
|
@@ -26,6 +28,9 @@ add_executable(capy_example_allocation ${PFILES}) | |
| set_property(TARGET capy_example_allocation | ||
| PROPERTY FOLDER "examples") | ||
|
|
||
| target_link_libraries(capy_example_allocation | ||
| Boost::capy | ||
| mimalloc-static) | ||
| target_link_libraries(capy_example_allocation Boost::capy) | ||
|
|
||
| if(BUILD_SHARED_LIBS) | ||
| target_link_libraries(capy_example_allocation mimalloc-static) | ||
| target_compile_definitions(capy_example_allocation PRIVATE BOOST_CAPY_HAS_MIMALLOC=1) | ||
| endif() | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🏁 Script executed:
fd -e txt CMakeLists.txt --exec grep -l -i "asio\|Boost::asio" {}Repository: cppalliance/capy
Length of output: 158
🏁 Script executed:
Repository: cppalliance/capy
Length of output: 1360
🏁 Script executed:
Repository: cppalliance/capy
Length of output: 1306
🏁 Script executed:
Repository: cppalliance/capy
Length of output: 840
🏁 Script executed:
Repository: cppalliance/capy
Length of output: 42
Implicit Boost::asio availability dependency is not enforced
The comment states tests depend on examples being built first to make
Boost::asioavailable, but both are independently guarded. IfBOOST_CAPY_BUILD_EXAMPLES=OFFandBOOST_CAPY_BUILD_TESTS=ON(a common CI configuration), tests will be configured withoutBoost::asio, causing a silent failure—tests compile but the conditional link againstBoost::asio(in test/unit/CMakeLists.txt) is skipped since the target is never created.Consider either:
Boost::asiodiscovery into the testCMakeLists.txt(or the root) rather than relying on examples as a side-effect.🛡️ Suggested guard
🤖 Prompt for AI Agents