Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions .github/workflows/build-qefi-freebsd-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Build on FreeBSD
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
# The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac.
# You can convert this to a matrix build if you need cross-platform coverage.
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
name: Build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v2
with:
submodules: true

# Configure, build and run test
- uses: vmactions/freebsd-vm@v1
with:
release: 14.1
usesh: true
prepare: |
pkg install -y cmake qt5
run: |
uname -a
cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DCMAKE_INSTALL_PREFIX=/usr -DBUILD_TESTING=YES
cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}}
cd ${{github.workspace}}/build && ctest -C ${{env.BUILD_TYPE}}
24 changes: 1 addition & 23 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,37 +34,15 @@ set_target_properties(QEFI PROPERTIES PUBLIC_HEADER qefi.h)
target_link_libraries(QEFI PUBLIC Qt${QT_VERSION_MAJOR}::Core)
target_compile_definitions(QEFI PRIVATE QEFI_LIBRARY)

find_package(PkgConfig)
if(PkgConfig_FOUND)
pkg_check_modules(EFIVAR efivar>=0.15)
if(NOT DEFINED EFIVAR_FOUND)
# Find and link efivar<0.15: no mode
pkg_check_modules(EFIVAR efivar)
if(EFIVAR_FOUND)
# Consider it as an old lib (without mode and return non-zero)
# TODO(Inoki): to check https://github.com/rhboot/efivar/commit/7bd2e309aeec210509d215c803a762725591ccc7
add_definitions(-DEFIVAR_WITHOUT_MODE)
endif()
endif()
endif()

if(APP_DATA_DUMMY_BACKEND)
# Use the directory under QStandardPaths::AppDataLocation for test purpose
message("Use dummy backend for EFI operations")
add_definitions(-DEFIVAR_APP_DATA_DUMMY)
elseif(EFIVAR_FOUND)
message("Use libefivar for EFI operations")
include_directories(QEFI ${EFIVAR_INCLUDE_DIRS})
target_link_libraries(QEFI PRIVATE ${EFIVAR_LIBRARIES})
elseif(WIN32)
message("Use Windows API for EFI operations")
# TODO: Add include and lib from Windows API
else()
message(FATAL_ERROR "No EFI utility library found, please make sure you have libefivar installed")
endif()

if(USE_EFIVAR_OLD_API)
add_definitions(-DEFIVAR_OLD_API)
message("Use my libefivar for EFI operations")
endif()

if(PATCH_FREEBSD_EFIVAR)
Expand Down
Loading
Loading