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

Fix rbs_extension build on Windows #963

Closed
wants to merge 1 commit into from
Closed

Conversation

XrXr
Copy link
Member

@XrXr XrXr commented Apr 2, 2022

Version 2.3.0 is failing on Windows CI for ruby/ruby because
Visual Studio 2015 does not support the -Wold-style-definition flag.

Check for MSVC with mkmf using its predefined macro.


Testing upstream at ruby/ruby#5752

Version 2.3.0 is [failing] on Windows CI for ruby/ruby because
Visual Studio 2015 does not support the -Wold-style-definition flag.

Check for MSVC with mkmf using its predefined [macro].

[macro]: https://docs.microsoft.com/en-us/cpp/preprocessor/predefined-macros?view=msvc-140
[failing]: https://ci.appveyor.com/project/ruby/ruby/builds/43108024/job/lqdka0uxpqbudah9#L2861
@@ -1,4 +1,4 @@
require 'mkmf'
$INCFLAGS << " -I$(top_srcdir)" if $extmk
$CFLAGS += " -std=c99 -Wold-style-definition"
$CFLAGS += " -std=c99 -Wold-style-definition" unless have_macro('_MSC_VER')
Copy link
Member

@nobu nobu Apr 3, 2022

Choose a reason for hiding this comment

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

Not all compilers other than MSVC accept gcc options.

Suggested change
$CFLAGS += " -std=c99 -Wold-style-definition" unless have_macro('_MSC_VER')
append_cflags(%w"-std=c99 -Wold-style-definition")

@soutaro
Copy link
Member

soutaro commented Apr 4, 2022

Thank you @XrXr! Closing this PR since it's fixed in #964. 🙇‍♂️

@soutaro soutaro closed this Apr 4, 2022
@XrXr XrXr deleted the fix-windows-build branch April 4, 2022 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants