--- BUILD.bazel
+++ BUILD.bazel
@@ -0,0 +1,645 @@
+"""
+    SPDX-FileCopyrightText: 2023 Julian Amann <dev@vertexwahn.de>
+    SPDX-License-Identifier: Apache-2.0
+"""
+
+package(
+    default_visibility = ["//visibility:public"],
+)
+
+load("@bazel_skylib//rules:expand_template.bzl", "expand_template")
+
+# If you want to use the internal tasking system use:
+# bazel build //... --define embree_tasking_system=internal
+# The default tasking system is oneTBB
+config_setting(
+    name = "embree_internal_tasking_system",
+    define_values = {"embree_tasking_system": "internal"},
+)
+
+COMMON_DEFINES = select({
+    ":embree_internal_tasking_system": [
+        "TASKING_INTERNAL",
+        "EMBREE_TARGET_SSE2",
+        #"EMBREE_TARGET_SSE42", # Embree has support for different ISAs - the Bazalization currently only supports SSE
+        #"EMBREE_TARGET_AVX", # TODO: support SS342, AVX and AVX2 in Bazel build
+        #"EMBREE_TARGET_AVX2",
+    ],
+    "//conditions:default": [
+        "TASKING_TBB",
+        "EMBREE_TARGET_SSE2",
+        #"EMBREE_TARGET_SSE42",
+        #"EMBREE_TARGET_AVX",
+        #"EMBREE_TARGET_AVX2",
+    ],
+}) + select({
+    "@platforms//os:windows": [
+        "__SSE__",
+        "__SSE2__",
+        "EMBREE_STATIC_LIB",
+    ],
+    "//conditions:default": [
+    ],
+})
+
+expand_template(
+    name = "rtcore_config_h",
+    out = "include/embree4/rtcore_config.h",
+    substitutions = {
+        "@EMBREE_VERSION_MAJOR@": "4",
+        "@EMBREE_VERSION_MINOR@": "3",
+        "@EMBREE_VERSION_PATCH@": "0",
+        "#cmakedefine EMBREE_SYCL_SUPPORT": "/* #undef EMBREE_SYCL_SUPPORT */",
+        "#cmakedefine EMBREE_GEOMETRY_INSTANCE_ARRAY": "",
+        "#cmakedefine01 EMBREE_SYCL_GEOMETRY_CALLBACK" : "#define EMBREE_SYCL_GEOMETRY_CALLBACK 0",
+        "@EMBREE_VERSION_NUMBER@": "40300",
+        "@EMBREE_VERSION_NOTE@": "",
+        "@EMBREE_MAX_INSTANCE_LEVEL_COUNT@": "1",
+        "#cmakedefine01 EMBREE_MIN_WIDTH": "#define EMBREE_MIN_WIDTH 0",
+        "#cmakedefine EMBREE_STATIC_LIB": "#define EMBREE_STATIC_LIB",
+        "#cmakedefine EMBREE_API_NAMESPACE": "/* #undef EMBREE_API_NAMESPACE */",
+        "@EMBREE_API_NAMESPACE@": "",
+    },
+    template = "kernels/rtcore_config.h.in",
+)
+
+expand_template(
+    name = "config_h",
+    out = "kernels/config.h",
+    substitutions = {
+        "#cmakedefine EMBREE_RAY_MASK": "/* #undef EMBREE_RAY_MASK */",
+        "#cmakedefine EMBREE_STAT_COUNTERS": "/* #undef EMBREE_STAT_COUNTERS */",
+        "#cmakedefine EMBREE_BACKFACE_CULLING_SPHERES": "/* #undef EMBREE_BACKFACE_CULLING_SPHERES */",
+        "#cmakedefine EMBREE_BACKFACE_CULLING_CURVES": "/* #undef EMBREE_BACKFACE_CULLING_CURVES */",
+        "#cmakedefine EMBREE_BACKFACE_CULLING": "/* #undef EMBREE_BACKFACE_CULLING */",
+        "#cmakedefine EMBREE_FILTER_FUNCTION": "#define EMBREE_FILTER_FUNCTION",
+        "#cmakedefine EMBREE_IGNORE_INVALID_RAYS": "/* #undef EMBREE_IGNORE_INVALID_RAYS */",
+        "#cmakedefine EMBREE_GEOMETRY_TRIANGLE": "#define EMBREE_GEOMETRY_TRIANGLE",
+        "#cmakedefine EMBREE_GEOMETRY_QUAD": "#define EMBREE_GEOMETRY_QUAD",
+        "#cmakedefine EMBREE_GEOMETRY_CURVE": "#define EMBREE_GEOMETRY_CURVE",
+        "#cmakedefine EMBREE_GEOMETRY_SUBDIVISION": "#define EMBREE_GEOMETRY_SUBDIVISION",
+        "#cmakedefine EMBREE_GEOMETRY_USER": "#define EMBREE_GEOMETRY_USER",
+        "#cmakedefine EMBREE_GEOMETRY_INSTANCE": "#define EMBREE_GEOMETRY_INSTANCE",
+        "#cmakedefine EMBREE_GEOMETRY_GRID": "#define EMBREE_GEOMETRY_GRID",
+        "#cmakedefine EMBREE_GEOMETRY_POINT": "#define EMBREE_GEOMETRY_POINT",
+        "#cmakedefine EMBREE_RAY_PACKETS": "#define EMBREE_RAY_PACKETS",
+        "#cmakedefine EMBREE_COMPACT_POLYS": "/* #undef EMBREE_COMPACT_POLYS */",
+        "#cmakedefine EMBREE_DISC_POINT_SELF_INTERSECTION_AVOIDANCE": "#define EMBREE_DISC_POINT_SELF_INTERSECTION_AVOIDANCE",
+        "@EMBREE_CURVE_SELF_INTERSECTION_AVOIDANCE_FACTOR@": "2.0",
+    },
+    template = "kernels/config.h.in",
+)
+
+expand_template(
+    name = "hash_h",
+    out = "kernels/hash.h",
+    substitutions = {
+        "@EMBREE_HASH@": "7c53133eb21424f7f0ae1e25bf357e358feaf6ab",
+    },
+    template = "kernels/hash.h.in",
+)
+
+cc_library(
+    name = "math",
+    srcs = [
+        "common/math/affinespace.h",
+        "common/math/bbox.h",
+        "common/math/col3.h",
+        "common/math/col4.h",
+        "common/math/color.h",
+        "common/math/color_sycl.h",
+        "common/math/constants.cpp",
+        "common/math/constants.h",
+        "common/math/emath.h",
+        "common/math/interval.h",
+        "common/math/lbbox.h",
+        "common/math/linearspace2.h",
+        "common/math/linearspace3.h",
+        "common/math/math_sycl.h",
+        "common/math/obbox.h",
+        "common/math/quaternion.h",
+        "common/math/range.h",
+        "common/math/transcendental.h",
+        "common/math/vec2.h",
+        "common/math/vec2fa.h",
+        "common/math/vec2fa_sycl.h",
+        "common/math/vec3.h",
+        "common/math/vec3ba.h",
+        "common/math/vec3fa.h",
+        "common/math/vec3ia.h",
+        "common/math/vec4.h",
+        "common/sys/platform.h",
+    ],
+    defines = COMMON_DEFINES,
+)
+
+cc_library(
+    name = "simd",
+    srcs = [
+        "common/simd/sse.cpp",
+    ],
+    hdrs = [
+        "common/math/constants.h",
+        "common/math/emath.h",
+        "common/math/math_sycl.h",
+        "common/simd/arm/avx2neon.h",
+        "common/simd/arm/emulation.h",
+        "common/simd/arm/sse2neon.h",
+        "common/simd/avx.h",
+        "common/simd/avx512.h",
+        "common/simd/simd.h",
+        "common/simd/sse.h",
+        "common/simd/varying.h",
+        "common/simd/vboold4_avx.h",
+        "common/simd/vboold4_avx512.h",
+        "common/simd/vboold8_avx512.h",
+        "common/simd/vboolf16_avx512.h",
+        "common/simd/vboolf4_avx512.h",
+        "common/simd/vboolf4_sse2.h",
+        "common/simd/vboolf8_avx.h",
+        "common/simd/vboolf8_avx512.h",
+        "common/simd/vdouble4_avx.h",
+        "common/simd/vdouble8_avx512.h",
+        "common/simd/vfloat16_avx512.h",
+        "common/simd/vfloat4_sse2.h",
+        "common/simd/vfloat8_avx.h",
+        "common/simd/vint16_avx512.h",
+        "common/simd/vint4_sse2.h",
+        "common/simd/vint8_avx.h",
+        "common/simd/vint8_avx2.h",
+        "common/simd/vllong4_avx2.h",
+        "common/simd/vllong8_avx512.h",
+        "common/simd/vuint16_avx512.h",
+        "common/simd/vuint4_sse2.h",
+        "common/simd/vuint8_avx.h",
+        "common/simd/vuint8_avx2.h",
+        "common/sys/alloc.h",
+        "common/sys/intrinsics.h",
+        "common/sys/platform.h",
+    ],
+    defines = COMMON_DEFINES,
+)
+
+cc_library(
+    name = "sys",
+    srcs = [
+        "common/math/constants.h",
+        "common/math/emath.h",
+        "common/math/math_sycl.h",
+        "common/math/vec2.h",
+        "common/math/vec2fa.h",
+        "common/math/vec3.h",
+        "common/math/vec3ba.h",
+        "common/math/vec3fa.h",
+        "common/math/vec3ia.h",
+        "common/math/vec4.h",
+        "common/simd/arm/avx2neon.h",
+        "common/simd/arm/emulation.h",
+        "common/simd/arm/sse2neon.h",
+        "common/simd/sse.h",
+        "common/simd/varying.h",
+        "common/simd/vboolf4_sse2.h",
+        "common/simd/vfloat4_sse2.h",
+        "common/simd/vint4_sse2.h",
+        "common/simd/vuint4_sse2.h",
+        "common/sys/alloc.cpp",
+        "common/sys/alloc.h",
+        "common/sys/array.h",
+        "common/sys/atomic.h",
+        "common/sys/barrier.cpp",
+        "common/sys/barrier.h",
+        "common/sys/condition.cpp",
+        "common/sys/condition.h",
+        "common/sys/estring.h",
+        "common/sys/estring.cpp",
+        "common/sys/filename.cpp",
+        "common/sys/filename.h",
+        "common/sys/intrinsics.h",
+        "common/sys/library.cpp",
+        "common/sys/library.h",
+        "common/sys/mutex.cpp",
+        "common/sys/mutex.h",
+        "common/sys/platform.h",
+        "common/sys/ref.h",
+        "common/sys/regression.cpp",
+        "common/sys/regression.h",
+        "common/sys/sycl.h",
+        "common/sys/sysinfo.cpp",
+        "common/sys/sysinfo.h",
+        "common/sys/thread.cpp",
+        "common/sys/thread.h",
+        "common/sys/vector.h",
+    ],
+    defines = COMMON_DEFINES,
+    linkopts = select({
+        "@platforms//os:windows": [
+            "-DEFAULTLIB:advapi32.lib",
+        ],
+        "//conditions:default": [
+        ],
+    }),
+)
+
+cc_library(
+    name = "tasking",
+    srcs = select({
+        ":embree_internal_tasking_system": [
+            "common/math/constants.h",
+            "common/math/math.h",
+            "common/math/range.h",
+            "common/sys/alloc.h",
+            "common/sys/atomic.h",
+            "common/sys/barrier.h",
+            "common/sys/condition.h",
+            "common/sys/intrinsics.h",
+            "common/sys/mutex.h",
+            "common/sys/platform.h",
+            "common/sys/ref.h",
+            "common/sys/sysinfo.h",
+            "common/sys/thread.h",
+            "common/sys/vector.h",
+            "common/tasking/taskscheduler.h",
+            "common/tasking/taskschedulerinternal.cpp",
+            "common/tasking/taskschedulerinternal.h",
+            "include/embree4/rtcore.h",
+            "include/embree4/rtcore_buffer.h",
+            "include/embree4/rtcore_builder.h",
+            "include/embree4/rtcore_common.h",
+            "include/embree4/rtcore_device.h",
+            "include/embree4/rtcore_geometry.h",
+            "include/embree4/rtcore_quaternion.h",
+            "include/embree4/rtcore_ray.h",
+            "include/embree4/rtcore_scene.h",
+        ],
+        "//conditions:default": [
+            "common/tasking/taskschedulertbb.cpp",
+            "common/tasking/taskscheduler.h",
+            #"common/tasking/taskschedulerinternal.cpp",
+            "common/tasking/taskschedulerinternal.h",
+            "common/tasking/taskschedulertbb.h",
+            "common/sys/platform.h",
+            "common/sys/alloc.h",
+            "common/sys/barrier.h",
+            "common/sys/intrinsics.h",
+            "common/sys/sysinfo.h",
+            "common/sys/atomic.h",
+            "common/sys/thread.h",
+            "common/sys/mutex.h",
+            "common/sys/vector.h",
+            "common/sys/condition.h",
+            "common/sys/ref.h",
+            "common/simd/arm/emulation.h",
+            "common/simd/arm/sse2neon.h",
+            "common/simd/arm/avx2neon.h",
+        ],
+    }),
+    hdrs = [
+        ":rtcore_config_h",
+    ],
+    defines = COMMON_DEFINES,
+    includes = ["include/embree3"],
+    deps = select({
+        ":embree_internal_tasking_system": [
+        ],
+        "//conditions:default": [
+            "@onetbb//:tbb",
+        ],
+    }),
+)
+
+cc_library(
+    name = "lexers",
+    srcs = [
+        "common/lexers/parsestream.h",
+        "common/lexers/stream.h",
+        "common/lexers/streamfilters.h",
+        "common/lexers/stringstream.cpp",
+        "common/lexers/stringstream.h",
+        "common/lexers/tokenstream.cpp",
+        "common/lexers/tokenstream.h",
+    ],
+    defines = COMMON_DEFINES,
+    deps = [
+        ":math",
+        ":sys",
+    ],
+)
+
+cc_library(
+    name = "embree",
+    srcs = [
+        "kernels/builders/primrefgen.cpp",
+        "kernels/bvh/bvh.cpp",
+        "kernels/bvh/bvh4_factory.cpp",
+        "kernels/bvh/bvh8_factory.cpp",
+        "kernels/bvh/bvh_builder.cpp",
+        "kernels/bvh/bvh_builder_hair.cpp",
+        "kernels/bvh/bvh_builder_hair_mb.cpp",
+        "kernels/bvh/bvh_builder_morton.cpp",
+        "kernels/bvh/bvh_builder_sah.cpp",
+        "kernels/bvh/bvh_builder_sah_mb.cpp",
+        "kernels/bvh/bvh_builder_sah_spatial.cpp",
+        "kernels/bvh/bvh_builder_subdiv.cpp",
+        "kernels/bvh/bvh_builder_twolevel.cpp",
+        "kernels/bvh/bvh_collider.cpp",
+        "kernels/bvh/bvh_intersector1_bvh4.cpp",
+        "kernels/bvh/bvh_intersector_hybrid4_bvh4.cpp",
+        #"kernels/bvh/bvh_intersector_stream.cpp",
+        #"kernels/bvh/bvh_intersector_stream_bvh4.cpp",
+        #"kernels/bvh/bvh_intersector_stream_filters.cpp",
+        "kernels/bvh/bvh_refit.cpp",
+        "kernels/bvh/bvh_rotate.cpp",
+        "kernels/bvh/bvh_statistics.cpp",
+        "kernels/common/acceln.cpp",
+        "kernels/common/accelset.cpp",
+        "kernels/common/alloc.cpp",
+        "kernels/common/device.cpp",
+        "kernels/common/geometry.cpp",
+        "kernels/common/motion_derivative.cpp",
+        "kernels/common/rtcore.cpp",
+        "kernels/common/rtcore_builder.cpp",
+        "kernels/common/scene.cpp",
+        "kernels/common/scene_curves.cpp",
+        "kernels/common/scene_grid_mesh.cpp",
+        "kernels/common/scene_instance.cpp",
+        "kernels/common/scene_line_segments.cpp",
+        "kernels/common/scene_points.cpp",
+        "kernels/common/scene_quad_mesh.cpp",
+        "kernels/common/scene_subdiv_mesh.cpp",
+        "kernels/common/scene_triangle_mesh.cpp",
+        "kernels/common/scene_user_geometry.cpp",
+        "kernels/common/scene_verify.cpp",
+        "kernels/common/stat.cpp",
+        "kernels/common/state.cpp",
+        "kernels/geometry/curve_intersector_virtual_4i.cpp",
+        "kernels/geometry/curve_intersector_virtual_4i_mb.cpp",
+        "kernels/geometry/curve_intersector_virtual_4v.cpp",
+        "kernels/geometry/curve_intersector_virtual_8i.cpp",
+        "kernels/geometry/curve_intersector_virtual_8i_mb.cpp",
+        "kernels/geometry/curve_intersector_virtual_8v.cpp",
+        "kernels/geometry/instance_array.h",
+        "kernels/geometry/instance_array_intersector.h",
+        "kernels/geometry/grid_soa.cpp",
+        "kernels/geometry/instance_intersector.cpp",
+        "kernels/geometry/primitive4.cpp",
+        "kernels/subdiv/bezier_curve.cpp",
+        "kernels/subdiv/bspline_curve.cpp",
+        "kernels/subdiv/catmullclark_coefficients.cpp",
+        "kernels/subdiv/catmullrom_curve.cpp",
+        "kernels/subdiv/subdivpatch1base.cpp",
+        "kernels/subdiv/subdivpatch1base_eval.cpp",
+        "kernels/subdiv/tessellation_cache.cpp",
+        "kernels/builders/primref.h",
+        "kernels/builders/priminfo_mb.h",
+        "kernels/builders/primref_mb.h",
+        "kernels/common/scene_instance_array.h",
+    ],
+    hdrs = [
+        "common/algorithms/parallel_any_of.h",
+        "common/algorithms/parallel_filter.h",
+        "common/algorithms/parallel_for.h",
+        "common/algorithms/parallel_for_for.h",
+        "common/algorithms/parallel_for_for_prefix_sum.h",
+        "common/algorithms/parallel_map.h",
+        "common/algorithms/parallel_partition.h",
+        "common/algorithms/parallel_prefix_sum.h",
+        "common/algorithms/parallel_reduce.h",
+        "common/algorithms/parallel_set.h",
+        "common/algorithms/parallel_sort.h",
+        "include/embree4/rtcore.h",
+        "include/embree4/rtcore.isph",
+        "include/embree4/rtcore_buffer.h",
+        "include/embree4/rtcore_buffer.isph",
+        "include/embree4/rtcore_builder.h",
+        "include/embree4/rtcore_common.h",
+        "include/embree4/rtcore_common.isph",
+        #"include/embree4/rtcore_config.h",
+        "include/embree4/rtcore_device.h",
+        "include/embree4/rtcore_device.isph",
+        "include/embree4/rtcore_geometry.h",
+        "include/embree4/rtcore_geometry.isph",
+        "include/embree4/rtcore_quaternion.h",
+        "include/embree4/rtcore_quaternion.isph",
+        "include/embree4/rtcore_ray.h",
+        "include/embree4/rtcore_ray.isph",
+        "include/embree4/rtcore_scene.h",
+        "include/embree4/rtcore_scene.isph",
+        "kernels/builders/bvh_builder_hair.h",
+        "kernels/builders/bvh_builder_morton.h",
+        "kernels/builders/bvh_builder_msmblur.h",
+        "kernels/builders/bvh_builder_msmblur_hair.h",
+        "kernels/builders/bvh_builder_sah.h",
+        "kernels/builders/heuristic_binning.h",
+        "kernels/builders/heuristic_binning_array_aligned.h",
+        "kernels/builders/heuristic_binning_array_unaligned.h",
+        "kernels/builders/heuristic_openmerge_array.h",
+        "kernels/builders/heuristic_spatial.h",
+        "kernels/builders/heuristic_spatial_array.h",
+        "kernels/builders/heuristic_strand_array.h",
+        "kernels/builders/heuristic_timesplit_array.h",
+        "kernels/builders/priminfo.h",
+        "kernels/builders/primrefgen.h",
+        "kernels/builders/primrefgen_presplit.h",
+        "kernels/builders/splitter.h",
+        "kernels/bvh/bvh.h",
+        "kernels/bvh/bvh4_factory.h",
+        "kernels/bvh/bvh8_factory.h",
+        "kernels/bvh/bvh_builder.h",
+        "kernels/bvh/bvh_builder_twolevel.h",
+        "kernels/bvh/bvh_builder_twolevel_internal.h",
+        "kernels/bvh/bvh_collider.h",
+        "kernels/bvh/bvh_factory.h",
+        "kernels/bvh/bvh_intersector1.cpp",
+        "kernels/bvh/bvh_intersector1.h",
+        "kernels/bvh/bvh_intersector_hybrid.cpp",
+        "kernels/bvh/bvh_intersector_hybrid.h",
+        #"kernels/bvh/bvh_intersector_stream.cpp",
+        #"kernels/bvh/bvh_intersector_stream.h",
+        #"kernels/bvh/bvh_intersector_stream_filters.h",
+        "kernels/bvh/bvh_node_aabb.h",
+        "kernels/bvh/bvh_node_aabb_mb.h",
+        "kernels/bvh/bvh_node_aabb_mb4d.h",
+        "kernels/bvh/bvh_node_base.h",
+        "kernels/bvh/bvh_node_obb.h",
+        "kernels/bvh/bvh_node_obb_mb.h",
+        "kernels/bvh/bvh_node_qaabb.h",
+        "kernels/bvh/bvh_node_ref.h",
+        "kernels/bvh/bvh_refit.h",
+        "kernels/bvh/bvh_rotate.h",
+        "kernels/bvh/bvh_statistics.h",
+        "kernels/bvh/bvh_traverser1.h",
+        #"kernels/bvh/bvh_traverser_stream.h",
+        "kernels/bvh/node_intersector.h",
+        "kernels/bvh/node_intersector1.h",
+        "kernels/bvh/node_intersector_frustum.h",
+        "kernels/bvh/node_intersector_packet.h",
+        #"kernels/bvh/node_intersector_packet_stream.h",
+        "kernels/common/accel.h",
+        "kernels/common/accelinstance.h",
+        "kernels/common/acceln.h",
+        "kernels/common/accelset.h",
+        "kernels/common/alloc.h",
+        "kernels/common/buffer.h",
+        "kernels/common/builder.h",
+        "kernels/common/context.h",
+        "kernels/common/default.h",
+        "kernels/common/device.h",
+        "kernels/common/geometry.h",
+        "kernels/common/hit.h",
+        "kernels/common/instance_stack.h",
+        "kernels/common/isa.h",
+        "kernels/common/motion_derivative.h",
+        "kernels/common/point_query.h",
+        #"kernels/common/primref.h",
+        #"kernels/common/primref_mb.h",
+        "kernels/common/profile.h",
+        "kernels/common/ray.h",
+        "kernels/common/rtcore.h",
+        "kernels/common/scene.h",
+        "kernels/common/scene_curves.h",
+        "kernels/common/scene_grid_mesh.h",
+        "kernels/common/scene_instance.h",
+        "kernels/common/scene_line_segments.h",
+        "kernels/common/scene_points.h",
+        "kernels/common/scene_quad_mesh.h",
+        "kernels/common/scene_subdiv_mesh.h",
+        "kernels/common/scene_triangle_mesh.h",
+        "kernels/common/scene_user_geometry.h",
+        "kernels/common/stack_item.h",
+        "kernels/common/stat.h",
+        "kernels/common/state.h",
+        "kernels/common/vector.h",
+        "kernels/geometry/coneline_intersector.h",
+        "kernels/geometry/conelinei_intersector.h",
+        "kernels/geometry/curveNi.h",
+        "kernels/geometry/curveNi_intersector.h",
+        "kernels/geometry/curveNi_mb.h",
+        "kernels/geometry/curveNi_mb_intersector.h",
+        "kernels/geometry/curveNv.h",
+        "kernels/geometry/curveNv_intersector.h",
+        "kernels/geometry/curve_intersector_distance.h",
+        "kernels/geometry/curve_intersector_oriented.h",
+        "kernels/geometry/curve_intersector_precalculations.h",
+        "kernels/geometry/curve_intersector_ribbon.h",
+        "kernels/geometry/curve_intersector_sweep.h",
+        "kernels/geometry/curve_intersector_virtual.h",
+        "kernels/geometry/cylinder.h",
+        "kernels/geometry/disc_intersector.h",
+        "kernels/geometry/disci_intersector.h",
+        "kernels/geometry/filter.h",
+        "kernels/geometry/grid_soa.h",
+        "kernels/geometry/grid_soa_intersector1.h",
+        "kernels/geometry/grid_soa_intersector_packet.h",
+        "kernels/geometry/instance.h",
+        "kernels/geometry/instance_intersector.h",
+        "kernels/geometry/intersector_epilog.h",
+        "kernels/geometry/intersector_iterators.h",
+        "kernels/geometry/line_intersector.h",
+        "kernels/geometry/linei.h",
+        "kernels/geometry/linei_intersector.h",
+        "kernels/geometry/object.h",
+        "kernels/geometry/object_intersector.h",
+        "kernels/geometry/plane.h",
+        "kernels/geometry/pointi.h",
+        "kernels/geometry/primitive.h",
+        "kernels/geometry/quad_intersector.h",
+        "kernels/geometry/quad_intersector_moeller.h",
+        "kernels/geometry/quad_intersector_pluecker.h",
+        "kernels/geometry/quadi.h",
+        "kernels/geometry/quadi_intersector.h",
+        "kernels/geometry/quadv.h",
+        "kernels/geometry/quadv_intersector.h",
+        "kernels/geometry/roundline_intersector.h",
+        "kernels/geometry/roundlinei_intersector.h",
+        "kernels/geometry/sphere_intersector.h",
+        "kernels/geometry/spherei_intersector.h",
+        "kernels/geometry/subdivpatch1.h",
+        "kernels/geometry/subdivpatch1_intersector.h",
+        "kernels/geometry/subgrid.h",
+        "kernels/geometry/subgrid_intersector.h",
+        "kernels/geometry/subgrid_intersector_moeller.h",
+        "kernels/geometry/subgrid_intersector_pluecker.h",
+        "kernels/geometry/subgrid_mb_intersector.h",
+        "kernels/geometry/triangle.h",
+        "kernels/geometry/triangle_intersector.h",
+        "kernels/geometry/triangle_intersector_moeller.h",
+        "kernels/geometry/triangle_intersector_pluecker.h",
+        "kernels/geometry/triangle_intersector_woop.h",
+        "kernels/geometry/triangle_triangle_intersector.h",
+        "kernels/geometry/trianglei.h",
+        "kernels/geometry/trianglei_intersector.h",
+        "kernels/geometry/trianglev.h",
+        "kernels/geometry/trianglev_intersector.h",
+        "kernels/geometry/trianglev_mb.h",
+        "kernels/geometry/trianglev_mb_intersector.h",
+        "kernels/subdiv/bezier_curve.h",
+        "kernels/subdiv/bezier_patch.h",
+        "kernels/subdiv/bilinear_patch.h",
+        "kernels/subdiv/bspline_curve.h",
+        "kernels/subdiv/bspline_patch.h",
+        "kernels/subdiv/catmullclark_coefficients.h",
+        "kernels/subdiv/catmullclark_patch.h",
+        "kernels/subdiv/catmullclark_ring.h",
+        "kernels/subdiv/catmullrom_curve.h",
+        "kernels/subdiv/feature_adaptive_eval.h",
+        "kernels/subdiv/feature_adaptive_eval_grid.h",
+        "kernels/subdiv/feature_adaptive_eval_simd.h",
+        "kernels/subdiv/gregory_patch.h",
+        "kernels/subdiv/gregory_patch_dense.h",
+        "kernels/subdiv/gridrange.h",
+        "kernels/subdiv/half_edge.h",
+        "kernels/subdiv/hermite_curve.h",
+        "kernels/subdiv/linear_bezier_patch.h",
+        "kernels/subdiv/patch.h",
+        "kernels/subdiv/patch_eval.h",
+        "kernels/subdiv/patch_eval_grid.h",
+        "kernels/subdiv/patch_eval_simd.h",
+        "kernels/subdiv/subdivpatch1base.h",
+        "kernels/subdiv/tessellation.h",
+        "kernels/subdiv/tessellation_cache.h",
+        ":config_h",
+        ":hash_h",
+    ],
+    copts = select({
+        "@platforms//os:windows": [],
+        "//conditions:default": [
+            "-Wno-error",
+        ],
+    }),
+    defines = COMMON_DEFINES + ["EMBREE_LOWEST_ISA"] +
+              select({
+                  "@platforms//os:osx": ["_XOPEN_SOURCE"],
+                  "//conditions:default": [],
+              }),
+    includes = [
+        "include",
+        #"include/embree3",
+        #"kernels/geometry",
+        #"kernels/builders",
+        #"kernels/common",
+        #"kernels/bvh",
+        #"kernels/geometry",
+        #"kernels/subdiv",
+        #"kernels",
+    ],
+    linkopts =
+        select({
+            "@platforms//os:windows": [],
+            "@platforms//os:linux": [
+                "-ldl",
+                "-lpthread",
+                "-lrt",
+            ],
+            "//conditions:default": [
+                "-lpthread",
+            ],
+        }),
+    #visibility = ["//visibility:public"],
+    deps = [
+        ":lexers",
+        ":math",
+        ":simd",
+        ":sys",
+        ":tasking",
+    ],
+)
