File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11cmake_minimum_required (VERSION 3.15.0 ) # minimum imposed by scikit-build-core
22project (polyscope LANGUAGES CXX )
33
4+ option (POLYSCOPE_PY_UNITY_BUILD "Enable Unity builds" OFF )
45
56## Gather dependencies
67
@@ -37,7 +38,25 @@ set_target_properties(polyscope_bindings PROPERTIES CXX_VISIBILITY_PRESET "defau
3738target_include_directories (polyscope_bindings PUBLIC "${EIGEN3_INCLUDE_DIR} " )
3839target_link_libraries (polyscope_bindings PRIVATE polyscope )
3940
40- # make the resulting target actually be called polyscope, without the py
41- # set_target_properties(polyscope_py PROPERTIES OUTPUT_NAME polyscope)
41+ if (POLYSCOPE_PY_UNITY_BUILD)
42+
43+ # NOTE: these are not perfect, sometimes the explicit template
44+ # instantiations get messed up and cause compile errors. The current
45+ # batch sizes were chosen because they happen to work around that.
46+ #
47+ # However, this does give a nearly 50% speedup, so it can be worth using
48+ # for long-running CI builds.
49+
50+ set_target_properties (polyscope PROPERTIES
51+ UNITY_BUILD ON
52+ UNITY_BUILD_BATCH_SIZE 5
53+ )
54+
55+ set_target_properties (polyscope_bindings PROPERTIES
56+ UNITY_BUILD ON
57+ UNITY_BUILD_BATCH_SIZE 4
58+ )
59+
60+ endif ()
4261
4362install (TARGETS polyscope_bindings LIBRARY DESTINATION .)
Original file line number Diff line number Diff line change @@ -33,4 +33,8 @@ build-backend = "scikit_build_core.build"
3333
3434[tool .scikit-build ]
3535build.verbose = true
36- logging.level = " INFO"
36+ logging.level = " INFO"
37+
38+ [tool .cibuildwheel ]
39+ # for cibuildwheel only, use unity builds by default
40+ environment = {POLYSCOPE_PY_UNITY_BUILD =" ON" }
You can’t perform that action at this time.
0 commit comments