Skip to content

Problem with tools.build:compiler_executables and NMakeToolchain #722

@hwelzel

Description

@hwelzel

Hello,

I am not sure this is a problem in cmake-conan or conan (or even conan-center-index in case its the recipe) but I am reporting it here for now.
When building sqlcipher on windows with the following settings...

[settings]
arch=x86_64
build_type=Release
compiler=msvc
compiler.cppstd=23
compiler.runtime=static
compiler.runtime_type=Release
compiler.version=194
os=Windows

I get a bunch of weird errors which came down to nmake silently failing cl because it had a path with forward slashes in the body of the target. ps. curiously running the same cl command from cmd with forward slashes it is fine.
The CC variable comes from NMakeToolchain's conannmaketoolchain.bat which, among other things, has these entries...

set "CC=C:/apps/MVS17124/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe"
set "CPP=C:/apps/MVS17124/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe"
set "CXX=C:/apps/MVS17124/VC/Tools/MSVC/14.42.34433/bin/Hostx64/x64/cl.exe"
set "RC=C:/Program Files (x86)/Windows Kits/10/bin/10.0.26100.0/x64/rc.exe"

...which, as far as I can tell, come from the tools.build:compiler_executables profile setup in conan_provider.cmake append_compiler_executables_configuration.

I hacked my CMakeLists.txt to do a temporary replacement before the first call to find_package (and after it I undo it)...
string(REPLACE "/" "\\" CMAKE_C_COMPILER "${CMAKE_C_COMPILER}")
...and the sqlcipher recipe succeeds to build (because conannmaketoolchain.bat will have set CC with windows backward slashes).

Like I said, I am not sure this is a problem with cmake-conan ie if it should handle native forward slashes instead of backward on windows.
Or if NMakeToolchain should do a better job at generating those "set =" lines.
Or if the sqlcipher recipe should have a patch to handle/fix this on their build system side.
In any case I would appreciate any help.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions