-D USE_VTK=ON `
-D USE_TBB=ON `
-D USE_RAPIDJSON=ON `
- -D USE_OPENGL=ON ..
+ -D USE_OPENGL=ON `
+ -D CMAKE_CXX_FLAGS="/W4 /WX" `
+ -D CMAKE_C_FLAGS="/W4 /WX" ..
shell: pwsh
- name: Build OCCT
-D USE_VTK=OFF `
-D USE_TBB=ON `
-D USE_RAPIDJSON=ON `
- -D USE_OPENGL=ON ..
+ -D USE_OPENGL=ON `
+ -D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra -Wno-unknown-warning-option" `
+ -D CMAKE_C_FLAGS="-Werror -Wall -Wextra -Wno-unknown-warning-option" ..
shell: pwsh
- name: Build OCCT
-D USE_DRACO=ON \
-D USE_FREETYPE=ON \
-D USE_OPENGL=ON \
- -D USE_FREEIMAGE=ON ..
+ -D USE_FREEIMAGE=ON \
+ -D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra" \
+ -D CMAKE_C_FLAGS="-Werror -Wall -Wextra" ..
- name: Build OCCT
run: |
-D USE_DRACO=ON \
-D USE_FREETYPE=ON \
-D USE_OPENGL=ON \
- -D USE_FREEIMAGE=ON ..
+ -D USE_FREEIMAGE=ON \
+ -D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra" \
+ -D CMAKE_C_FLAGS="-Werror -Wall -Wextra" ..
- name: Build OCCT
run: |
-D USE_VTK=ON \
-D USE_TBB=OFF \
-D USE_RAPIDJSON=ON \
- -D USE_OPENGL=ON ..
+ -D USE_OPENGL=ON \
+ -D CMAKE_CXX_FLAGS="-Werror -Wall -Wextra" \
+ -D CMAKE_C_FLAGS="-Werror -Wall -Wextra" ..
- name: Build OCCT
run: |
else()
add_definitions (-D_CRT_SECURE_NO_WARNINGS -D_CRT_NONSTDC_NO_DEPRECATE)
endif()
+ if (APPLE)
+ set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-deprecated-declarations")
+ set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-deprecated-declarations")
+ endif()
add_definitions(-DOCC_CONVERT_SIGNALS)
endif()
# Link-Time Code Generation(LTCG) is requared for Whole Program Optimisation(GL)
set(CMAKE_EXE_LINKER_FLAGS_RELEASE "${CMAKE_EXE_LINKER_FLAGS_RELEASE} -flto")
- set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -flto -Wl,--gc-sections")
- set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -flto -Wl,--gc-sections")
- set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -flto -Wl,--gc-sections")
+ set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -flto")
+ set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -flto")
+ set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -flto")
+ if (NOT WIN32)
+ set(CMAKE_SHARED_LINKER_FLAGS_RELEASE "${CMAKE_SHARED_LINKER_FLAGS_RELEASE} -Wl,--gc-sections")
+ set(CMAKE_STATIC_LINKER_FLAGS_RELEASE "${CMAKE_STATIC_LINKER_FLAGS_RELEASE} -Wl,--gc-sections")
+ set(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -Wl,--gc-sections")
+ endif()
endif()
if (CMAKE_CXX_COMPILER_ID MATCHES "[Cc][Ll][Aa][Nn][Gg]")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wshorten-64-to-32")
# CLang can be used with both libstdc++ and libc++, however on OS X libstdc++ is outdated.
set (CMAKE_CXX_FLAGS "-stdlib=libc++ ${CMAKE_CXX_FLAGS}")
endif()
- # Optimize size of binaries
- set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
+ if (NOT WIN32)
+ # Optimize size of binaries
+ set (CMAKE_SHARED_LINKER_FLAGS_RELEASE "-Wl,-s ${CMAKE_SHARED_LINKER_FLAGS_RELEASE}")
+ endif()
endif()
if(MINGW)
add_definitions(-D_WIN32_WINNT=0x0601)
# workaround bugs in mingw with vtable export
set (CMAKE_SHARED_LINKER_FLAGS "-Wl,--export-all-symbols")
endif()
-if (DEFINED CMAKE_COMPILER_IS_GNUCXX)
+if (CMAKE_COMPILER_IS_GNUCXX AND NOT APPLE)
# Optimize size of binaries
set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -s")
set (CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -s")
{
case Aspect_XRActionType_InputDigital:
{
- Aspect_XRDigitalActionData aData = GetDigitalActionData (anAction);
- //if (aData.IsChanged) { std::cout << " " << anAction->Id() << " pressed: " << aData.IsPressed << "\n"; }
+ GetDigitalActionData (anAction);
break;
}
case Aspect_XRActionType_InputAnalog:
{
- Aspect_XRAnalogActionData aData = GetAnalogActionData (anAction);
- //if (aData.IsChanged()) { std::cout << " " << anAction->Id() << " changed: " << aData.VecXYZ[0] << " " << aData.VecXYZ[1] << " " << aData.VecXYZ[2] << "\n"; }
+ GetAnalogActionData (anAction);
break;
}
case Aspect_XRActionType_InputPose:
GetPoseActionDataForNextFrame (anAction);
break;
}
+ default:
+ break;
}
}
}
int yylen = 0;
// Error handling.
- int yynerrs_ = 0;
int yyerrstatus_ = 0;
/// The lookahead symbol.
// If not already recovering from an error, report this error.
if (!yyerrstatus_)
{
- ++yynerrs_;
std::string msg = YY_("syntax error");
error (YY_MOVE (msg));
}
vtkTypeMacro (IVtkDraw_Interactor, vtkRenderWindowInteractor)
- virtual void Initialize();
- virtual void Enable();
- virtual void Start() { }
+ virtual void Initialize() Standard_OVERRIDE;
+ virtual void Enable() Standard_OVERRIDE;
+ virtual void Start() Standard_OVERRIDE { }
const PSelector& Selector() const { return mySelector; }
void SetShapePicker (const PSelector& theSelector);
void OnMouseWheelBackward (HWND wnd, UINT nFlags, Standard_Integer X, Standard_Integer Y);
#else
static void ProcessEvents (ClientData theData, int);
- void GetMousePosition (Standard_Integer *theX, Standard_Integer *theY);
+ void GetMousePosition (Standard_Integer *theX, Standard_Integer *theY) Standard_OVERRIDE;
#endif
private:
vtkTypeMacro(IVtkTools_DisplayModeFilter,IVtkTools_SubPolyDataFilter)
static IVtkTools_DisplayModeFilter *New();
- void PrintSelf (std::ostream& os, vtkIndent indent);
+ void PrintSelf (std::ostream& os, vtkIndent indent) Standard_OVERRIDE;
//! Set display mode to define cells types to be passed through this filter.
void SetDisplayMode (const IVtk_DisplayMode aMode);
vtkTypeMacro(IVtkTools_SubPolyDataFilter,vtkPolyDataAlgorithm)
static IVtkTools_SubPolyDataFilter *New();
- void PrintSelf (std::ostream& theOs, vtkIndent theIndent);
+ void PrintSelf (std::ostream& theOs, vtkIndent theIndent) Standard_OVERRIDE;
//! Set ids to be passed through this filter.
void SetData(const IVtk_IdTypeMap theSet);
#elif defined(__GNUC__)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Woverflow"
+#elif defined(_MSC_VER)
+ #pragma warning(push)
+ #pragma warning(disable: 4307)
#endif
- constexpr Standard_Integer i=IntegerLast();
+ constexpr Standard_Integer i = IntegerLast();
Standard_Integer res = i + 1;
#if defined(__clang__)
#pragma clang diagnostic pop
#elif defined(__GNUC__)
#pragma GCC diagnostic pop
+#elif defined(_MSC_VER)
+ #pragma warning(pop)
#endif
di << "Not caught: " << i << " + 1 = " << res << ", still OK\n";
}
std::vector<std::pair<const char*, Handle(ShapeProcess_Operator)>> ShapeProcess::getOperators(const OperationsFlags& theFlags)
{
std::vector<std::pair<const char*, Handle(ShapeProcess_Operator)>> aResult;
- for (std::underlying_type<Operation>::type anOperation = Operation::First; anOperation < Operation::Count; ++anOperation)
+ for (std::underlying_type<Operation>::type anOperation = Operation::First; anOperation <= Operation::Last; ++anOperation)
{
if (theFlags.test(anOperation))
{
FixShape,
SplitClosedEdges,
SplitCommonVertex,
- Count // Number of operations.
+ Last = SplitCommonVertex // Last operation index.
};
// Bitset of operations. It is used to specify which operations should be performed.
// flags.set(ShapeProcess::Operation::DirectFaces);
// flags.set(ShapeProcess::Operation::SameParameter);
// ShapeProcess::Perform(context, flags);
- using OperationsFlags = std::bitset<Operation::Count>;
+ using OperationsFlags = std::bitset<Operation::Last + 1>;
public:
//! Registers operator to make it visible for Performer
if ( yyin.bad() )
return -1;
else
- return yyin.gcount();
+ return static_cast<int>(yyin.gcount());
#endif
}
int yylen = 0;
// Error handling.
- int yynerrs_ = 0;
int yyerrstatus_ = 0;
/// The lookahead symbol.
// If not already recovering from an error, report this error.
if (!yyerrstatus_)
{
- ++yynerrs_;
context yyctx (*this, yyla);
std::string msg = yysyntax_error_ (yyctx);
error (YY_MOVE (msg));