@@ -103,10 +103,6 @@ def build_extension(self, ext):
103103 output_path = extdir .parent
104104 output_path .mkdir (parents = True , exist_ok = True )
105105
106- python_root_dir = sys .exec_prefix
107- if platform .system () == "Linux" :
108- python_root_dir = str (pathlib .Path (get_python_lib_path ()).parent .parent .parent )
109-
110106 config = "Debug" if self .debug or self .build_for_coverage else "Release"
111107 cmake_args = [
112108 f"-DYUP_BUILD_WHEEL=ON" ,
@@ -115,12 +111,16 @@ def build_extension(self, ext):
115111 f"-DYUP_BUILD_TESTS=OFF" ,
116112 f"-DCMAKE_BUILD_TYPE={ config } " ,
117113 f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={ output_path } " ,
118- f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{ config .upper ()} ={ output_path } " ,
119- f"-DPython_ROOT_DIR={ python_root_dir } " ,
120- f"-DPython_INCLUDE_DIRS={ get_python_includes_path ()} " ,
121- f"-DPython_LIBRARY_DIRS={ get_python_lib_path ()} "
114+ f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{ config .upper ()} ={ output_path } "
122115 ]
123116
117+ if platform .system () != "Linux" :
118+ cmake_args += [
119+ f"-DPython_ROOT_DIR={ sys .exec_prefix } " ,
120+ f"-DPython_INCLUDE_DIRS={ get_python_includes_path ()} " ,
121+ f"-DPython_LIBRARY_DIRS={ get_python_lib_path ()} "
122+ ]
123+
124124 if self .build_for_coverage :
125125 cmake_args += ["-DYUP_ENABLE_COVERAGE:BOOL=ON" ]
126126
0 commit comments