This is a simple need of selecting build type when calling conan build.
Normally we have to call conan install with the desired build type and then conan build with the following commands :
conan install conanfile.py install -s build_type=Debug
conan build conanfile.py
I have seen that we can force conan to do an install with the build command using --intall. I have tried the following command but it does not update the settings.build_type value.
conan build conanfile.py --install -s build_type=Release
Does any one have an idea how to change the build type with conan build command or at least pass a variables to be checked later in the conanfile.py
Thanks in advance
The
conan buildcommand will use whatever configuration was provided to theconan installcommand. So the way to change configuration (settings, options, etc) is to do aconan installwith the right configuration.When a
conan installcommand is executed it will create information about dependencies for the current configuration (profile, settings, options), and will generate files as conanbuildinfo.cmake as defined by the Conan generators. Theconan buildcommand will use those files to find the right dependencies binaries for that configuration. Trying toconan buildwith a different configuration without updating the dependencies generated files will typically result in compile or link errors for using the incorrect dependencies binaries.