From 807a9ef70e4f8a47f62dd6a600d076b6f90b0e14 Mon Sep 17 00:00:00 2001 From: wsnipex Date: Sat, 9 May 2020 11:27:08 +0200 Subject: [cmake] allow ffmpeg and libdvd to build in parallel when using ninja --- tools/depends/target/ffmpeg/CMakeLists.txt | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'tools/depends/target/ffmpeg') diff --git a/tools/depends/target/ffmpeg/CMakeLists.txt b/tools/depends/target/ffmpeg/CMakeLists.txt index 3ebd65cf13..ac27049cdb 100644 --- a/tools/depends/target/ffmpeg/CMakeLists.txt +++ b/tools/depends/target/ffmpeg/CMakeLists.txt @@ -99,6 +99,16 @@ endif() message(STATUS "FFMPEG_CONF: ${ffmpeg_conf}") +set(MAKE_COMMAND $(MAKE)) +if(CMAKE_GENERATOR STREQUAL Ninja) + set(MAKE_COMMAND make) + include(ProcessorCount) + ProcessorCount(N) + if(NOT N EQUAL 0) + set(MAKE_COMMAND make -j${N}) + endif() +endif() + include(ExternalProject) externalproject_add(ffmpeg SOURCE_DIR ${CMAKE_SOURCE_DIR} @@ -124,7 +134,8 @@ externalproject_add(ffmpeg --enable-protocol=http --enable-encoder=png --enable-encoder=mjpeg - ${ffmpeg_conf}) + ${ffmpeg_conf} + BUILD_COMMAND ${MAKE_COMMAND}) install(CODE "Message(Done)") -- cgit v1.2.3