colcon / colcon-cmake

Extension for colcon to support CMake packages
http://colcon.readthedocs.io
Apache License 2.0
16 stars 25 forks source link

Option to select target platform (e.g. "Visual Studio 15 2017" 32bit) #45

Closed Marosso closed 5 years ago

Marosso commented 5 years ago

Hi,

I'm coming here from https://answers.ros.org/question/324217/ros2-for-win32-x86-how-to-make-colcon-call-cmake-without-win64/

I need to build ROS2 for Win32 and I am missing the option to select the cmake target platform "Visual Studio 15 2017". Is it possible to pass this as an argument? Or could I just remove the "Win64" here: https://github.com/colcon/colcon-cmake/blob/14ccfdc4aab94e2376d46c3906d7fc5d0c797c4b/colcon_cmake/task/cmake/build.py#L147-L162 ?

Thanks marosso

dirk-thomas commented 5 years ago

As a temporary workaround you can remove the Win64 part. Up to Visual Studio 2017 the CMake generator will default to 32 bit (as of Visual 2019 it will default to the hosts architecture).

In order to allow the user to choose the legacy names including the architecture should be dropped in favor of passing -G and -A separately. Then an explicitly provided -A should override the default.

dirk-thomas commented 5 years ago

Please see #46 which enables to pass -A to specify custom architectures for VS 15 and older.

@Marosso It would be great if you could comment if this works for your use case.