2018-04-08 21:36:08 +02:00
|
|
|
cmake_minimum_required(VERSION 3.1.0 FATAL_ERROR)
|
|
|
|
|
|
|
|
# metadata
|
|
|
|
set(META_PROJECT_NAME syncthing)
|
|
|
|
set(META_PROJECT_TYPE library)
|
|
|
|
set(META_APP_NAME "Syncthing library")
|
|
|
|
set(META_APP_DESCRIPTION "Syncthing itself, built as a shared or static library")
|
|
|
|
set(META_PROJECT_VARNAME_UPPER LIB_SYNCTHING)
|
2022-09-06 10:46:23 +02:00
|
|
|
set(META_SYNCTHING_VERSION "v1.21.0")
|
2018-04-08 21:36:08 +02:00
|
|
|
|
|
|
|
# add project files
|
2019-05-04 22:10:37 +02:00
|
|
|
set(HEADER_FILES interface.h)
|
|
|
|
set(SRC_FILES "${CMAKE_CURRENT_BINARY_DIR}/libsyncthinginternal.h" interface.cpp)
|
2018-04-08 21:36:08 +02:00
|
|
|
|
2019-05-04 22:10:37 +02:00
|
|
|
set(TEST_HEADER_FILES)
|
|
|
|
set(TEST_SRC_FILES tests/interfacetests.cpp)
|
2018-04-14 23:03:04 +02:00
|
|
|
|
2018-04-08 21:36:08 +02:00
|
|
|
# find the go binary
|
|
|
|
find_program(GO_BIN go)
|
2019-05-04 22:10:37 +02:00
|
|
|
if (NOT GO_BIN)
|
2018-04-08 21:36:08 +02:00
|
|
|
message(FATAL_ERROR "The go binary could not be located.")
|
2019-05-04 22:10:37 +02:00
|
|
|
endif ()
|
2018-04-08 21:36:08 +02:00
|
|
|
|
2018-04-10 21:06:08 +02:00
|
|
|
# determine GOARCH for target
|
2019-11-30 18:24:19 +01:00
|
|
|
set(GO_TARGET_ARCH_OVERRIDE
|
|
|
|
""
|
|
|
|
CACHE STRING "overrides the 'GOARCH' variable")
|
2019-05-04 22:10:37 +02:00
|
|
|
if (GO_TARGET_ARCH_OVERRIDE)
|
2018-04-10 21:06:08 +02:00
|
|
|
set(GO_TARGET_ARCH "${GO_TARGET_ARCH_OVERRIDE}")
|
2019-05-04 22:10:37 +02:00
|
|
|
elseif (NOT CMAKE_CROSSCOMPILING)
|
2018-04-10 21:06:08 +02:00
|
|
|
set(GO_TARGET_ARCH "")
|
2019-05-04 22:10:37 +02:00
|
|
|
elseif (CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64")
|
2018-04-10 21:06:08 +02:00
|
|
|
set(GO_TARGET_ARCH "amd64")
|
2019-05-04 22:10:37 +02:00
|
|
|
elseif (CMAKE_SYSTEM_PROCESSOR MATCHES "i[3-6]86")
|
2018-04-10 21:06:08 +02:00
|
|
|
set(GO_TARGET_ARCH "386")
|
2019-05-04 22:10:37 +02:00
|
|
|
elseif (CMAKE_SYSTEM_NAME MATCHES "(ppc64|ppc64le|arm|arm64|s390x)")
|
2018-04-10 21:06:08 +02:00
|
|
|
set(GO_TARGET_ARCH "${CMAKE_SYSTEM_NAME}")
|
2019-05-04 22:10:37 +02:00
|
|
|
else ()
|
2018-04-10 21:06:08 +02:00
|
|
|
message(FATAL_ERROR "Unable to auto-determine GOARCH. Please set GO_TARGET_ARCH_OVERRIDE manually.")
|
2019-05-04 22:10:37 +02:00
|
|
|
endif ()
|
2020-10-31 21:50:24 +01:00
|
|
|
|
2018-04-10 21:06:08 +02:00
|
|
|
# determine GOOS for target
|
2019-11-30 18:24:19 +01:00
|
|
|
set(GO_TARGET_OS_OVERRIDE
|
|
|
|
""
|
|
|
|
CACHE STRING "overrides the 'GOOS' variable")
|
2019-05-04 22:10:37 +02:00
|
|
|
if (GO_TARGET_OS_OVERRIDE)
|
2018-04-10 21:06:08 +02:00
|
|
|
set(GO_TARGET_OS "${GO_TARGET_OS_OVERRIDE}")
|
2019-05-04 22:10:37 +02:00
|
|
|
elseif (NOT CMAKE_CROSSCOMPILING)
|
2018-04-10 21:06:08 +02:00
|
|
|
set(GO_TARGET_OS "")
|
2019-05-04 22:10:37 +02:00
|
|
|
elseif (CMAKE_SYSTEM_NAME STREQUAL "Linux")
|
2018-04-10 21:06:08 +02:00
|
|
|
set(GO_TARGET_OS "linux")
|
2019-05-04 22:10:37 +02:00
|
|
|
elseif (CMAKE_SYSTEM_NAME STREQUAL "Android")
|
2018-04-10 21:06:08 +02:00
|
|
|
set(GO_TARGET_OS "android")
|
2019-05-04 22:10:37 +02:00
|
|
|
elseif (CMAKE_SYSTEM_NAME STREQUAL "Windows")
|
2018-04-10 21:06:08 +02:00
|
|
|
set(GO_TARGET_OS "windows")
|
2019-05-04 22:10:37 +02:00
|
|
|
elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD")
|
2018-04-10 21:06:08 +02:00
|
|
|
set(GO_TARGET_OS "freebsd")
|
2019-05-04 22:10:37 +02:00
|
|
|
elseif (CMAKE_SYSTEM_NAME STREQUAL "Darwin")
|
2018-04-10 21:06:08 +02:00
|
|
|
set(GO_TARGET_OS "darwin")
|
2019-05-04 22:10:37 +02:00
|
|
|
else ()
|
2018-04-10 21:06:08 +02:00
|
|
|
message(FATAL_ERROR "Unable to auto-determine GOOS. Please set GO_TARGET_OS_OVERRIDE manually.")
|
2019-05-04 22:10:37 +02:00
|
|
|
endif ()
|
2018-04-10 21:06:08 +02:00
|
|
|
message(STATUS "Using GOOS=${GO_TARGET_OS} and GOARCH=${GO_TARGET_ARCH}")
|
|
|
|
|
2020-10-31 21:50:24 +01:00
|
|
|
# define default GOFLAGS
|
2020-11-02 23:17:37 +01:00
|
|
|
string(TOUPPER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_UPPER)
|
2020-10-31 21:50:24 +01:00
|
|
|
set(GO_FLAGS_OVERRIDE
|
|
|
|
""
|
|
|
|
CACHE STRING "overrides the 'GOFLAGS' variable")
|
|
|
|
if (GO_FLAGS_OVERRIDE)
|
|
|
|
set(GO_FLAGS "${GO_FLAGS_OVERRIDE}")
|
|
|
|
else ()
|
|
|
|
set(GO_FLAGS "-trimpath -mod=readonly -modcacherw")
|
|
|
|
endif ()
|
2020-11-02 23:17:37 +01:00
|
|
|
foreach (LANGUAGE C CXX)
|
|
|
|
set(CGO_${LANGUAGE}FLAGS_OVERRIDE
|
|
|
|
""
|
|
|
|
CACHE STRING "overrides the 'CGO_${LANGUAGE}FLAGS' variable")
|
|
|
|
if (CGO_${LANGUAGE}FLAGS_OVERRIDE)
|
|
|
|
set(CGO_${LANGUAGE}FLAGS "${CGO_${LANGUAGE}FLAGS_OVERRIDE}")
|
|
|
|
else ()
|
|
|
|
set(CGO_${LANGUAGE}FLAGS "${CMAKE_${LANGUAGE}_FLAGS_INIT} ${CMAKE_${LANGUAGE}_FLAGS_${CMAKE_BUILD_TYPE_UPPER}_INIT}")
|
|
|
|
endif ()
|
2020-12-17 17:52:02 +01:00
|
|
|
endforeach ()
|
2020-11-02 23:17:37 +01:00
|
|
|
set(CGO_LDFLAGS_OVERRIDE
|
|
|
|
""
|
|
|
|
CACHE STRING "overrides the 'CGO_LDFLAGS' variable")
|
|
|
|
if (CGO_LDFLAGS_OVERRIDE)
|
|
|
|
set(CGO_LDFLAGS "${CGO_CFLAGS_OVERRIDE}")
|
|
|
|
else ()
|
|
|
|
set(CGO_LDFLAGS "${CMAKE_SHARED_LINKER_FLAGS_INIT} ${CMAKE_SHARED_LINKER_FLAGS_${CMAKE_BUILD_TYPE_UPPER}_INIT}")
|
|
|
|
endif ()
|
2020-10-31 21:50:24 +01:00
|
|
|
|
2018-04-08 21:36:08 +02:00
|
|
|
# locate the Syncthing checkout
|
2019-11-30 18:24:19 +01:00
|
|
|
set(GO_DEVELOPMENT_PATH
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/go"
|
|
|
|
CACHE PATH "the 'GOPATH'")
|
2019-06-16 16:58:52 +02:00
|
|
|
set(SYNCTHING_PATH
|
|
|
|
"${CMAKE_CURRENT_SOURCE_DIR}/go/src/github.com/syncthing/syncthing"
|
2019-05-04 22:10:37 +02:00
|
|
|
CACHE PATH "path of Syncthing checkout")
|
2018-04-08 21:36:08 +02:00
|
|
|
|
2020-03-05 19:04:55 +01:00
|
|
|
# find Syncthing's assets (caveat: newly added assets will not cause CMake to automatically regenerate)
|
2019-11-30 18:24:19 +01:00
|
|
|
file(
|
|
|
|
GLOB_RECURSE SRC_FILES_SYNCTHING_ASSETS
|
|
|
|
LIST_DIRECTORIES false
|
|
|
|
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
|
|
|
|
"${SYNCTHING_PATH}/gui/*")
|
2019-05-04 22:10:37 +02:00
|
|
|
if (NOT SRC_FILES_SYNCTHING_ASSETS)
|
|
|
|
message(
|
|
|
|
FATAL_ERROR
|
|
|
|
"No asset files found in Syncthing checkout \"${CMAKE_CURRENT_SOURCE_DIR}/go/src/github.com/syncthing/syncthing\"."
|
2019-11-30 18:24:19 +01:00
|
|
|
)
|
2019-05-04 22:10:37 +02:00
|
|
|
endif ()
|
2018-04-08 21:36:08 +02:00
|
|
|
|
2020-03-05 19:04:55 +01:00
|
|
|
# find Syncthing's source code (caveat: newly added files will not cause CMake to automatically regenerate)
|
2019-11-30 18:24:19 +01:00
|
|
|
file(
|
|
|
|
GLOB_RECURSE SRC_FILES_SYNCTHING
|
|
|
|
LIST_DIRECTORIES false
|
|
|
|
RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}"
|
2022-06-26 02:25:23 +02:00
|
|
|
"${SYNCTHING_PATH}/c-bindings/*.go"
|
|
|
|
"${SYNCTHING_PATH}/c-bindings/*.h"
|
|
|
|
"${SYNCTHING_PATH}/c-bindings/*.c"
|
|
|
|
"${SYNCTHING_PATH}/cmd/syncthing/cli/*.go"
|
|
|
|
"${SYNCTHING_PATH}/lib/*.go"
|
|
|
|
"${SYNCTHING_PATH}/lib/*.h"
|
|
|
|
"${SYNCTHING_PATH}/lib/*.c")
|
2019-05-04 22:10:37 +02:00
|
|
|
if (NOT SRC_FILES_SYNCTHING)
|
|
|
|
message(
|
|
|
|
FATAL_ERROR
|
|
|
|
"No *.go files found in Syncthing checkout \"${CMAKE_CURRENT_SOURCE_DIR}/go/src/github.com/syncthing/syncthing\"."
|
2019-11-30 18:24:19 +01:00
|
|
|
)
|
2019-05-04 22:10:37 +02:00
|
|
|
endif ()
|
2020-06-02 13:11:19 +02:00
|
|
|
set(GENERATED_SYNCTHING_GUI_FILES_RELATIVE_PATH "lib/api/auto/gui.files.go")
|
|
|
|
list(APPEND SRC_FILES_SYNCTHING "${SYNCTHING_PATH}/${GENERATED_SYNCTHING_GUI_FILES_RELATIVE_PATH}")
|
|
|
|
message(STATUS "Syncthing's source files: ${SRC_FILES_SYNCTHING}")
|
2018-04-08 21:36:08 +02:00
|
|
|
|
2019-07-29 18:00:42 +02:00
|
|
|
# set Go linker flags
|
2020-10-31 21:50:24 +01:00
|
|
|
set(GO_LINKER_FLAGS_OVERRIDE
|
|
|
|
""
|
|
|
|
CACHE STRING "overrides flags passed to Go's build system via -ldflags")
|
|
|
|
set(GO_LINKER_FLAGS "${GO_LINKER_FLAGS_OVERRIDE}")
|
2019-07-29 18:00:42 +02:00
|
|
|
if (CMAKE_BUILD_TYPE STREQUAL Release OR CMAKE_BUILD_TYPE STREQUAL MinSizeRel)
|
|
|
|
set(GO_LINKER_FLAGS "${GO_LINKER_FLAGS} -w")
|
|
|
|
endif ()
|
|
|
|
if (META_SYNCTHING_VERSION)
|
|
|
|
set(GO_LINKER_FLAGS "${GO_LINKER_FLAGS} -X github.com/syncthing/syncthing/lib/build.Version=${META_SYNCTHING_VERSION}")
|
|
|
|
endif ()
|
|
|
|
if (DEFINED $ENV{USER})
|
|
|
|
set(GO_LINKER_FLAGS "${GO_LINKER_FLAGS} -X github.com/syncthing/syncthing/lib/build.User=$ENV{USER}")
|
|
|
|
endif ()
|
|
|
|
if (DEFINED $ENV{BUILD_HOST})
|
|
|
|
set(BUILD_HOST $ENV{BUILD_HOST})
|
|
|
|
else ()
|
|
|
|
cmake_host_system_information(RESULT BUILD_HOST QUERY HOSTNAME)
|
|
|
|
endif ()
|
|
|
|
if (BUILD_HOST)
|
|
|
|
set(GO_LINKER_FLAGS "${GO_LINKER_FLAGS} -X github.com/syncthing/syncthing/lib/build.Host=${BUILD_HOST}")
|
2019-08-06 00:13:15 +02:00
|
|
|
endif ()
|
2019-07-29 18:00:42 +02:00
|
|
|
if (DEFINED $ENV{BUILD_STAMP})
|
|
|
|
set(GO_LINKER_FLAGS "${GO_LINKER_FLAGS} -X github.com/syncthing/syncthing/lib/build.Stamp=$ENV{BUILD_STAMP}")
|
2019-08-06 00:13:15 +02:00
|
|
|
endif ()
|
2019-07-29 18:00:42 +02:00
|
|
|
|
2020-03-05 19:04:55 +01:00
|
|
|
# generate Syncthing's assets (not setting GOARCH/GOOS here, this is supposed to run on the host)
|
2019-11-30 18:24:19 +01:00
|
|
|
add_custom_command(
|
2020-06-02 13:11:19 +02:00
|
|
|
OUTPUT "${SYNCTHING_PATH}/${GENERATED_SYNCTHING_GUI_FILES_RELATIVE_PATH}"
|
2020-10-31 21:50:24 +01:00
|
|
|
COMMAND "GO111MODULE=on" "GOPATH=${GO_DEVELOPMENT_PATH}" "GOFLAGS=${GO_FLAGS}" "${GO_BIN}" run ./script/genassets.go gui
|
|
|
|
> "${GENERATED_SYNCTHING_GUI_FILES_RELATIVE_PATH}"
|
2019-11-30 18:24:19 +01:00
|
|
|
DEPENDS ${SRC_FILES_SYNCTHING_ASSETS}
|
|
|
|
WORKING_DIRECTORY "${SYNCTHING_PATH}"
|
|
|
|
COMMENT "Building Syncthing's assets")
|
2018-04-08 21:36:08 +02:00
|
|
|
|
|
|
|
# compile Syncthing as static library
|
2019-08-06 00:12:58 +02:00
|
|
|
set(SYNCTHINGINTERNAL_LIBRARY_PATH "${CMAKE_CURRENT_BINARY_DIR}/libsyncthinginternal.a")
|
|
|
|
set(SYNCTHINGINTERNAL_HEADER_PATH "${CMAKE_CURRENT_BINARY_DIR}/libsyncthinginternal.h")
|
2019-11-30 18:24:19 +01:00
|
|
|
add_custom_command(
|
|
|
|
OUTPUT "${SYNCTHINGINTERNAL_LIBRARY_PATH}" "${SYNCTHINGINTERNAL_HEADER_PATH}"
|
|
|
|
COMMAND
|
|
|
|
"CC=${CMAKE_C_COMPILER}" "CXX=${CMAKE_CXX_COMPILER}" "AR=${CMAKE_C_COMPILER_AR}" "GOOS=${GO_TARGET_OS}"
|
2020-12-17 17:52:02 +01:00
|
|
|
"CGO_CFLAGS=${CGO_CFLAGS}" "CGO_CXXFLAGS=${CGO_CXXFLAGS}" "CGO_LDFLAGS=${CGO_LDFLAGS}" "GOARCH=${GO_TARGET_ARCH}"
|
|
|
|
"CGO_ENABLED=1" "GO111MODULE=on" "GOPATH=${GO_DEVELOPMENT_PATH}" "GOFLAGS=${GO_FLAGS}" "${GO_BIN}" build -v
|
|
|
|
-buildmode c-archive -o "${SYNCTHINGINTERNAL_LIBRARY_PATH}" -ldflags "${GO_LINKER_FLAGS}" ./c-bindings &&
|
|
|
|
"${CMAKE_RANLIB}" "${SYNCTHINGINTERNAL_LIBRARY_PATH}"
|
2019-11-30 18:24:19 +01:00
|
|
|
DEPENDS ${SRC_FILES_SYNCTHING}
|
|
|
|
WORKING_DIRECTORY "${SYNCTHING_PATH}"
|
2021-04-07 15:11:40 +02:00
|
|
|
COMMENT "Building Syncthing itself (as library)")
|
|
|
|
|
|
|
|
# add target to compile Syncthing as standalone executable (helpful for testing)
|
|
|
|
set(SYNCTHING_EXECUTABLE_PATH "${CMAKE_CURRENT_BINARY_DIR}/syncthing")
|
2021-04-07 20:00:27 +02:00
|
|
|
add_custom_target(
|
|
|
|
syncthing_executable
|
2021-04-07 15:11:40 +02:00
|
|
|
COMMAND
|
|
|
|
"CC=${CMAKE_C_COMPILER}" "CXX=${CMAKE_CXX_COMPILER}" "AR=${CMAKE_C_COMPILER_AR}" "GOOS=${GO_TARGET_OS}"
|
|
|
|
"CGO_CFLAGS=${CGO_CFLAGS}" "CGO_CXXFLAGS=${CGO_CXXFLAGS}" "CGO_LDFLAGS=${CGO_LDFLAGS}" "GOARCH=${GO_TARGET_ARCH}"
|
|
|
|
"CGO_ENABLED=1" "GO111MODULE=on" "GOPATH=${GO_DEVELOPMENT_PATH}" "GOFLAGS=${GO_FLAGS}" "${GO_BIN}" build -v
|
|
|
|
-buildmode exe -o "${SYNCTHING_EXECUTABLE_PATH}" -ldflags "${GO_LINKER_FLAGS}" ./cmd/syncthing
|
|
|
|
DEPENDS ${SRC_FILES_SYNCTHING}
|
|
|
|
WORKING_DIRECTORY "${SYNCTHING_PATH}"
|
2021-04-07 20:00:27 +02:00
|
|
|
COMMENT "Building Syncthing itself (as executable, ${SYNCTHING_EXECUTABLE_PATH})")
|
2018-04-08 21:36:08 +02:00
|
|
|
|
2020-03-05 19:04:55 +01:00
|
|
|
# find c++utilities to use CMake modules and headers from it privately
|
2021-10-02 11:58:02 +02:00
|
|
|
find_package(${PACKAGE_NAMESPACE_PREFIX}c++utilities${CONFIGURATION_PACKAGE_SUFFIX} 5.0.0 REQUIRED)
|
2019-08-06 10:57:42 +02:00
|
|
|
list(APPEND CMAKE_MODULE_PATH ${CPP_UTILITIES_MODULE_DIRS})
|
|
|
|
if (CPP_UTILITIES_SOURCE_DIR)
|
2019-08-08 21:34:24 +02:00
|
|
|
list(APPEND PRIVATE_INCLUDE_DIRS $<BUILD_INTERFACE:${CPP_UTILITIES_SOURCE_DIR}/..>
|
2020-02-02 19:50:35 +01:00
|
|
|
$<INSTALL_INTERFACE:${CPP_UTILITIES_INCLUDE_DIRS}>)
|
2019-08-06 10:57:42 +02:00
|
|
|
else ()
|
2019-08-08 21:34:24 +02:00
|
|
|
list(APPEND PRIVATE_INCLUDE_DIRS ${CPP_UTILITIES_INCLUDE_DIRS})
|
2019-08-06 10:57:42 +02:00
|
|
|
endif ()
|
|
|
|
|
2019-08-06 00:12:58 +02:00
|
|
|
# apply basic config
|
|
|
|
include(BasicConfig)
|
|
|
|
|
2019-08-05 19:10:57 +02:00
|
|
|
# add imported target for library generated by the Go build system
|
|
|
|
add_library(syncthinginternal STATIC IMPORTED)
|
2019-08-06 00:12:58 +02:00
|
|
|
set_property(TARGET syncthinginternal PROPERTY IMPORTED_LOCATION "${SYNCTHINGINTERNAL_LIBRARY_PATH}")
|
|
|
|
set_property(TARGET syncthinginternal PROPERTY INTERFACE_INCLUDE_DIRECTORIES "${SYNCTHING_PATH}/c-bindings")
|
|
|
|
|
|
|
|
# add additional libraries (not sure if go build could provide this list somehow to make this more generic)
|
|
|
|
if (WIN32)
|
|
|
|
set(SYNCTHING_INTERNAL_LIBS ws2_32 winmm)
|
|
|
|
elseif (UNIX)
|
2021-10-04 19:21:18 +02:00
|
|
|
set_property(
|
|
|
|
TARGET syncthinginternal
|
|
|
|
APPEND
|
|
|
|
PROPERTY INTERFACE_LINK_OPTIONS "-pthread")
|
2019-08-06 00:12:58 +02:00
|
|
|
endif ()
|
|
|
|
foreach (LIBRARY ${SYNCTHING_INTERNAL_LIBS})
|
|
|
|
find_library(SYNCTHING_INTERNAL_LIBRARY_PATH_${LIBRARY} ${LIBRARY})
|
2020-08-11 23:15:41 +02:00
|
|
|
set_property(
|
|
|
|
TARGET syncthinginternal
|
|
|
|
APPEND
|
|
|
|
PROPERTY IMPORTED_LINK_INTERFACE_LIBRARIES ${SYNCTHING_INTERNAL_LIBRARY_PATH_${LIBRARY}})
|
2019-08-06 00:12:58 +02:00
|
|
|
endforeach ()
|
2019-08-05 19:10:57 +02:00
|
|
|
|
|
|
|
# depend on that imported target
|
2019-08-06 00:12:58 +02:00
|
|
|
list(APPEND PRIVATE_LIBRARIES $<BUILD_INTERFACE:syncthinginternal>
|
2020-02-02 19:50:35 +01:00
|
|
|
$<INSTALL_INTERFACE:${LIB_INSTALL_DESTINATION}/libsyncthinginternal.a>)
|
2018-04-14 23:03:04 +02:00
|
|
|
|
2018-04-08 21:36:08 +02:00
|
|
|
# include modules to apply configuration
|
|
|
|
include(WindowsResources)
|
|
|
|
include(LibraryTarget)
|
2018-04-14 23:03:04 +02:00
|
|
|
include(TestTarget)
|
2018-04-15 20:19:14 +02:00
|
|
|
include(Doxygen)
|
2018-04-08 21:36:08 +02:00
|
|
|
include(ConfigHeader)
|
2019-08-06 00:12:58 +02:00
|
|
|
|
2020-03-05 19:04:55 +01:00
|
|
|
# create install target for static libsyncthinginternal.a if we're also creating a static libsyncthing.a (note: It is not
|
|
|
|
# possible to add syncthinginternal to BUNDLED_TARGETS because it is an import library which apparently can not be exported.)
|
2019-11-30 18:24:19 +01:00
|
|
|
if (NOT BUILD_SHARED_LIBS
|
|
|
|
AND NOT META_NO_INSTALL_TARGETS
|
|
|
|
AND ENABLE_INSTALL_TARGETS)
|
|
|
|
install(
|
|
|
|
FILES "${SYNCTHINGINTERNAL_LIBRARY_PATH}"
|
|
|
|
DESTINATION "lib${SELECTED_LIB_SUFFIX}"
|
|
|
|
COMPONENT binary)
|
2019-08-06 00:12:58 +02:00
|
|
|
endif ()
|
2021-10-13 00:14:35 +02:00
|
|
|
|
|
|
|
# avoid running this test in parallel with other tests spawning a Syncthing test instance
|
|
|
|
if (META_MAIN_TEST_NAME)
|
|
|
|
set_tests_properties("${META_MAIN_TEST_NAME}" PROPERTIES RESOURCE_LOCK "syncthingtestinstance")
|
|
|
|
endif ()
|