Skip to content

Remove "-std=c++11" and "-fvisibility=hidden" if compilet with MSVC #97

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

cednik
Copy link
Collaborator

@cednik cednik commented Aug 7, 2025

Issue #54 is marked as closed, but warnings, mentioned in the original post, are still coming when compiling with MSVC.
This should solve it.

Copy link
Owner

@tbenthompson tbenthompson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks! this is great!

left one comment for an improvement but i hit approve since i don't think it's blocking.

cfg["compiler_args"] = ["-std=c++11", "-fvisibility=hidden"] + cfg["compiler_args"]
prefix_args = ["-std=c++11", "-fvisibility=hidden"]
# MSVC compiler do not support "-std=c++11" nor "-fvisibility=hidden"
if os.name == "nt":
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this feels a little awkward. what's the motivation for building the list and then remove entries versus just pushing the list inside the conditional?

if os.name == 'nt' and ...
    prefix_args = []
else:
    prefix_args = ["-std=c++11", "-fvisibility=hidden"]

@tbenthompson
Copy link
Owner

i also just added you as a maintainer on cppimport. =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants