This commit contains the minimum to make clang build/work with blender, asan and ninja build support is forthcoming Things to note: 1) Builds and runs, and is able to pass all tests (except for the freestyle_stroke_material.blend test which was broken at that time for all platforms by the looks of it) 2) It's slightly faster than msvc when using cycles. (time in seconds, on an i7-3370) victor_cpu msvc:3099.51 clang:2796.43 pavillon_barcelona_cpu msvc:1872.05 clang:1827.72 koro_cpu msvc:1097.58 clang:1006.51 fishy_cat_cpu msvc:815.37 clang:722.2 classroom_cpu msvc:1705.39 clang:1575.43 bmw27_cpu msvc:552.38 clang:561.53 barbershop_interior_cpu msvc:2134.93 clang:1922.33 3) clang on windows uses a drop in replacement for the Microsoft cl.exe (takes some of the Microsoft parameters, but not all, and takes some of the clang parameters but not all) and uses ms headers + libraries + linker, so you still need visual studio installed and will use our existing vc14 svn libs. 4) X64 only currently, X86 builds but crashes on startup. 5) Tested with llvm/clang 6.0.0 6) Requires visual studio integration, available at https://github.com/LazyDodo/llvm-vs2017-integration 7) The Microsoft compiler spawns a few copies of cl in parallel to get faster build times, clang doesn't, so the build time is 3-4x slower than with msvc. 8) No openmp support yet. Have not looked at this much, the binary distribution of clang doesn't seem to include it on windows. 9) No ASAN support yet, some of the sanitizers can be made to work, but it was decided to leave support out of this commit. Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D3304
192 lines
4.7 KiB
CMake
192 lines
4.7 KiB
CMake
# ***** BEGIN GPL LICENSE BLOCK *****
|
|
#
|
|
# This program is free software; you can redistribute it and/or
|
|
# modify it under the terms of the GNU General Public License
|
|
# as published by the Free Software Foundation; either version 2
|
|
# of the License, or (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful,
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
# GNU General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program; if not, write to the Free Software Foundation,
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
#
|
|
# The Original Code is Copyright (C) 2006, Blender Foundation
|
|
# All rights reserved.
|
|
#
|
|
# The Original Code is: all of this file.
|
|
#
|
|
# Contributor(s): Jacques Beaurain.
|
|
#
|
|
# ***** END GPL LICENSE BLOCK *****
|
|
|
|
set(INC
|
|
.
|
|
../blenkernel
|
|
../blenlib
|
|
../blentranslation
|
|
../makesdna
|
|
../../../intern/guardedalloc
|
|
../../../intern/atomic
|
|
../../../intern/eigen
|
|
../../../extern/rangetree
|
|
)
|
|
|
|
set(INC_SYS
|
|
|
|
)
|
|
|
|
set(SRC
|
|
# Naming convention for BMesh operators is: bmo_*action*_*details*.c
|
|
operators/bmo_beautify.c
|
|
operators/bmo_bevel.c
|
|
operators/bmo_bisect_plane.c
|
|
operators/bmo_bridge.c
|
|
operators/bmo_connect.c
|
|
operators/bmo_connect_concave.c
|
|
operators/bmo_connect_nonplanar.c
|
|
operators/bmo_connect_pair.c
|
|
operators/bmo_create.c
|
|
operators/bmo_dissolve.c
|
|
operators/bmo_dupe.c
|
|
operators/bmo_edgenet.c
|
|
operators/bmo_extrude.c
|
|
operators/bmo_fill_attribute.c
|
|
operators/bmo_fill_edgeloop.c
|
|
operators/bmo_fill_grid.c
|
|
operators/bmo_fill_holes.c
|
|
operators/bmo_hull.c
|
|
operators/bmo_inset.c
|
|
operators/bmo_join_triangles.c
|
|
operators/bmo_mesh_conv.c
|
|
operators/bmo_mirror.c
|
|
operators/bmo_normals.c
|
|
operators/bmo_offset_edgeloops.c
|
|
operators/bmo_planar_faces.c
|
|
operators/bmo_poke.c
|
|
operators/bmo_primitive.c
|
|
operators/bmo_removedoubles.c
|
|
operators/bmo_rotate_edges.c
|
|
operators/bmo_similar.c
|
|
operators/bmo_smooth_laplacian.c
|
|
operators/bmo_split_edges.c
|
|
operators/bmo_subdivide.c
|
|
operators/bmo_subdivide_edgering.c
|
|
operators/bmo_symmetrize.c
|
|
operators/bmo_triangulate.c
|
|
operators/bmo_unsubdivide.c
|
|
operators/bmo_utils.c
|
|
operators/bmo_wireframe.c
|
|
|
|
intern/bmesh_callback_generic.c
|
|
intern/bmesh_callback_generic.h
|
|
intern/bmesh_construct.c
|
|
intern/bmesh_construct.h
|
|
intern/bmesh_core.c
|
|
intern/bmesh_core.h
|
|
intern/bmesh_edgeloop.c
|
|
intern/bmesh_edgeloop.h
|
|
intern/bmesh_delete.c
|
|
intern/bmesh_delete.h
|
|
intern/bmesh_inline.h
|
|
intern/bmesh_interp.c
|
|
intern/bmesh_interp.h
|
|
intern/bmesh_iterators.c
|
|
intern/bmesh_iterators.h
|
|
intern/bmesh_iterators_inline.h
|
|
intern/bmesh_log.c
|
|
intern/bmesh_log.h
|
|
intern/bmesh_marking.c
|
|
intern/bmesh_marking.h
|
|
intern/bmesh_mesh.c
|
|
intern/bmesh_mesh.h
|
|
intern/bmesh_mesh_conv.c
|
|
intern/bmesh_mesh_conv.h
|
|
intern/bmesh_mesh_validate.c
|
|
intern/bmesh_mesh_validate.h
|
|
intern/bmesh_mods.c
|
|
intern/bmesh_mods.h
|
|
intern/bmesh_opdefines.c
|
|
intern/bmesh_operator_api_inline.h
|
|
intern/bmesh_operators.c
|
|
intern/bmesh_operators.h
|
|
intern/bmesh_operators_private.h
|
|
intern/bmesh_polygon.c
|
|
intern/bmesh_polygon.h
|
|
intern/bmesh_polygon_edgenet.c
|
|
intern/bmesh_polygon_edgenet.h
|
|
intern/bmesh_private.h
|
|
intern/bmesh_queries.c
|
|
intern/bmesh_queries.h
|
|
intern/bmesh_queries_inline.h
|
|
intern/bmesh_structure.c
|
|
intern/bmesh_structure.h
|
|
intern/bmesh_structure_inline.h
|
|
intern/bmesh_walkers.c
|
|
intern/bmesh_walkers.h
|
|
intern/bmesh_walkers_impl.c
|
|
intern/bmesh_walkers_private.h
|
|
|
|
intern/bmesh_operator_api.h
|
|
intern/bmesh_error.h
|
|
|
|
tools/bmesh_beautify.c
|
|
tools/bmesh_beautify.h
|
|
tools/bmesh_bevel.c
|
|
tools/bmesh_bevel.h
|
|
tools/bmesh_bisect_plane.c
|
|
tools/bmesh_bisect_plane.h
|
|
tools/bmesh_decimate_collapse.c
|
|
tools/bmesh_decimate_dissolve.c
|
|
tools/bmesh_decimate_unsubdivide.c
|
|
tools/bmesh_decimate.h
|
|
tools/bmesh_edgenet.c
|
|
tools/bmesh_edgenet.h
|
|
tools/bmesh_edgesplit.c
|
|
tools/bmesh_edgesplit.h
|
|
tools/bmesh_intersect.c
|
|
tools/bmesh_intersect.h
|
|
tools/bmesh_path.c
|
|
tools/bmesh_path.h
|
|
tools/bmesh_path_region.c
|
|
tools/bmesh_path_region.h
|
|
tools/bmesh_region_match.c
|
|
tools/bmesh_region_match.h
|
|
tools/bmesh_separate.c
|
|
tools/bmesh_separate.h
|
|
tools/bmesh_triangulate.c
|
|
tools/bmesh_triangulate.h
|
|
tools/bmesh_wireframe.c
|
|
tools/bmesh_wireframe.h
|
|
|
|
bmesh_class.h
|
|
|
|
# public includes
|
|
bmesh.h
|
|
bmesh_tools.h
|
|
)
|
|
|
|
if(MSVC AND NOT MSVC_CLANG)
|
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX /wd4101")
|
|
endif()
|
|
|
|
if(WITH_BULLET)
|
|
add_definitions(-DWITH_BULLET)
|
|
list(APPEND INC_SYS
|
|
${BULLET_INCLUDE_DIRS}
|
|
)
|
|
endif()
|
|
|
|
if(WITH_INTERNATIONAL)
|
|
add_definitions(-DWITH_INTERNATIONAL)
|
|
endif()
|
|
|
|
if(WITH_FREESTYLE)
|
|
add_definitions(-DWITH_FREESTYLE)
|
|
endif()
|
|
|
|
blender_add_lib(bf_bmesh "${SRC}" "${INC}" "${INC_SYS}")
|