diff --git a/.github/workflows/emu-deps-linux.yml b/.github/workflows/emu-deps-linux.yml index 73834c62..bb24ed70 100644 --- a/.github/workflows/emu-deps-linux.yml +++ b/.github/workflows/emu-deps-linux.yml @@ -85,4 +85,4 @@ jobs: run: | export CMAKE_GENERATOR="Unix Makefiles" sudo chmod 777 ./${{env.THIRD_PARTY_BASE_DIR}}/common/linux/premake/premake5 - ./${{env.THIRD_PARTY_BASE_DIR}}/common/linux/premake/premake5 --file=premake5-deps.lua --64-build --32-build --all-ext --all-build --verbose --clean --os=linux gmake2 + ./${{env.THIRD_PARTY_BASE_DIR}}/common/linux/premake/premake5 --file=premake5-deps.lua --64-build --32-build --all-ext --all-build --j=2 --verbose --clean --os=linux gmake2 diff --git a/.github/workflows/emu-deps-win.yml b/.github/workflows/emu-deps-win.yml index e45b9390..10ddffca 100644 --- a/.github/workflows/emu-deps-win.yml +++ b/.github/workflows/emu-deps-win.yml @@ -79,4 +79,4 @@ jobs: working-directory: ${{ github.workspace }} run: | set "CMAKE_GENERATOR=Visual Studio 17 2022" - "${{env.THIRD_PARTY_BASE_DIR}}\common\win\premake\premake5.exe" --file=premake5-deps.lua --64-build --32-build --all-ext --all-build --verbose --clean --os=windows vs2022 + "${{env.THIRD_PARTY_BASE_DIR}}\common\win\premake\premake5.exe" --file=premake5-deps.lua --64-build --32-build --all-ext --all-build --j=2 --verbose --clean --os=windows vs2022 diff --git a/premake5-deps.lua b/premake5-deps.lua index 2800ce4d..b4bff7d9 100644 --- a/premake5-deps.lua +++ b/premake5-deps.lua @@ -84,6 +84,11 @@ newoption { trigger = "all-build", description = "Build all deps", } +newoption { + category = "build", + trigger = "j", + description = "Parallel build jobs, by default the max possible", +} newoption { category = "build", trigger = "32-build", @@ -142,6 +147,10 @@ local function merge_list(src, dest) end +if _OPTIONS['j'] and not string.match(_OPTIONS['j'], '^[1-9]+$') then + error("Invalid argument for --j") +end + -- common defs --------- @@ -325,7 +334,11 @@ local function cmake_build(dep_folder, is_32, extra_cmd_defs, c_flags_init, cxx_ end -- build with cmake - local ok = os.execute(mycmake .. ' --build "' .. build_dir .. '" --config Release --parallel' .. verbose_build_str) + local parallel_str = ' --parallel' + if _OPTIONS['j'] then + parallel_str = parallel_str .. ' ' .. _OPTIONS['j'] + end + local ok = os.execute(mycmake .. ' --build "' .. build_dir .. '" --config Release' .. parallel_str .. verbose_build_str) if not ok then error("failed to build") return