This seems subtle, but for some reason it makes a big difference. If you set the environment variables before running `cmake`, they get ignored. After many, many attempts I finally figured out this solution - which worked great on my Mac.
- list-licenses.sh assumed GNU versions (e.g. the "-printf" flag of
find) but Mac ships with a non-GNU version
- this led to error
[8677/8942] Generating StorageSystemLicenses.generated.cpp
find: -printf: unknown primary or operator
find: -printf: unknown primary or operator
find: -printf: unknown primary or operator
find: -printf: unknown primary or operator
during build and as a result, an empty system.licenses table
- As a fix, force the GNU versions of find and grep on Mac
On Darwin, the build script tries to
1. use llvm-objcopy/llvm-strip from $PATH,
2. if not found by 1., use standard objcopy/strip from $PATH
The brew install instructions recommends to set $PATH to brew's binary
dir, so 2. will find something (assuming binutils is installed from
brew). If $PATH additionally points to brew's LLVM binary dir (which is
different from brew's binary dir), 1. will find the llvm versions of the
tools.
This commit removes additional logic which repeats above steps in a more
implicit way by calling brew internally and figuring out the paths once
more if 1. and 2. cannot find them in the $PATH. This removes
duplication and simplifies the script. Maybe it even helps with
reproducibility.
- instead of repeating Homebrew's installation steps (which may become
outdated), just point to their homepage
- Specify CC and CXX env variables instead of internal CMake variables,
CMake figure out paths to ar, ranlib and objcopy automatically
- use -S and -B parameters available in recent CMake versions to build
directly from the source directory
Remove extra '$' in the bach command list to ease copy-pasteing
Adjust comments for alternatives in commands
Add note about ARM (Apple Silicon) support