cmake: set /EHsc for MSVC — fixes boost::throw_exception LNK2019 (all Windows release builds) - #707
Merged
Merged
Conversation
… Windows builds) The pinned Conan windows-msvc.profile (#702) does not carry an exception flag, and Conan's toolchain does not guarantee CMake's default /EHsc. Without it, MSVC compiles with exceptions disabled (warning C4530), so Boost's inline boost::throw_exception (pulled in by asio/log/signals2) becomes an unresolved external -> LNK2019/LNK1120. This failed the CI boost_sentinel gate first, so ALL FIVE coins' Windows x86_64 release cells died before their own build ran. Set /EHsc globally for MSVC so every target (coin binaries + boost_sentinel) compiles with unwind semantics. Linux/macOS unaffected. Restores Windows packaging for ltc/btc/dgb/dash/bch.
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.
The bug
The v0.2.1 release build (tag
v0.2.1@884a0aeb) produced all 5 coins on Linux + macOS-universal, but all 5 Windows x86_64 cells FAILED — including LTC, which built fine before. Root cause (from the ltc Windows log):The pinned Conan
windows-msvc.profile(#702) carries no exception flag, and Conan's toolchain doesn't guarantee CMake's default/EHsc. With exceptions disabled, Boost's inlineboost::throw_exception(pulled in via asio/log/signals2) becomes an unresolved external. This killed theboost_sentinelgate first (it linksBoost::log), so every coin's Windows cell died before its own build even ran — hence all 5 failing identically.The fix
Set
/EHscexplicitly for all MSVC targets in the root CMakeLists (coin binaries + the CIboost_sentinel). One line, MSVC-only; Linux/macOS untouched.Verification path
Not workflow-scope — mergeable once green. After merge I'll re-tag
v0.2.1to the fixed master and re-run the release build; expect the 5 Windows packages to join the already-green Linux + macOS set for the complete all-coin v0.2.1.