From 6f196c17977128f6fcc9b751f9853934bb914ecb Mon Sep 17 00:00:00 2001 From: Dr-Noob Date: Sun, 10 Apr 2022 16:52:42 +0100 Subject: [PATCH] [v0.23] Fix FreeBSD compilation issues as reported by #13 --- CMakeLists.txt | 2 ++ build.sh | 11 +++++++++-- src/common/args.hpp | 2 ++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index c686662..7d27dc1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -45,6 +45,8 @@ if(NOT ${PCIUTILS_FOUND}) else() include_directories(${PCIUTILS_INCLUDE_DIR}) link_libraries(${PCIUTILS_LIBRARIES}) + # Needed for linking libpci in FreeBSD + link_directories(/usr/local/lib/) endif() add_executable(gpufetch ${COMMON_DIR}/main.cpp ${COMMON_DIR}/args.cpp ${COMMON_DIR}/gpu.cpp ${COMMON_DIR}/pci.cpp ${COMMON_DIR}/sort.cpp ${COMMON_DIR}/global.cpp ${COMMON_DIR}/printer.cpp ${COMMON_DIR}/master.cpp ${COMMON_DIR}/uarch.cpp) diff --git a/build.sh b/build.sh index 86ab0ab..72a5418 100755 --- a/build.sh +++ b/build.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh # gpufetch build script set -e @@ -27,6 +27,13 @@ fi # cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DENABLE_INTEL_BACKEND=OFF .. cmake -DCMAKE_BUILD_TYPE=$BUILD_TYPE .. -make -j$(nproc) + +os=$(uname) +if [ "$os" == 'Linux' ]; then + make -j$(nproc) +elif [ "$os" == 'FreeBSD' ]; then + gmake -j4 +fi + cd - ln -s build/gpufetch . diff --git a/src/common/args.hpp b/src/common/args.hpp index 2196c03..bef68a4 100644 --- a/src/common/args.hpp +++ b/src/common/args.hpp @@ -1,6 +1,8 @@ #ifndef __ARGS__ #define __ARGS__ +#include + struct color { int32_t R; int32_t G;