Skip to content

[microsoft-signalr] Fix build error on Linux#14872

Merged
BillyONeal merged 3 commits intomicrosoft:masterfrom
NancyLi1013:dev/NancyLi/fix-microsoft-signalr
Dec 3, 2020
Merged

[microsoft-signalr] Fix build error on Linux#14872
BillyONeal merged 3 commits intomicrosoft:masterfrom
NancyLi1013:dev/NancyLi/fix-microsoft-signalr

Conversation

@NancyLi1013
Copy link
Copy Markdown
Contributor

@NancyLi1013 NancyLi1013 commented Dec 1, 2020

Describe the pull request

When building on Linux, it will fail due to this error:

error: cannot use typeid with -fno-rtti

There are two reasons to fix this problem:

  1. -fno-rtti is only for non windows Platform.
  2. typeid is an RTTI-feature. So turning off RTTI (-fno-rtti) also disables features like typeid.

-fno-rtti should not be added here https://github.com/aspnet/SignalR-Client-Cpp/blob/master/src/signalrclient/CMakeLists.txt#L63.

So I make a patch to remove these codes.

    # GCC on OSX has a bug with exceptions and no-rtti that can cause crashes
    if(NOT APPLE)
        target_compile_options(signalrclient PRIVATE -fno-rtti)
    endif()

Please see the references:

[1] https://scc.ustc.edu.cn/zlsc/tc4600/intel/2017.0.098/compiler_c/common/core/GUID-BA6071E9-2409-4118-84B5-8E1ABE0C2B72.html
[2] https://stackoverflow.com/questions/8723702/error-cannot-use-typeid-with-fno-rtti

Note: No need to test features.

@NancyLi1013 NancyLi1013 added category:port-bug The issue is with a library, which is something the port should already support info:internal labels Dec 1, 2020
@PhoebeHui PhoebeHui added the info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this. label Dec 2, 2020
@BillyONeal BillyONeal merged commit ecba240 into microsoft:master Dec 3, 2020
@BillyONeal
Copy link
Copy Markdown
Member

Thanks for your contribution!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

category:port-bug The issue is with a library, which is something the port should already support info:needs-maintainer-attention Lets the current 'on rotation' vcpkg maintainer know they need to look at this.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[microsoft-signalr] Build failure

4 participants