Skip to content

Commit

Permalink
Parallelize the build.
Browse files Browse the repository at this point in the history
  • Loading branch information
SlawekNowy committed Jan 15, 2024
1 parent 632f2b2 commit 446d151
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1143,14 +1143,14 @@ pragma_install(wgui "${BINARY_OUTPUT_DIR}")

message("Custom install targets: ${PRAGMA_INSTALL_CUSTOM_TARGETS}")
add_custom_target(pragma-install
DEPENDS pragma iclient iserver ${PRAGMA_INSTALL_CUSTOM_TARGETS}
DEPENDS pragma-install-full ${PRAGMA_INSTALL_CUSTOM_TARGETS}
COMMAND
"${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=${PRAGMA_INSTALL_COMPONENT}
-DBUILD_TYPE=${CMAKE_BUILD_TYPE}
-P "${CMAKE_BINARY_DIR}/cmake_install.cmake"
)
add_custom_target(pragma-install-full
DEPENDS pragma-install
DEPENDS pragma iclient iserver
COMMAND
"${CMAKE_COMMAND}" -DCMAKE_INSTALL_COMPONENT=${PRAGMA_INSTALL_COMPONENT_FULL}
-DBUILD_TYPE=${CMAKE_BUILD_TYPE}
Expand Down
11 changes: 8 additions & 3 deletions build_scripts/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -985,15 +985,20 @@ def download_addon(name,addonName,url,commitId=None):
print_msg("Building Pragma...")

os.chdir(build_dir)
targets = ["pragma-install-full"]


print_msg("Running build command...")
cmake_build(build_config,["pragma-install-full"])
targets = []
if with_pfm:
targets.append("pfm")
targets += additional_build_targets
targets.append("pragma-install")
#targets.append("pragma-install")

print_msg("Running build command...")
cmake_build(build_config,targets)

cmake_build(build_config,["pragma-install"])




Expand Down
3 changes: 3 additions & 0 deletions build_scripts/scripts/shared.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import tarfile
import urllib.request
import zipfile
import multiprocessing
from pathlib import Path
from urllib.parse import urlparse
from sys import platform
Expand Down Expand Up @@ -78,6 +79,8 @@ def cmake_build(buildConfig,targets=None):
if targets:
args.append("--target")
args += targets
args.append("--parallel")
args.append(multiprocessing.cpu_count())
subprocess.run(args,check=True)

def mkdir(dirName,cd=False):
Expand Down

0 comments on commit 446d151

Please sign in to comment.