Configuration - Fix BUILD_SOVERSION_NUMBERS=0 not disabling versioned dylib symlinks#1199
Draft
angelobartolome wants to merge 1 commit intoOpen-Cascade-SAS:masterfrom
Draft
Conversation
… dylib symlinks Two issues prevented BUILD_SOVERSION_NUMBERS=0 from working: 1. CMakeLists.txt used `if (NOT BUILD_SOVERSION_NUMBERS)` which evaluates true when the value is 0 (CMake treats 0 as falsy), silently overriding the user's setting back to 2 on non-Windows platforms. Fixed by using `NOT DEFINED` / `STREQUAL ""` to only apply the default when the variable is genuinely absent from the cache. 2. adm/cmake/occt_toolkit.cmake set the VERSION target property unconditionally, so even with SOVERSION cleared, CMake still generated versioned filenames (e.g. libTKBin.7.9.2.dylib). Fixed by making VERSION conditional on BUILD_SOVERSION_NUMBERS > 0. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Member
|
Dear @angelobartolome Thank you for your patch. To proceed with integration, please complete signing CLA process: In case if you already have signed CLA, please share ID that OCCT team shared with your by email after accepting of CLA. |
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.
Summary
Setting
-DBUILD_SOVERSION_NUMBERS=0had no effect on macOS (and other non-Windows/Android/Emscripten platforms) due to two bugs:CMakeLists.txt: The guard conditionif (NOT BUILD_SOVERSION_NUMBERS)evaluates totruewhen the value is0, because CMake treats0as falsy. This silently overrode the user's explicit0back to2on every cmake run. Fixed by usingNOT DEFINED ... OR STREQUAL ""to only apply the platform default when the variable is genuinely absent from the cache.adm/cmake/occt_toolkit.cmake: TheVERSIONtarget property was set unconditionally regardless ofBUILD_SOVERSION_NUMBERS. On macOS, settingVERSIONalone is sufficient for CMake to generate versioned filenames (e.g.libTKBin.7.9.2.dylib) and symlinks, even withSOVERSIONcleared. Fixed by makingVERSIONconditional onBUILD_SOVERSION_NUMBERS > 0.Test plan
-DBUILD_SOVERSION_NUMBERS=0and verify only unversioned.dylibfiles are produced (nolibTK*.7*.dylibvariants)-DBUILD_SOVERSION_NUMBERS=2(default on macOS/Linux) and verify versioned symlinks are still generated as before0is still applied when the variable is not explicitly set🤖 Generated with Claude Code