summarylogtreecommitdiffstats
path: root/ffmpeg-parallel-build-use-processorcount.patch
diff options
context:
space:
mode:
Diffstat (limited to 'ffmpeg-parallel-build-use-processorcount.patch')
-rw-r--r--ffmpeg-parallel-build-use-processorcount.patch21
1 files changed, 21 insertions, 0 deletions
diff --git a/ffmpeg-parallel-build-use-processorcount.patch b/ffmpeg-parallel-build-use-processorcount.patch
new file mode 100644
index 00000000000..64717ed0911
--- /dev/null
+++ b/ffmpeg-parallel-build-use-processorcount.patch
@@ -0,0 +1,21 @@
+diff --git a/cmake/admFFmpegBuild.cmake b/cmake/admFFmpegBuild.cmake
+index 317c7dc..32cf4b8 100644
+--- a/cmake/admFFmpegBuild.cmake
++++ b/cmake/admFFmpegBuild.cmake
+@@ -305,9 +305,15 @@ convertPathToUnix(ffmpeg_gnumake_executable ${BASH_EXECUTABLE})
+ configure_file("${AVIDEMUX_TOP_SOURCE_DIR}/cmake/ffmpeg_make.sh.cmake" "${FFMPEG_BINARY_DIR}/ffmpeg_make.sh")
+ registerFFmpeg("${FFMPEG_SOURCE_DIR}" "${FFMPEG_BINARY_DIR}" 0)
+
++include(ProcessorCount)
++ProcessorCount(N)
++if(NOT N EQUAL 0)
++ set(JOBS_IN_PARALLEL -j${N})
++endif(NOT N EQUAL 0)
++
+ if(CMAKE_HOST_UNIX)
+ add_custom_target( libavutil_dummy
+- COMMAND ${CMAKE_BUILD_TOOL} -j 4 # We assume make or gnumake when host is unix
++ COMMAND ${CMAKE_MAKE_PROGRAM} ${JOBS_IN_PARALLEL} # We assume make or gnumake when host is unix
+ WORKING_DIRECTORY "${FFMPEG_BINARY_DIR}")
+ else(CMAKE_HOST_UNIX)
+ add_custom_target( libavutil_dummy