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

feat: add c99 mode in build.rs for issue #33 #34

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pcre2-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ fn main() {
{
builder.debug(true);
}
// We enable C99 mode when compiling PCRE2. Because without it, build errors
// have been observed in some environments. It's not totally clear why this
// only occurs in some environments, but one possible guess is that this
// supports older compilers. Either way, there is still some uncertainty
// about why enabling this flag is necessary. See #33 for more details.
builder.flag("-std=c99");
Copy link
Contributor

@carenas carenas Sep 27, 2023

Choose a reason for hiding this comment

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

gcc < 5 defaults to C89, so it will fail to build as described in PCRE2Project/pcre2#163

builder.compile("libpcre2.a");
}

Expand Down