-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
cmake: move a few bits to separate files
just because i feel CMakeLists.txt is getting too large
- Loading branch information
Showing
3 changed files
with
209 additions
and
207 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
if(NOT DEFINED PREFER_BREW_LLVM) | ||
set(PREFER_BREW_LLVM ON) | ||
endif() | ||
if(NOT CMAKE_TOOLCHAIN_FILE AND PREFER_BREW_LLVM) | ||
# Prefer the homebrew version because xcode clang doesn't have detect_leaks | ||
# Note: CMAKE_SYSTEM_NAME is not available yet. | ||
set(BREW_LLVM_HOME /usr/local/opt/llvm@13) | ||
find_program(BREW_CLANG ${BREW_LLVM_HOME}/bin/clang) | ||
if(BREW_CLANG) | ||
set(CMAKE_C_COMPILER ${BREW_CLANG} CACHE FILEPATH "brew llvm clang" FORCE) | ||
find_program(BREW_AR ${BREW_LLVM_HOME}/bin/llvm-ar REQUIRED) | ||
set(CMAKE_AR ${BREW_AR} CACHE FILEPATH "brew llvm ar" FORCE) | ||
set(CMAKE_C_COMPILER_AR ${BREW_AR} CACHE FILEPATH "brew llvm ar" FORCE) | ||
find_program(BREW_RANLIB ${BREW_LLVM_HOME}/bin/llvm-ranlib REQUIRED) | ||
set(CMAKE_RANLIB ${BREW_RANLIB} CACHE FILEPATH "brew llvm ar" FORCE) | ||
set(CMAKE_C_COMPILER_RANLIB ${BREW_RANLIB} CACHE FILEPATH "brew llvm ranlib" FORCE) | ||
endif() | ||
endif() |
Oops, something went wrong.