CMake module not automatically setting build and MSVC runtime type #8046
Labels
enhancement
module:cmake
Issues related to the cmake module, including cmake.subproject
subprojects/wraps
When building cURL as a CMake subproject on Windows with MSVC, I was running into linker errors with the VC runtime. It appears the larger Meson project's settings regarding the build type and
b_vscrt
are not passed down, so if the CMake subproject builds debug by default and the higher-level project is release or debugoptimized, you will be trying to link against two different versions of the runtime.In my case, I can solve this by just setting
MSVC_RUNTIME_LIBRARY
orCMAKE_BUILD_TYPE
(which will then default to the optimized runtime). I opted for the latter and now it links correctly, but I wanted to see if not propagating this is intentional or not. If it is, it might be worth mentioning this in the documentation, as I would not have guessed that it would be a problem.Meson version: 0.56.0
CMake version: 3.19.0
How I'm invoking the CMake module: https://github.com/TypesettingTools/ffi-experiments/blob/3b9efd7a8b4e93386e0bcbe84acf33a7a9ef8615/meson.build#L16-L41
The text was updated successfully, but these errors were encountered: