mirror of
https://github.com/PSI-Rockin/DobieStation.git
synced 2024-05-10 08:44:25 -04:00
cmake: add a toolchain file and convenience script for clang builds
This commit is contained in:
parent
1153eb3307
commit
64e95f6ad7
3
.gitignore
vendored
3
.gitignore
vendored
|
@ -9,7 +9,8 @@ demos
|
|||
.idea/
|
||||
CmakeSettings.json
|
||||
cmake-build-*/
|
||||
build
|
||||
build/
|
||||
build-clang/
|
||||
build-DobieStation-*
|
||||
debug
|
||||
release
|
||||
|
|
16
cmake/Toolchain-clang-linux-native.cmake
Normal file
16
cmake/Toolchain-clang-linux-native.cmake
Normal file
|
@ -0,0 +1,16 @@
|
|||
# The name of the target operating system
|
||||
set(CMAKE_SYSTEM_NAME Linux)
|
||||
|
||||
# Try to find clang for C and C++
|
||||
find_program(CMAKE_C_COMPILER clang)
|
||||
find_program(CMAKE_CXX_COMPILER clang++)
|
||||
|
||||
# Toolchain find root modes
|
||||
# NEVER - search host system only
|
||||
# ONLY - search CMAKE_FIND_ROOT_PATH only
|
||||
# BOTH - search both
|
||||
# Probably not needed for a native toolchain so commenting these out
|
||||
#set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
|
||||
#set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
|
||||
#set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
|
||||
#set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)
|
7
gen-clang.sh
Executable file
7
gen-clang.sh
Executable file
|
@ -0,0 +1,7 @@
|
|||
#!/bin/sh
|
||||
|
||||
CMAKE="cmake"
|
||||
BUILD_DIR="build-clang"
|
||||
TOOLCHAIN="./cmake/Toolchain-clang-linux-native.cmake"
|
||||
|
||||
exec $CMAKE . -B "$BUILD_DIR" -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN" "$@"
|
Loading…
Reference in a new issue