Skip to content

Commit a32c8b2

Browse files
committed
build: add support for installing clang-tidy
1 parent 4ef7502 commit a32c8b2

File tree

2 files changed

+42
-16
lines changed

2 files changed

+42
-16
lines changed

tools/make/common.mk

Lines changed: 41 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,12 @@ GIT_BRANCH ?= $(GIT) rev-parse --abbrev-ref HEAD
216216
# Define the command for CMake:
217217
CMAKE ?= cmake
218218

219+
# Define the command for clang-format:
220+
CLANG_FORMAT ?= $(DEPS_LLVM_CLANG_FORMAT)
221+
222+
# Define the command for clang-tidy:
223+
CLANG_TIDY ?= $(DEPS_LLVM_CLANG_TIDY)
224+
219225
# Determine the `open` command:
220226
ifeq ($(OS), Darwin)
221227
OPEN ?= open
@@ -385,18 +391,11 @@ endif
385391

386392
# EXTERNAL DEPENDENCIES #
387393

388-
# Define the BLAS library to use:
389-
BLAS ?=
390-
391-
# Define the path to the BLAS library (used for includes and linking):
392-
BLAS_DIR ?=
393-
394-
# Define the primary integer type to use in BLAS routines:
395-
CBLAS_INT ?=
396-
397394
# Define the path for building dependencies:
398395
DEPS_BUILD_DIR ?= $(DEPS_DIR)/build
399396

397+
# Boost...
398+
400399
# Define the Boost version:
401400
DEPS_BOOST_VERSION ?= 1.69.0
402401

@@ -406,6 +405,19 @@ deps_boost_version_slug := $(subst .,_,$(DEPS_BOOST_VERSION))
406405
# Define the output path when building Boost:
407406
DEPS_BOOST_BUILD_OUT ?= $(DEPS_BUILD_DIR)/boost_$(deps_boost_version_slug)
408407

408+
# BLAS (general)...
409+
410+
# Define the BLAS library to use:
411+
BLAS ?=
412+
413+
# Define the path to the BLAS library (used for includes and linking):
414+
BLAS_DIR ?=
415+
416+
# Define the primary integer type to use in BLAS routines:
417+
CBLAS_INT ?=
418+
419+
# OpenBLAS...
420+
409421
# Define the OpenBLAS version:
410422
DEPS_OPENBLAS_VERSION ?= 0.3.27
411423

@@ -493,6 +505,8 @@ ifeq (, $(BLAS_DIR))
493505
endif
494506
endif
495507

508+
# LLVM...
509+
496510
# Define the output path when building LLVM:
497511
DEPS_LLVM_BUILD_OUT ?= $(DEPS_BUILD_DIR)/llvm
498512

@@ -502,12 +516,20 @@ DEPS_LLVM_VERSION ?=
502516
# Define the path to the LLVM clang compiler:
503517
DEPS_LLVM_CLANG ?= $(DEPS_LLVM_BUILD_OUT)/build/bin/clang
504518

519+
# Define the path to the clang format utility:
520+
DEPS_LLVM_CLANG_FORMAT ?= $(DEPS_LLVM_BUILD_OUT)/build/bin/clang-format
521+
522+
# Define the path to the clang tidy utility:
523+
DEPS_LLVM_CLANG_TIDY ?= $(DEPS_LLVM_BUILD_OUT)/build/bin/clang-tidy
524+
505525
# Define the path to the LLVM archiver:
506526
DEPS_LLVM_AR ?= $(DEPS_LLVM_BUILD_OUT)/build/bin/llvm-ar
507527

508528
# Define the path to the LLVM tool for listing LLVM bitcode and object file symbol tables:
509529
DEPS_LLVM_NM ?= $(DEPS_LLVM_BUILD_OUT)/build/bin/llvm-nm
510530

531+
# WebAssembly System Interface (WASI)...
532+
511533
# Define the output path when building WASI libc:
512534
DEPS_WASI_LIBC_BUILD_OUT ?= $(DEPS_BUILD_DIR)/wasi-libc
513535

@@ -517,6 +539,8 @@ DEPS_WASI_LIBC_VERSION ?=
517539
# Define the path to WASI libc sysroot:
518540
DEPS_WASI_LIBC_SYSROOT ?= $(DEPS_WASI_LIBC_BUILD_OUT)/sysroot
519541

542+
# EMSDK...
543+
520544
# Define the output path when building the Emscripten SDK:
521545
DEPS_EMSDK_BUILD_OUT ?= $(DEPS_BUILD_DIR)/emsdk
522546

@@ -544,6 +568,8 @@ DEPS_WABT_WASM2WAT ?= $(DEPS_WABT_BUILD_OUT)/build/wasm2wat
544568
# Define the path to the utility for converting WebAssembly text format files to the WebAssembly binary format:
545569
DEPS_WABT_WAT2WASM ?= $(DEPS_WABT_BUILD_OUT)/build/wat2wasm
546570

571+
# Cephes...
572+
547573
# Define the Cephes distribution to build (netlib, moshier, cephes-2.8):
548574
DEPS_CEPHES_DIST ?= moshier
549575

@@ -604,6 +630,8 @@ else
604630
endif
605631
endif
606632

633+
# Electron...
634+
607635
# Define the Electron version:
608636
DEPS_ELECTRON_VERSION ?= 25.3.1
609637

@@ -619,6 +647,8 @@ DEPS_ELECTRON_ARCH := $(shell command -v $(NODE) >/dev/null 2>&1 && $(NODE_HOST_
619647
# Host platform:
620648
DEPS_ELECTRON_PLATFORM := $(shell command -v $(NODE) >/dev/null 2>&1 && $(NODE_HOST_PLATFORM))
621649

650+
# Shellcheck...
651+
622652
# Define the shellcheck version:
623653
DEPS_SHELLCHECK_VERSION ?= 0.8.0
624654

@@ -634,6 +664,8 @@ DEPS_SHELLCHECK_ARCH := $(shell command -v $(NODE) >/dev/null 2>&1 && $(NODE_HOS
634664
# Host platform:
635665
DEPS_SHELLCHECK_PLATFORM := $(shell command -v $(NODE) >/dev/null 2>&1 && $(NODE_HOST_PLATFORM))
636666

667+
# cppcheck...
668+
637669
# Define the cppcheck version:
638670
DEPS_CPPCHECK_VERSION ?= 2.15.0
639671

@@ -645,9 +677,3 @@ DEPS_CPPCHECK_BUILD_OUT ?= $(DEPS_BUILD_DIR)/cppcheck_$(deps_cppcheck_version_sl
645677

646678
# Host platform:
647679
DEPS_CPPCHECK_PLATFORM := $(shell command -v $(NODE) >/dev/null 2>&1 && $(NODE_HOST_PLATFORM))
648-
649-
# API key for the stdlib scaffolding service:
650-
ifneq ($(wildcard .stdlibrc),)
651-
include .stdlibrc
652-
export SCAFFOLD_API_KEY
653-
endif

tools/make/lib/install/llvm.mk

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ deps-prerequisites-llvm:
160160
#/
161161
deps-install-llvm: $(DEPS_LLVM_BUILD_OUT) deps-prerequisites-llvm
162162
$(QUIET) cd $(DEPS_LLVM_BUILD_OUT) && $(MKDIR_RECURSIVE) build
163-
$(QUIET) cd $(DEPS_LLVM_BUILD_OUT)/build && $(CMAKE) -DLLVM_ENABLE_PROJECTS="clang;lld" -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ../llvm
163+
$(QUIET) cd $(DEPS_LLVM_BUILD_OUT)/build && $(CMAKE) -DLLVM_ENABLE_PROJECTS="clang;lld;clang-tools-extra" -DCMAKE_BUILD_TYPE=Release -G "Unix Makefiles" ../llvm
164164
$(QUIET) cd $(DEPS_LLVM_BUILD_OUT)/build && $(MAKE)
165165

166166
.PHONY: deps-install-llvm

0 commit comments

Comments
 (0)