diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2023-01-31 15:09:36 +0100 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2023-01-31 15:34:10 +0100 |
commit | 682541d508ffcdc0b5dd0b96e8dec465ce3cae65 (patch) | |
tree | 79057a73e0bfd80960dffed987ed473be1f1595e | |
parent | 1022e731a5a5509c18f2a3c65b01bf4179a82eca (diff) | |
download | rules-cc-682541d508ffcdc0b5dd0b96e8dec465ce3cae65.tar.gz |
cmake: Support setting number of build jobs
-rw-r--r-- | CC/foreign/cmake/EXPRESSIONS | 15 | ||||
-rw-r--r-- | CC/foreign/cmake/RULES | 20 |
2 files changed, 33 insertions, 2 deletions
diff --git a/CC/foreign/cmake/EXPRESSIONS b/CC/foreign/cmake/EXPRESSIONS index 3b10de3..4dfcc07 100644 --- a/CC/foreign/cmake/EXPRESSIONS +++ b/CC/foreign/cmake/EXPRESSIONS @@ -3,6 +3,7 @@ [ "source_dir" , "cmake_options" , "cmake_defines" + , "cmake_jobs" , "pre_cmds" , "post_cmds" , "CC" @@ -80,6 +81,11 @@ } } ] + , [ "CMAKE_BUILD_PARALLEL_LEVEL" + , { "type": "join" + , "$1": {"type": "var", "name": "cmake_jobs", "default": []} + } + ] , [ "ENV" , { "type": "map_union" , "$1": @@ -92,7 +98,14 @@ } ] , [ { "type": "env" - , "vars": ["CC", "CXX", "CXXFLAGS", "CFLAGS", "LDFLAGS"] + , "vars": + [ "CC" + , "CXX" + , "CXXFLAGS" + , "CFLAGS" + , "LDFLAGS" + , "CMAKE_BUILD_PARALLEL_LEVEL" + ] } ] ] diff --git a/CC/foreign/cmake/RULES b/CC/foreign/cmake/RULES index e6ca125..8e8b934 100644 --- a/CC/foreign/cmake/RULES +++ b/CC/foreign/cmake/RULES @@ -2,7 +2,14 @@ { "doc": ["Data produced by CMake configure, build, and install."] , "target_fields": ["project"] , "string_fields": - ["options", "defines", "pre_cmds", "post_cmds", "out_files", "out_dirs"] + [ "options" + , "defines" + , "jobs" + , "pre_cmds" + , "post_cmds" + , "out_files" + , "out_dirs" + ] , "config_vars": [ "CC" , "CXX" @@ -28,6 +35,10 @@ [ "CMake defines for the configuration phase." , "(e.g., [\"CMAKE_BUILD_TYPE=Release\"])" ] + , "jobs": + [ "Number of jobs to run simultaneously. If omitted, CMake's default" + , "number is used." + ] , "pre_cmds": [ "List of commands executed in the project directory before calling" , "CMake. Useful for renaming files or directories. Note that data" @@ -152,6 +163,7 @@ ] , ["cmake_options", {"type": "FIELD", "name": "options"}] , ["cmake_defines", {"type": "FIELD", "name": "defines"}] + , ["cmake_jobs", {"type": "FIELD", "name": "jobs"}] , ["pre_cmds", {"type": "FIELD", "name": "pre_cmds"}] , ["post_cmds", {"type": "FIELD", "name": "post_cmds"}] , [ "full_install_dir" @@ -210,6 +222,7 @@ , "stage" , "options" , "defines" + , "jobs" , "pre_cmds" , "post_cmds" , "out_hdrs" @@ -258,6 +271,10 @@ [ "CMake defines for the configuration phase." , "(e.g., [\"CMAKE_BUILD_TYPE=Release\"])" ] + , "jobs": + [ "Number of jobs to run simultaneously. If omitted, CMake's default" + , "number is used." + ] , "pre_cmds": [ "List of commands executed in the project directory before calling" , "CMake. Useful for renaming files or directories. Note that data" @@ -491,6 +508,7 @@ ] , ["cmake_options", {"type": "FIELD", "name": "options"}] , ["cmake_defines", {"type": "FIELD", "name": "defines"}] + , ["cmake_jobs", {"type": "FIELD", "name": "jobs"}] , ["pre_cmds", {"type": "FIELD", "name": "pre_cmds"}] , ["post_cmds", {"type": "FIELD", "name": "post_cmds"}] , [ "full_install_dir" |