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

Configure feature test macros in meson #2812

Closed
wants to merge 1 commit into from
Closed

Conversation

rom1v
Copy link
Collaborator

@rom1v rom1v commented Nov 20, 2021

Use add_global_arguments() like in PR #2807 add_project_arguments().

However, the documentation says:

Compilation tests that are run as part of your project configuration do not use these flags. The reason for that is that you may need to run a test compile with and without a given flag to determine your build setup. For this reason tests do not use these global arguments.

We could like these definitions to be set in tests too. But in practice, they are correctly set on my machine 🤔

An alternative could be to add the flags (still from Meson) to the config.h generated file. I don't know what is better. Any idea?

@mqiezi Could you confirm that this does not cause a regression for #1960?

cc @RipleyTom

@rom1v rom1v force-pushed the feature_test_macros branch from 5fd547f to 95769eb Compare November 20, 2021 22:09
@RipleyTom
Copy link
Contributor

Yes add_project_arguments seems to be the appropriate one, sorry I never edited a meson build before.
Shouldn't the _WIN32_WINNT and WINVER also be defined when crosscompiling?

@rom1v
Copy link
Collaborator Author

rom1v commented Nov 20, 2021

Shouldn't the _WIN32_WINNT and WINVER also be defined when crosscompiling?

host_machine == "windows" when cross-compiling:

The tl/dr summary is the following: if you are doing regular cross compilation, you only care about build_machine and host_machine. Just ignore target_machine altogether and you will be correct 99% of the time.

@rom1v
Copy link
Collaborator Author

rom1v commented Nov 21, 2021

Superseded by #2813.

@rom1v rom1v closed this Nov 21, 2021
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.

2 participants