summarylogtreecommitdiffstats
path: root/ffmpeg-parallel-build-use-processorcount.patch
blob: ef2db8a46fafd7c6c8425e27702abb77ce763cda (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
diff --git a/cmake/admFFmpegBuild_helpers.cmake b/cmake/admFFmpegBuild_helpers.cmake
index 0d8cd846..131b278b 100644
--- a/cmake/admFFmpegBuild_helpers.cmake
+++ b/cmake/admFFmpegBuild_helpers.cmake
@@ -297,7 +297,11 @@ MACRO(ADM_FF_BUILD_UNIX_STYLE)
 #
 MACRO(ADM_FF_ADD_DUMMY_TARGET)
     if(NOT MSVC)
-       SET(PARRALLEL "-j4") 
+        include(ProcessorCount)^M
+        ProcessorCount(N)^M
+        if(NOT N EQUAL 0)^M
+           SET(PARRALLEL -j${N})^M
+        endif(NOT N EQUAL 0)^M
     endif(NOT MSVC)
     add_custom_target(         libavutil_dummy ALL
                                        COMMAND ${CMAKE_BUILD_TOOL}  ${PARRALLEL} # We assume make or gnumake when host is unix