Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion tools/check-cppcheck.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,13 @@
# See the License for the specific language governing permissions and
# limitations under the License.

CPPCHECK_JOBS=${CPPCHECK_JOBS:=$(nproc)}
if [[ "$OSTYPE" == "linux"* ]]; then
CPPCHECK_JOBS=${CPPCHECK_JOBS:=$(nproc)}
elif [[ "$OSTYPE" == "darwin"* ]]; then
CPPCHECK_JOBS=${CPPCHECK_JOBS:=$(sysctl -n hw.ncpu)}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for getting this work on OSX! This script becomes just a little bit incomplete, however. Please, add a final else branch that sets CPPCHECK_JOBS to something basic default, just to make sure that the script doesn't break. (E.g., if someone builds on freebsd, or whatever.) I'd go for a default of 1.

else
CPPCHECK_JOBS=${CPPCHECK_JOBS:=1}
fi

JERRY_CORE_DIRS=`find jerry-core -type d`
JERRY_LIBC_DIRS=`find jerry-libc -type d`
Expand Down