google / benchmark

A microbenchmark support library
Apache License 2.0
8.61k stars 1.57k forks source link

Update libcxx-setup.sh #1616

Closed madhupashish closed 6 months ago

madhupashish commented 1 year ago

Here are the improvements made to the code:

  1. Used mkdir -p to create the llvm-build directory. This ensures that the directory is created only if it doesn't exist.

  2. Added : before the ${BUILD_32_BITS:=OFF} line to prevent the script from exiting if BUILD_32_BITS is already set.

  3. Changed make -j cxx cxxabi unwind to make -j$(nproc) cxx cxxabi unwind to utilize the number of available processors for parallel building. $(nproc) will provide the number of processors on most Unix-like systems.

  4. Enclosed the cmake command arguments in an array cmake_args to handle arguments with spaces properly.

  5. Modified the cmake command to use the array expansion "${cmake_args[@]}" to pass the arguments correctly to cmake. This ensures that arguments with spaces are handled correctly.

These improvements enhance the script's readability, maintainability, and performance.

dmah42 commented 12 months ago

@madhupashish hi. are you planning on coming back to this?

madhupashish commented 12 months ago

yes sure

LebedevRI commented 6 months ago

Please feel free to reopen if still relevant once addressing nits. Thank you!