Skip to content

Commit e87705f

Browse files
authored
Use python bundled in platformIO inside colcon build command by cmake option. (#108)
1 parent 841dc13 commit e87705f

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

microros_utils/library_builder.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def download_dev_environment(self):
100100

101101
def build_dev_environment(self):
102102
print("Building micro-ROS dev dependencies")
103-
command = "cd {} && . {} && colcon build --cmake-args -DBUILD_TESTING=OFF".format(self.dev_folder, self.python_env)
103+
command = "cd {} && . {} && colcon build --cmake-args -DBUILD_TESTING=OFF -DPython3_EXECUTABLE=`which python`".format(self.dev_folder, self.python_env)
104104
result = run_cmd(command, env=self.env)
105105

106106
if 0 != result.returncode:
@@ -174,7 +174,7 @@ def build_mcu_environment(self, meta_file, toolchain_file, user_meta = ""):
174174
print("Building micro-ROS library")
175175

176176
common_meta_path = self.library_folder + '/metas/common.meta'
177-
colcon_command = '. {} && colcon build --merge-install --packages-ignore-regex=.*_cpp --metas {} {} {} --cmake-args -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=OFF -DTHIRDPARTY=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE={}'.format(self.python_env, common_meta_path, meta_file, user_meta, toolchain_file)
177+
colcon_command = '. {} && colcon build --merge-install --packages-ignore-regex=.*_cpp --metas {} {} {} --cmake-args -DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=OFF -DTHIRDPARTY=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_TOOLCHAIN_FILE={} -DPython3_EXECUTABLE=`which python`'.format(self.python_env, common_meta_path, meta_file, user_meta, toolchain_file)
178178
command = "cd {} && . {}/install/setup.sh && {}".format(self.mcu_folder, self.dev_folder, colcon_command)
179179
result = run_cmd(command, env=self.env)
180180

0 commit comments

Comments
 (0)