Skip to content

Instantly share code, notes, and snippets.

@aicreatbyme
Created June 10, 2022 08:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save aicreatbyme/5fb8ed3ebd09a06cbdefd7112784a948 to your computer and use it in GitHub Desktop.
Save aicreatbyme/5fb8ed3ebd09a06cbdefd7112784a948 to your computer and use it in GitHub Desktop.
#! /bin/bash
mkdir build
cd build
# change the path plz
export CC=/path/to/clang; export CXX=/path/to/clang++
export ADDITIONAL="-flto -fuse-ld=gold -Wl,-plugin-opt=save-temps"
# which will make original CFLAGS disable, if you still need the former one add "set(CFLAGS += "$ADDITIONAL")" in CMakeLists.txt
CFLAGS="$ADDITIONAL" CXXFLAGS="$ADDITIONAL" cmake ..
make
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment