0

Imagine I have a build directory produced by CMake with gmake (or ninja) as a generator.

Is the following bash snippet a valid usage of make (and the same question for ninja)?

# make&
# make

I am asking because the following solution may lead to this kind of situation, e.g., by running ctest -j 12: CMake & CTest : make test doesn't build tests

Nikita Petrenko
  • 1,068
  • 1
  • 7
  • 10
  • Building as root is always a bad idea. Running two instances of make or ninja on the same directory at the same time will pretty much always lead to disaster and corrupted builds... probably requiring a full clean and rebuild to resolve. – MadScientist Jul 09 '21 at 16:05

1 Answers1

0

Running multiple build system processes concurrently

There is no synchronization mechanisms. They will just run twice without any synchronization.

From experience in most cases, running make (or Ninja) at the same time twice, will run each build step twice overwriting each other in random order, whichever will finish first.

KamilCuk
  • 120,984
  • 8
  • 59
  • 111