]> OCCT Git - occt-copy.git/commit
0031060: Configuration - Support building with CLang compiler under VS 2019
authorabv <abv@opencascade.com>
Fri, 11 Oct 2019 19:04:02 +0000 (22:04 +0300)
committerabv <abv@opencascade.com>
Mon, 21 Oct 2019 06:58:36 +0000 (09:58 +0300)
commitbaeb918de4603740aa021e97970b6caad1d222c1
tree03d472f50b5edbc474a153ad01090c60cc6a51ce
parent1ed6b44575dd943dff54737d4593f628d89bea03
0031060: Configuration - Support building with CLang compiler under VS 2019

Build tools are updated to support building with Visual Studion 2019 toolset ClangCL (LLVM clang-cl):
- In CMake builds, use of unsupported option "-std=c++0x" is avoided
- Tool genconf recognizes availability of ClangCL toolset and proposes it in the list
- Tool genproj recognizes new compiler specification VCVER=vclang and generates VS 2019 projects for it

Note that vclang configuration puts binaries to folder "vc14" as it is compatible with vc14 CRT.

Code is updated to build with Clang for Windows without errors and warnings:
- In BVH classes, pure virtual destructors are replaced by empty ones, to avoid bogus compiler warning
- In .lex files, pragmas are added to disable warnings in parser code
- In OSD, signature of function _osd_wnt_set_error() is corrected to avoid warning on incorrect use of va_args (undefined behavior)
- In OSD_Host, OSD_Parallel_TBB, warnings on usage of deprecated function are disabled
- In Quantity_ColorRGBA and ViewerTest_CmdParser, incorrect use of predefined macro __FUNCTION__ assuming it was a string literal is avoided
- In Standard_Macro.hxx, code is reordered to handle Clang for Windows appropriately
- In AdvApp2Var_SysBase.hxx, inclusion of obsolete (MSVC-specific) header file is replaced by Standard_TypeDef.hxx
- In BRepExtrema_SelfIntersection.hxx, missing Standard_EXPORT is added
- In Standard_ErrorHandler.hxx, empty statements added to avoid warning on unused class fields
- In IVtkDraw and ViewerTest, interface is corrected to use actual type avoiding unnecessary type casts

Off-topic: corrections of some errors (uninitialized class fields) reported by VS Code Analysis in TKernel
40 files changed:
adm/cmake/occt_defs_flags.cmake
adm/genconf.tcl
adm/genconfdeps.tcl
adm/genproj.tcl
adm/templates/env.bat
dox/overview/overview.md
src/AdvApp2Var/AdvApp2Var_SysBase.hxx
src/BRepExtrema/BRepExtrema_SelfIntersection.hxx
src/BVH/BVH_Object.hxx
src/BVH/BVH_QueueBuilder.hxx
src/BVH/BVH_Set.hxx
src/ExprIntrp/ExprIntrp.lex
src/ExprIntrp/lex.ExprIntrp.c
src/IVtkDraw/IVtkDraw.cxx
src/IVtkDraw/IVtkDraw.hxx
src/IVtkDraw/IVtkDraw_Interactor.cxx
src/NCollection/NCollection_AccAllocator.hxx
src/NCollection/NCollection_SparseArrayBase.hxx
src/OSD/OSD_Directory.cxx
src/OSD/OSD_DirectoryIterator.cxx
src/OSD/OSD_Disk.cxx
src/OSD/OSD_File.cxx
src/OSD/OSD_FileIterator.cxx
src/OSD/OSD_FileNode.cxx
src/OSD/OSD_Host.cxx
src/OSD/OSD_Parallel_TBB.cxx
src/OSD/OSD_Path.cxx
src/OSD/OSD_Process.cxx
src/OSD/OSD_Timer.cxx
src/QABugs/QABugs_11.cxx
src/QABugs/QABugs_19.cxx
src/Quantity/Quantity_ColorRGBA.cxx
src/Standard/Standard_ErrorHandler.hxx
src/Standard/Standard_Macro.hxx
src/StepFile/lex.step.c
src/StepFile/step.lex
src/Storage/Storage_Schema.cxx
src/ViewerTest/ViewerTest.hxx
src/ViewerTest/ViewerTest_CmdParser.cxx
src/ViewerTest/ViewerTest_ViewerCommands.cxx