mirror of
https://github.com/mhx/dwarfs.git
synced 2025-09-10 13:04:15 -04:00
build: add option for building example binary
This commit is contained in:
parent
845ab050bb
commit
c68460ace7
@ -238,7 +238,7 @@ if [[ "$BUILD_FROM_TARBALL" == "1" ]]; then
|
|||||||
esac
|
esac
|
||||||
else
|
else
|
||||||
# shellcheck disable=SC2086
|
# shellcheck disable=SC2086
|
||||||
cmake ../dwarfs/ $CMAKE_ARGS
|
cmake ../dwarfs/ $CMAKE_ARGS -DWITH_EXAMPLE=1
|
||||||
|
|
||||||
time $BUILD_TOOL
|
time $BUILD_TOOL
|
||||||
|
|
||||||
|
@ -38,6 +38,7 @@ option(TRY_ENABLE_FLAC "build with FLAC support" ON)
|
|||||||
option(ENABLE_RICEPP "build with RICEPP compression support" ON)
|
option(ENABLE_RICEPP "build with RICEPP compression support" ON)
|
||||||
option(WITH_UNIVERSAL_BINARY "build with universal binary" OFF)
|
option(WITH_UNIVERSAL_BINARY "build with universal binary" OFF)
|
||||||
option(WITH_PXATTR "build with pxattr binary" OFF)
|
option(WITH_PXATTR "build with pxattr binary" OFF)
|
||||||
|
option(WITH_EXAMPLE "build with example binary" OFF)
|
||||||
if(NOT (APPLE OR WIN32))
|
if(NOT (APPLE OR WIN32))
|
||||||
option(ENABLE_STACKTRACE "build with symbolizer support" ON)
|
option(ENABLE_STACKTRACE "build with symbolizer support" ON)
|
||||||
endif()
|
endif()
|
||||||
@ -286,6 +287,12 @@ if(WITH_PXATTR)
|
|||||||
list(APPEND BINARY_TARGETS pxattr)
|
list(APPEND BINARY_TARGETS pxattr)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WITH_EXAMPLE)
|
||||||
|
add_executable(example example/example.cpp)
|
||||||
|
target_link_libraries(example PRIVATE dwarfs_reader dwarfs_extractor)
|
||||||
|
list(APPEND BINARY_TARGETS example)
|
||||||
|
endif()
|
||||||
|
|
||||||
if(WITH_FUSE_DRIVER)
|
if(WITH_FUSE_DRIVER)
|
||||||
include(${CMAKE_SOURCE_DIR}/cmake/need_fuse.cmake)
|
include(${CMAKE_SOURCE_DIR}/cmake/need_fuse.cmake)
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user