Home > Software engineering >  Conan require build in different runtime
Conan require build in different runtime

Time:12-07

I'm beginners in Conan. I would like to add a requirement to my projet and link this requirement in static. But I have a runtime issue, my project need to be build on '/MD' but Conan still compile my requirement on '/MT'.

In my case I would like boost on static but in 'MD' runtime.

from conans import ConanFile
class MyProject(ConanFile):
    requires = "zlib/1.2.13", "boost/1.80.0", "cpprestsdk/2.10.18", "opencv/4.5.5", "geogram/1.8.2@lib/dynamic"
    generators = "visual_studio"
    default_options = {"cpprestsdk:shared": True, "opencv:shared": True, "geogram:shared": True}
    
    settings = "os", "compiler", "build_type", "arch"   
            
    def configure(self):
        self.settings.compiler.version = "17"

CodePudding user response:

I found a solution related to my problem which, I guess, should work only with Boost require.

def package_info(self):
    self.cpp_info.cxxflags = "-runtime-link=shared" #will compile on "/MD" runtime
   

I explore a bit the cmake of Boost and I found some condition related to the runtime.

  • Related