File tree Expand file tree Collapse file tree 2 files changed +21
-6
lines changed
Expand file tree Collapse file tree 2 files changed +21
-6
lines changed Original file line number Diff line number Diff line change @@ -120,7 +120,26 @@ function (_yup_fetch_python use_static_libs modules)
120120 endif ()
121121
122122 set (Python_USE_STATIC_LIBS "${use_static_libs} " )
123- find_package (Python REQUIRED COMPONENTS ${modules} )
124123
124+ find_package (Python QUIET COMPONENTS ${modules} )
125+
126+ if (NOT Python_FOUND)
127+ string (REPLACE "Development.Module" "Development" fallback_modules "${modules} " )
128+ if (NOT "${fallback_modules} " STREQUAL "${modules} " )
129+ find_package (Python QUIET COMPONENTS ${fallback_modules} )
130+ endif ()
131+
132+ if (NOT Python_FOUND)
133+ find_package (Python QUIET COMPONENTS Interpreter Development)
134+ endif ()
135+
136+ if (NOT Python_FOUND)
137+ find_package (Python QUIET COMPONENTS Interpreter)
138+ endif ()
139+ endif ()
140+
141+ if (NOT Python_FOUND)
142+ find_package (Python REQUIRED COMPONENTS ${modules} )
143+ endif ()
125144endfunction ()
126145
Original file line number Diff line number Diff line change @@ -531,11 +531,7 @@ function (yup_add_module module_path modules_definitions module_group)
531531 list (APPEND module_link_options "-Wl,-weak_reference_mismatches,weak" )
532532 endif ()
533533 else ()
534- if (YUP_PLATFORM_LINUX)
535- set (python_modules "Interpreter;Development.Module" )
536- else ()
537- set (python_modules "Interpreter;Development" )
538- endif ()
534+ set (python_modules "Interpreter;Development.Module" )
539535 list (APPEND module_libs Python::Module)
540536 endif ()
541537
You can’t perform that action at this time.
0 commit comments