瀏覽代碼

Make clang with msvc abi work.

MeyerFabian 5 年之前
父節點
當前提交
a19e4e4112
共有 2 個文件被更改,包括 8 次插入2 次删除
  1. 7 1
      code/AssetLib/Blender/BlenderTessellator.cpp
  2. 1 1
      code/CMakeLists.txt

+ 7 - 1
code/AssetLib/Blender/BlenderTessellator.cpp

@@ -386,7 +386,14 @@ void BlenderTessellatorP2T::ReferencePoints( std::vector< Blender::PointP2T >& p
 // ------------------------------------------------------------------------------------------------
 inline PointP2T& BlenderTessellatorP2T::GetActualPointStructure( p2t::Point& point ) const
 {
+#if defined __clang__
+#    pragma clang diagnostic push
+#    pragma clang diagnostic ignored "-Winvalid-offsetof"
+#endif // __clang__
     unsigned int pointOffset = offsetof( PointP2T, point2D );
+#if defined __clang__
+#    pragma clang diagnostic pop
+#endif
     PointP2T& pointStruct = *reinterpret_cast< PointP2T* >( reinterpret_cast< char* >( &point ) - pointOffset );
     if ( pointStruct.magic != static_cast<int>( BLEND_TESS_MAGIC ) )
     {
@@ -394,7 +401,6 @@ inline PointP2T& BlenderTessellatorP2T::GetActualPointStructure( p2t::Point& poi
     }
     return pointStruct;
 }
-
 // ------------------------------------------------------------------------------------------------
 void BlenderTessellatorP2T::MakeFacesFromTriangles( std::vector< p2t::Triangle* >& triangles ) const
 {

+ 1 - 1
code/CMakeLists.txt

@@ -1065,7 +1065,7 @@ endif()
 
 ADD_DEFINITIONS( -DASSIMP_BUILD_DLL_EXPORT )
 
-if ( MSVC )
+IF( MSVC OR "${CMAKE_CXX_SIMULATE_ID}" MATCHES "MSVC") # clang with MSVC ABI
   ADD_DEFINITIONS( -D_SCL_SECURE_NO_WARNINGS )
   ADD_DEFINITIONS( -D_CRT_SECURE_NO_WARNINGS )
 endif ()