conan: Can't use cmake generator "NMake Makefiles" with conan
If I set environment variable CONAN_CMAKE_GENERATOR to"NMake Makefiles", conan correctly passes -G "NMake Makefiles"
to cmake during configure but build fails with
NMAKE : fatal error U1065: invalid option 'j'
Stop.
ERROR: PROJECT: Error in build() method, line 30
cmake.build()
ConanException: Error 2 while executing cmake --build C:\Work\conan-test\build -- -j4
the problem is here: https://github.com/conan-io/conan/blob/develop/conans/client/build/cmake.py
if "Makefiles" in self.generator:
if "--" not in args:
args.append("--")
args.append("-j%i" % cpu_count())
You always add -j flag for Makefiles generators but NMake does not understand that.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 25 (20 by maintainers)
Yes, it works for me. Thanks a lot!
@memsharded,
That’s quite obvious. For
Visual Studio
generator cmake knows the target toolchain and architecture from its name (likeVisual Studio 15 2017 Win64
). That’s not the case forNMake Makefiles
. So cmake should rely oncl
that it finds in the path. I believe it also applies to Ninja.