[libcxx-commits] [PATCH] D107715: [libc++][NFC] Resolve Python 2 FIXME

Joe Loser via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Fri Nov 12 09:22:51 PST 2021


jloser added inline comments.


================
Comment at: libcxx/CMakeLists.txt:47
   if(NOT Python3_Interpreter_FOUND)
-    message(WARNING "Python3 not found, using python2 as a fallback")
-    find_package(Python2 COMPONENTS Interpreter REQUIRED)
-    if(Python2_VERSION VERSION_LESS 2.7)
-      message(SEND_ERROR "Python 2.7 or newer is required")
-    endif()
-
-    # Treat python2 as python3
-    add_executable(Python3::Interpreter IMPORTED)
-    set_target_properties(Python3::Interpreter PROPERTIES
-      IMPORTED_LOCATION ${Python2_EXECUTABLE})
-    set(Python3_EXECUTABLE ${Python2_EXECUTABLE})
+    message(SEND_ERROR "Python3 not found. Python3 is required")
   endif()
----------------
gAlfonso-bit wrote:
> xgupta wrote:
> > jloser wrote:
> > > Does this message provide anything useful from just adding `REQUIRED` argument to the `find_package(Python3 COMPONENTS Interpreter)` right above?
> > @gAlfonso-bit can you address this comment. so I can commit this patch on your behalf.
> I mean, it tells the user Python 3 will be required. I admit it's a little quick and dirty but this will be expanded upon in future patches.
I don't think it adds additional value over the error that would be provided by `find_package` at CMake configure time, but I won't block your review on it - just food for thought.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D107715/new/

https://reviews.llvm.org/D107715



More information about the libcxx-commits mailing list