Skip to content
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

Refactor default_compile_flags defaults for windows cc toolchain #22765

Open
pjreiniger opened this issue Jun 17, 2024 · 1 comment
Open

Refactor default_compile_flags defaults for windows cc toolchain #22765

pjreiniger opened this issue Jun 17, 2024 · 1 comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-CPP Issues for C++ rules type: feature request

Comments

@pjreiniger
Copy link

pjreiniger commented Jun 17, 2024

Description of the feature request:

The default compiler flags in the windows cc toolchain automatically inserts command line arguments that cannot be disabled. The one that is causing my heartache is "/D_WIN32_WINNT=0x0601", which tells the compiler to target windows 7 features.

Which category does this issue belong to?

C++ Rules

What underlying problem are you trying to solve with this feature?

I maintain a bazel-ified fork of an open source project that relies on a feature added in windows 8.

{
#ifdef _WIN32
  FILETIME ft;
  GetSystemTimePreciseAsFileTime(&ft);
#else
....
#endif
}

It formerly used GetSystemTimeAsFileTime, which would compile, but then it was updated to get more precise timing information, and due to the non-configurable WIN32_WINNT bazel adds by default, the code no longer compiles without doing some hacks

Which operating system are you running Bazel on?

Windows 11

What is the output of bazel info release?

release 7.1.1

If bazel info release returns development version or (@non-git), tell us how you built Bazel.

No response

What's the output of git remote get-url origin; git rev-parse HEAD ?

git@github.com:bzlmodRio/allwpilib.git
b695fc8ded87127c84067d3c8ec5d7d9a122c52f

Have you found anything relevant by searching the web?

#12737 describes a similar complaint. In the issue, a PR of #14735 is mentioned, but then I get this issue.

In the meantime, I can add a copt to undefine it with U_WIN32_WINNT, but it yields a message like this for each compilation step
cl : Command line warning D9025 : overriding '/D_WIN32_WINNT=0x0601' with '/U_WIN32_WINNT'

Any other information, logs, or outputs that you want to share?

No response

@github-actions github-actions bot added the team-Rules-CPP Issues for C++ rules label Jun 17, 2024
@comius comius added P3 We're not considering working on this, but happy to review a PR. (No assignee) and removed untriaged labels Jul 5, 2024
@dpvdberg
Copy link
Contributor

I'm experiencing the same issue, where NOMINMAX is defined by default, but I need to compile a library where this define cannot be set.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P3 We're not considering working on this, but happy to review a PR. (No assignee) team-Rules-CPP Issues for C++ rules type: feature request
Projects
None yet
Development

No branches or pull requests

6 participants