mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-08 11:59:48 -04:00
build: factor out FUSE loading
This commit is contained in:
parent
2b334d0b88
commit
aa18791854
@ -203,23 +203,6 @@ if(USE_JEMALLOC)
|
||||
pkg_check_modules(JEMALLOC IMPORTED_TARGET jemalloc>=${JEMALLOC_REQUIRED_VERSION})
|
||||
endif()
|
||||
|
||||
if(WIN32)
|
||||
if(NOT WINFSP_PATH)
|
||||
set(WINFSP_PATH "C:/Program Files (x86)/WinFsp")
|
||||
endif()
|
||||
find_library(WINFSP winfsp-x64.lib "${WINFSP_PATH}/lib")
|
||||
if (NOT WINFSP)
|
||||
message(FATAL_ERROR "No WinFsp library found")
|
||||
endif()
|
||||
else()
|
||||
pkg_check_modules(FUSE IMPORTED_TARGET fuse>=2.9.9)
|
||||
pkg_check_modules(FUSE3 IMPORTED_TARGET fuse3>=3.10.5)
|
||||
|
||||
if(NOT FUSE_FOUND AND NOT FUSE3_FOUND)
|
||||
message(FATAL_ERROR "No FUSE or FUSE3 library found")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/thrift_library.cmake)
|
||||
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/folly.cmake)
|
||||
@ -264,6 +247,8 @@ install(TARGETS mkdwarfs dwarfsck dwarfsextract RUNTIME DESTINATION bin)
|
||||
|
||||
list(APPEND MAIN_TARGETS mkdwarfs_main dwarfsck_main dwarfsextract_main)
|
||||
|
||||
include(${CMAKE_SOURCE_DIR}/cmake/need_fuse.cmake)
|
||||
|
||||
if(FUSE3_FOUND OR WINFSP OR APPLE)
|
||||
add_library(dwarfs_main OBJECT tools/src/dwarfs_main.cpp)
|
||||
target_compile_definitions(dwarfs_main PRIVATE _FILE_OFFSET_BITS=64)
|
||||
|
36
cmake/need_fuse.cmake
Normal file
36
cmake/need_fuse.cmake
Normal file
@ -0,0 +1,36 @@
|
||||
#
|
||||
# Copyright (c) Marcus Holland-Moritz
|
||||
#
|
||||
# This file is part of dwarfs.
|
||||
#
|
||||
# dwarfs is free software: you can redistribute it and/or modify it under the
|
||||
# terms of the GNU General Public License as published by the Free Software
|
||||
# Foundation, either version 3 of the License, or (at your option) any later
|
||||
# version.
|
||||
#
|
||||
# dwarfs is distributed in the hope that it will be useful, but WITHOUT ANY
|
||||
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
|
||||
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License along with
|
||||
# dwarfs. If not, see <https://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
cmake_minimum_required(VERSION 3.28.0)
|
||||
|
||||
if(WIN32)
|
||||
if(NOT WINFSP_PATH)
|
||||
set(WINFSP_PATH "C:/Program Files (x86)/WinFsp")
|
||||
endif()
|
||||
find_library(WINFSP winfsp-x64.lib "${WINFSP_PATH}/lib")
|
||||
if (NOT WINFSP)
|
||||
message(FATAL_ERROR "No WinFsp library found")
|
||||
endif()
|
||||
else()
|
||||
pkg_check_modules(FUSE IMPORTED_TARGET fuse>=2.9.9)
|
||||
pkg_check_modules(FUSE3 IMPORTED_TARGET fuse3>=3.10.5)
|
||||
|
||||
if(NOT FUSE_FOUND AND NOT FUSE3_FOUND)
|
||||
message(FATAL_ERROR "No FUSE or FUSE3 library found")
|
||||
endif()
|
||||
endif()
|
Loading…
x
Reference in New Issue
Block a user