Skip to content

Commit 25fa765

Browse files
committed
chore: add vcpkg
1 parent 3ea7669 commit 25fa765

13 files changed

Lines changed: 105 additions & 0 deletions

.gitignore

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,15 @@
1+
# IDE files
12
*.iml
23
/.idea
34

5+
# Configuration files
46
/config.yml
57
/credentials.json
68
/state.json
79
/lockfile
810

11+
# Build files
12+
/.gocache
13+
/vcpkg
14+
/vcpkg_installed
915
/dist

vcpkg-configuration.json

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"overlay-triplets": [
3+
"./vcpkg-triplets"
4+
],
5+
"default-registry": {
6+
"kind": "git",
7+
"baseline": "c59b04f668d20c7dd83f478835e8266a3cc51270",
8+
"repository": "https://github.com/microsoft/vcpkg"
9+
},
10+
"registries": [
11+
{
12+
"kind": "artifact",
13+
"location": "https://github.com/microsoft/vcpkg-ce-catalog/archive/refs/heads/main.zip",
14+
"name": "microsoft"
15+
}
16+
]
17+
}

vcpkg-triplets/arm-linux-rpi.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include("${CMAKE_CURRENT_LIST_DIR}/base-linux.cmake")
2+
3+
set(VCPKG_TARGET_ARCHITECTURE arm)
4+
5+
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/toolchains/arm-linux-rpi.cmake)

vcpkg-triplets/arm-linux.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include("${CMAKE_CURRENT_LIST_DIR}/base-linux.cmake")
2+
3+
set(VCPKG_TARGET_ARCHITECTURE arm)
4+
5+
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/toolchains/arm-linux.cmake)

vcpkg-triplets/arm64-linux.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
include("${CMAKE_CURRENT_LIST_DIR}/base-linux.cmake")
2+
3+
set(VCPKG_TARGET_ARCHITECTURE arm64)
4+
5+
set(VCPKG_CHAINLOAD_TOOLCHAIN_FILE ${CMAKE_CURRENT_LIST_DIR}/toolchains/arm64-linux.cmake)

vcpkg-triplets/base-linux.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
set(VCPKG_CRT_LINKAGE dynamic)
2+
set(VCPKG_LIBRARY_LINKAGE dynamic)
3+
4+
set(VCPKG_CMAKE_SYSTEM_NAME Linux)
5+
set(VCPKG_BUILD_TYPE release)
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
include("${CMAKE_CURRENT_LIST_DIR}/base-linux.cmake")
2+
3+
set(CMAKE_SYSTEM_PROCESSOR arm)
4+
5+
find_program(CMAKE_C_COMPILER NAMES arm-rpi-linux-gnueabihf-gcc)
6+
if(NOT CMAKE_C_COMPILER)
7+
message(FATAL_ERROR "Could not find arm-rpi-linux-gnueabihf-gcc. Please install the appropriate cross compiler toolchain
8+
from https://github.com/devgianlu/rpi-toolchain.")
9+
endif()
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
include("${CMAKE_CURRENT_LIST_DIR}/base-linux.cmake")
2+
3+
set(CMAKE_SYSTEM_PROCESSOR arm)
4+
5+
if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" OR NOT CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm")
6+
find_program(CMAKE_C_COMPILER NAMES arm-linux-gnueabihf-gcc)
7+
if(NOT CMAKE_C_COMPILER)
8+
message(FATAL_ERROR "Could not find arm-linux-gnueabihf-gcc. Please install the appropriate cross compiler toolchain.")
9+
endif()
10+
else()
11+
set(CMAKE_C_COMPILER gcc)
12+
endif()
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
include("${CMAKE_CURRENT_LIST_DIR}/base-linux.cmake")
2+
3+
set(CMAKE_SYSTEM_PROCESSOR arm64)
4+
5+
if(NOT CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux" OR NOT CMAKE_HOST_SYSTEM_PROCESSOR STREQUAL "arm64")
6+
find_program(CMAKE_C_COMPILER NAMES aarch64-linux-gnu-gcc)
7+
if(NOT CMAKE_C_COMPILER)
8+
message(FATAL_ERROR "Could not find aarch64-linux-gnu-gcc. Please install the appropriate cross compiler toolchain.")
9+
endif()
10+
else()
11+
set(CMAKE_C_COMPILER gcc)
12+
endif()
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
set(CMAKE_SYSTEM_NAME Linux)
2+
3+
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
4+
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)
5+
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)
6+
set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)

0 commit comments

Comments
 (0)