mirror of
https://github.com/aristocratos/btop.git
synced 2024-05-18 19:33:03 +12:00
Add CMake build support for NetBSD.
This commit is contained in:
parent
00796eef5d
commit
c98673f94b
45
.github/workflows/cmake-netbsd.yml
vendored
Executable file
45
.github/workflows/cmake-netbsd.yml
vendored
Executable file
|
@ -0,0 +1,45 @@
|
|||
name: NetBSD CMake
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: main
|
||||
tags-ignore: '*.*'
|
||||
paths:
|
||||
- '.github/workflows/cmake-netbsd.yml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'include/**'
|
||||
- 'src/*pp'
|
||||
- 'src/netbsd/*pp'
|
||||
pull_request:
|
||||
branches: main
|
||||
paths:
|
||||
- '.github/workflows/cmake-netbsd.yml'
|
||||
- 'CMakeLists.txt'
|
||||
- 'include/**'
|
||||
- 'src/*pp'
|
||||
- 'src/netbsd/*pp'
|
||||
|
||||
jobs:
|
||||
cmake_build_on_netbsd:
|
||||
runs-on: ubuntu-22.04
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- name: Compile
|
||||
uses: vmactions/netbsd-vm@v1
|
||||
with:
|
||||
release: '9.3'
|
||||
usesh: true
|
||||
prepare: |
|
||||
PATH="/usr/pkg/sbin:/usr/pkg/bin:$PATH"
|
||||
PKG_PATH="https://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/amd64/9.3/All/"
|
||||
export PATH PKG_PATH
|
||||
/usr/sbin/pkg_add pkgin
|
||||
pkgin -y install cmake ninja-build gcc10 coreutils git
|
||||
git config --global --add safe.directory /home/runner/work/btop/btop
|
||||
run: |
|
||||
cmake -DCMAKE_CXX_COMPILER="/usr/pkg/gcc10/bin/g++" -DCMAKE_CXX_FLAGS="--std=c++20 -DNDEBUG -I/usr/pkg/gcc10/include -I/usr/include -I/usr/pkg/include" -B build -G Ninja -DBTOP_STATIC=ON
|
||||
cmake --build build --verbose
|
|
@ -66,6 +66,8 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
|||
target_sources(btop PRIVATE src/freebsd/btop_collect.cpp)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
|
||||
target_sources(btop PRIVATE src/openbsd/btop_collect.cpp src/openbsd/sysctlbyname.cpp)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
|
||||
target_sources(btop PRIVATE src/netbsd/btop_collect.cpp)
|
||||
elseif(LINUX)
|
||||
target_sources(btop PRIVATE src/linux/btop_collect.cpp)
|
||||
else()
|
||||
|
@ -208,6 +210,12 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "OpenBSD")
|
|||
endif()
|
||||
find_package(kvm REQUIRED)
|
||||
target_link_libraries(btop kvm::kvm)
|
||||
elseif(CMAKE_SYSTEM_NAME STREQUAL "NetBSD")
|
||||
if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
|
||||
target_compile_options(btop PRIVATE -static-libstdc++)
|
||||
endif()
|
||||
find_package(kvm REQUIRED)
|
||||
target_link_libraries(btop kvm::kvm)
|
||||
endif()
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue