Skip to content

Commit 58efb5c

Browse files
committed
Use special build option for wheel build
1 parent 4c44c86 commit 58efb5c

File tree

3 files changed

+15
-13
lines changed

3 files changed

+15
-13
lines changed

bindings/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ if(pyroot)
1717
endif()
1818
endif()
1919

20-
if(tpython)
20+
if(tpython AND NOT (DEFINED ROOT_WHEEL_BUILD AND ROOT_WHEEL_BUILD))
2121
add_subdirectory(tpython)
2222
endif()
2323

cmake/modules/SearchInstalledSoftware.cmake

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -677,9 +677,13 @@ set(Python3_FIND_FRAMEWORK LAST)
677677
# Even if we don't build PyROOT, one still need python executable to run some scripts
678678
list(APPEND python_components Interpreter)
679679
if(pyroot OR tmva-pymva)
680-
# We have to only look for the Python development module in order to be able to build ROOT with a pip backend
681-
# In particular, it is forbidden to link against libPython.so, see https://peps.python.org/pep-0513/#libpythonx-y-so-1
682-
list(APPEND python_components Development.Module)
680+
if(DEFINED ROOT_WHEEL_BUILD AND ROOT_WHEEL_BUILD)
681+
# We have to only look for the Python development module in order to be able to build ROOT with a pip backend
682+
# In particular, it is forbidden to link against libPython.so, see https://peps.python.org/pep-0513/#libpythonx-y-so-1
683+
list(APPEND python_components Development.Module)
684+
else()
685+
list(APPEND python_components Development)
686+
endif()
683687
endif()
684688
if(tmva-pymva)
685689
list(APPEND python_components NumPy)
@@ -1776,7 +1780,7 @@ if(pyroot)
17761780
endif()
17771781

17781782
#---Check for TPython---------------------------------------------------------------------
1779-
if(tpython)
1783+
if(tpython AND NOT (DEFINED ROOT_WHEEL_BUILD AND ROOT_WHEEL_BUILD))
17801784

17811785
if(NOT Python3_Development_FOUND)
17821786
if(fail-on-missing)

setup.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,16 @@ def run(self):
4242
_build.run(self)
4343

4444
# Configure ROOT build
45-
base_opts = shlex.split("cmake -GNinja -Dccache=ON")
46-
mode_opts = shlex.split(
45+
configure_command = shlex.split(
46+
"cmake -GNinja -Dccache=ON "
47+
"-Dgminimal=ON -Dasimage=ON -Dopengl=OFF " # Graphics
48+
"-Druntime_cxxmodules=ON -Drpath=ON -Dfail-on-missing=ON -DROOT_WHEEL_BUILD=ON " # Generic build configuration
4749
"-Dbuiltin_nlohmannjson=ON -Dbuiltin_tbb=ON -Dbuiltin_xrootd=ON " # builtins
4850
"-Dbuiltin_lz4=ON -Dbuiltin_lzma=ON -Dbuiltin_zstd=ON -Dbuiltin_xxhash=ON" # builtins
49-
"-Druntime_cxxmodules=ON -Drpath=ON -Dfail-on-missing=ON " # Generic build configuration
50-
"-Dgminimal=ON -Dasimage=ON -Dopengl=OFF " # Graphics
5151
"-Dpyroot=ON -Ddataframe=ON -Dxrootd=ON -Dssl=ON -Dimt=ON "
52-
"-Droofit=ON"
52+
"-Droofit=ON "
53+
f"-DCMAKE_INSTALL_PREFIX={INSTALL_DIR} -B {BUILD_DIR} -S {SOURCE_DIR}"
5354
)
54-
dirs_opts = shlex.split(f"-DCMAKE_INSTALL_PREFIX={INSTALL_DIR} -B {BUILD_DIR} -S {SOURCE_DIR}")
55-
configure_command = base_opts + mode_opts + dirs_opts
56-
print(f"\n\n{' '.join(configure_command)}\n\n")
5755
subprocess.run(configure_command, check=True)
5856

5957
# Run build with CMake

0 commit comments

Comments
 (0)