Skip to content

Commit

Permalink
Fix Python not being found for lttngpy in Windows debug mode (#87)
Browse files Browse the repository at this point in the history
Signed-off-by: Christophe Bedard <[email protected]>
  • Loading branch information
christophebedard-apexai authored Jan 12, 2024
1 parent ed6f435 commit db5ef98
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lttngpy/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# Figure out Python3 debug/release before anything else can find_package it
if(WIN32 AND CMAKE_BUILD_TYPE STREQUAL "Debug")
find_package(python_cmake_module REQUIRED)
find_package(PythonExtra REQUIRED)

# Force FindPython3 to use the debug interpreter where ROS 2 expects it
set(Python3_EXECUTABLE "${PYTHON_EXECUTABLE_DEBUG}")
endif()

find_package(ament_cmake REQUIRED)

if(WIN32 OR APPLE OR ANDROID)
Expand Down

0 comments on commit db5ef98

Please sign in to comment.