Fix Windows build: CMake profile matching and missing system libraries#216
Open
TonyMarkham wants to merge 1 commit intobschwind:mainfrom
Open
Fix Windows build: CMake profile matching and missing system libraries#216TonyMarkham wants to merge 1 commit intobschwind:mainfrom
TonyMarkham wants to merge 1 commit intobschwind:mainfrom
Conversation
- Fix CMake profile to match Cargo's PROFILE env var (debug/release) - Add missing Windows system libraries (advapi32, gdi32, shell32, comdlg32) - Resolves build errors on Windows with MSVC toolchain
TonyMarkham
added a commit
to TonyMarkham/opencascade-interop-demo
that referenced
this pull request
Oct 29, 2025
- Switch from crates.io to Git fork of opencascade-rs (PR #216) - Add comprehensive README with architecture and usage documentation - Update .gitignore to exclude build artifacts (dist/, .cargo/) - Update Cargo.lock to reflect new Git dependency Fixes Windows build issues (CMake profile matching and missing system libraries). PR submitted upstream: bschwind/opencascade-rs#216
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.
Problem
Building on Windows with MSVC fails with two issues:
cargo build(debug mode)SetFileSecurityW,OpenProcessToken,RegOpenKeyW)Solution
crates/occt-sys/src/lib.rs: ReadPROFILEenvironment variable from Cargo and pass the correct profile to CMake (Debug vs Release)crates/opencascade-sys/build.rs: Add missing Windows system libraries:advapi32.lib- Security and registry APIsgdi32.lib- Graphics Device Interfaceshell32.lib- Windows Shell APIcomdlg32.lib- Common Dialog BoxTesting
cargo build --releasecargo build(debug)Notes
This appears to be Windows-specific as Linux builds work fine (debug symbols are embedded in binaries, and these Windows libraries aren't needed).
Fixes the build issues reported by Windows users.