Repository navigation
Fix CMake options being forced in the cache - #268
Merged
Merged
Conversation
- Default IPC_TOOLKIT_BUILD_TESTS to ON only at the top level instead of forcing it and IPC_TOOLKIT_BUILD_PYTHON OFF in a parent's cache - Shadow IPC_TOOLKIT_WITH_SIMD with a normal variable when SIMD is not found - Set BUILD_SHARED_LIBS as a function-local variable when building oneTBB - Fall back to a CPU build when CUDA is requested but no compiler is found Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #268 +/- ##
==========================================
- Coverage 96.92% 96.92% -0.01%
==========================================
Files 194 194
Lines 17349 17348 -1
Branches 943 943
==========================================
- Hits 16816 16815 -1
Misses 533 533
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
2 of 10 tasks
3 of 11 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Replaces the
CACHE ... FORCEoverrides in the CMake configuration with option defaults and normal-variable shadowing, touching the option setup, the SIMD and CUDA fallbacks, and the oneTBB recipe.IPC_TOOLKIT_BUILD_TESTSnow defaults to${IPC_TOOLKIT_TOPLEVEL_PROJECT}andIPC_TOOLKIT_BUILD_PYTHONtoOFF, replacing theif/elsethat forced bothOFFin the cache.IPC_TOOLKIT_WITH_SIMDwith a normal variable whenfind_package(SIMD)fails.IPC_TOOLKIT_WITH_CUDAis on but no CUDA compiler is found, warns and builds without CUDA instead of failing inenable_language(CUDA).BUILD_SHARED_LIBSas a normal variable insideonetbb_import_target(), replacing thepush_variable/pop_variablemacros (−25 lines).Impact:
-DIPC_TOOLKIT_WITH_SIMD=ONis no longer overwritten. The fallback now lasts one configure, rather than keeping the optionOFFin the build directory after SIMD becomes available.Behavior change
IPC_TOOLKIT_BUILD_TESTSandIPC_TOOLKIT_BUILD_PYTHONwhen adding IPC Toolkit as a subdirectory. The defaults are unchanged (bothOFF).Why the oneTBB change is more than style
CACHE PATH ... FORCEchanged the type of theBUILD_SHARED_LIBScache entry fromBOOLtoPATH.NEW, it had no effect when the caller already had a normalBUILD_SHARED_LIBS: the child scope kept seeing the caller's value, soTBB_PREFER_STATIC=ONcould be ignored. Reproduced with a stub subdirectory.add_subdirectoryinherits the value.Type of change
How Has This Been Tested?
CMake configure checks only. No build or test run; CI covers that.
-DIPC_TOOLKIT_BUILD_TESTS=ON: oneTBB is configured aslibtbb.a, andBUILD_SHARED_LIBSis not left in the cache.-DSIMD_CXX_FLAGS=: prints the warning,IPC_TOOLKIT_WITH_SIMDstaysONin the cache, andconfig.hppleaves it undefined.BUILD_SHARED_LIBS ON(withIPC_TOOLKIT_WITH_ABSEIL=OFF, since Abseil can't build shared on macOS):tbbis aSTATIC_LIBRARY, the parent's value is unchanged, and tests and Python default toOFF.Test Configuration:
Checklist