colcon / colcon-ros

Extension for colcon to support ROS packages
http://colcon.readthedocs.io
Apache License 2.0
13 stars 26 forks source link

Use $CXX env variable when available for determining multiarch #125

Open johnwason opened 3 years ago

johnwason commented 3 years ago

The function get_multiarch() calls gcc using subprocess. gcc is hard coded, and does not check the CXX env variable. This breaks a lot of build environments, including conda-smithy which uses prefixed gcc executable, and sets CXX to the correct location. This will also break cross compilers that use prefixes.

https://github.com/colcon/colcon-ros/blob/eb0b932cf7b1f3f5a720804e67f3c1a0f8995ca8/colcon_ros/task/cmake/__init__.py#L46

cottsay commented 2 years ago

Using the CXX variable seems reasonable to me, especially in the context of CMake, which also uses that variable.

Please consider opening a PR to change the referenced code to use CXX.