Skip to content

Commit

Permalink
Use python bundled in platformIO inside colcon build command by cmake…
Browse files Browse the repository at this point in the history
… option. (micro-ROS#108)
  • Loading branch information
maru-n authored Oct 24, 2023
1 parent 841dc13 commit e87705f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions microros_utils/library_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def download_dev_environment(self):

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

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

common_meta_path = self.library_folder + '/metas/common.meta'
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)
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)
command = "cd {} && . {}/install/setup.sh && {}".format(self.mcu_folder, self.dev_folder, colcon_command)
result = run_cmd(command, env=self.env)

Expand Down

0 comments on commit e87705f

Please sign in to comment.