Skip to content

Conversation

@proller
Copy link
Contributor

@proller proller commented Apr 6, 2016

No description provided.

@redboltz
Copy link
Contributor

@proller, thank you for sending the PR. I think that -Wno-mismatched-tags is not related to MSGPACK_ENABLE_SHARED. When -Wno-mismatched-tags is given, the following code doesn't make the warining "warning: 'foo' defined as a struct here but previously declared as a class [-Wmismatched-tags]".

class foo;
struct foo {};

See:
http://melpon.org/wandbox/permlink/Agqg5dsVbGMYERvW (with -Wno-mismatched-tags )
http://melpon.org/wandbox/permlink/da6IyphldlxKWZ4Y (without -Wno-mismatched-tags )

@proller
Copy link
Contributor Author

proller commented Apr 10, 2016

i dont change warning options, i just add condition IF (MSGPACK_ENABLE_SHARED)
because if MSGPACK_ENABLE_SHARED = false
then
TARGET msgpackc
failed because here is no msgpackc

@redboltz
Copy link
Contributor

I understand. The reason that I got confused is the option -Wno-mismatched-tags is only applied to msgpackc. It should be applied msgpackc-static too. It's not your pull requests problem. I will add the code that adds -Wno-mismatched-tags to msgpackc-static as follows and then merge the pull request.

 IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
 -    SET_PROPERTY (TARGET msgpackc APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
 +    IF (MSGPACK_ENABLE_SHARED)
 +        SET_PROPERTY (TARGET msgpackc APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
 +    ENDIF ()
 +    SET_PROPERTY (TARGET msgpackc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
  ENDIF ()

  IF ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
      IF ((CMAKE_CXX_COMPILER_VERSION VERSION_GREATER ${GNUCXX_NO_MISMATCHED_TAGS_SUPPORT_VERSION}) OR
          (CMAKE_CXX_COMPILER_VERSION VERSION_EQUAL   ${GNUCXX_NO_MISMATCHED_TAGS_SUPPORT_VERSION}))
 -    SET_PROPERTY (TARGET msgpackc APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
 +        IF (MSGPACK_ENABLE_SHARED)
 +            SET_PROPERTY (TARGET msgpackc APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
 +        ENDIF ()
 +        SET_PROPERTY (TARGET msgpackc-static APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-mismatched-tags")
      ENDIF ()
  ENDIF ()

@redboltz redboltz merged commit bf7bc19 into msgpack:master Apr 14, 2016
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