Skip to content

Commit

Permalink
Merge pull request #28 from Inokinoki/fix-freebsd-build
Browse files Browse the repository at this point in the history
Fix Freebsd build
  • Loading branch information
Inokinoki authored Nov 12, 2024
2 parents ee0651c + e969e0d commit 27bbff4
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
21 changes: 20 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,16 @@ endif()
# Find and link efivar/win32 API
find_package(PkgConfig)
if(PkgConfig_FOUND)
pkg_check_modules(EFIVAR efivar)
pkg_check_modules(EFIVAR efivar>=0.15)
if(NOT DEFINED EFIVAR_FOUND)
# Find and link efivar<0.15
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)
Expand All @@ -76,7 +85,17 @@ else()
message(FATAL_ERROR "No EFI utility found, please make sure you have libefivar installed")
endif()

if(USE_EFIVAR_OLD_API)
add_definitions(-DEFIVAR_OLD_API)
endif()

target_include_directories(QEFIEntryManager PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/qefivar)
if(PATCH_FREEBSD_EFIVAR)
# Patch efivar 0.15 build for FreeBSD
# TODO(Inoki): check 0.15 build
add_definitions(-DEFIVAR_FREEBSD_PATCH)
target_link_libraries(QEFIEntryManager PRIVATE geom)
endif()

# Make a CMAKE project config file in QEFI, the libefivar should be linked automatically
target_link_libraries(QEFIEntryManager PRIVATE Qt${QT_VERSION_MAJOR}::Widgets Qt${QT_VERSION_MAJOR}::Network)
Expand Down
2 changes: 1 addition & 1 deletion qefivar

0 comments on commit 27bbff4

Please sign in to comment.