rwols / CMakeBuilder

Configure, build and test a CMake project right from within Sublime Text 3.
MIT License
30 stars 14 forks source link

How do I configure parallel builds? #14

Closed alt-vlad1q closed 3 years ago

alt-vlad1q commented 4 years ago

Hello, in old versions of the plugin, system_builds were generated with the -j {max_count_threads} flag, how to set the flag in the new version? Because now by default, the assembly goes in one thread. Which method is correct?

"env" : {"CMAKE_BUILD_PARALLEL_LEVEL": "8"}

or to class CmakeBuildCommand add:

cmd = [get_cmake_binary(), "--build", ".", "--config", config]
if build_target:
    cmd.extend(["--target", build_target])
cmd.extend(["-j8"])
rwols commented 4 years ago

You can set the environment variable MAKE_FLAGS to -j8 I believe:

"env" : {"MAKE_FLAGS": "-j8"}
rwols commented 4 years ago

I would use CMAKE_BUILD_PARALLEL_LEVEL because your other option breaks generators like MSVC or Ninja

alt-vlad1q commented 4 years ago

well thank you