cmake and parallel building with “make -jN”

后端 未结 4 1137
失恋的感觉
失恋的感觉 2021-02-02 16:04

I\'m trying to setup a parallel CMake-based build for my source tree, but when I issue

$ cmake .
$ make -j2

I get:

jobserver un         


        
4条回答
  •  小鲜肉
    小鲜肉 (楼主)
    2021-02-02 16:24

    In the generated Makefile, when calling into a sub-make it needs to either use $(MAKE) (not just 'make') or else precede the line with a +. That is, a rule should look like this:

    mysubdir:
        $(MAKE) -C mysubdir
    

    or like this:

    mysubdir:
        +make -C mysubdir
    

    If you don't do it one of those two ways, make will give you that warning.

    I don't know anything about cmake, so maybe it's generating Makefiles that aren't correct. Or maybe you did something incorrectly on your end.

提交回复
热议问题