Fix build

This commit is contained in:
Marvin W 2020-03-29 14:15:15 +02:00
parent 98a1f3ad63
commit 6755cb3a1b
No known key found for this signature in database
GPG key ID: 072E9235DB996F2A
4 changed files with 50 additions and 45 deletions

View file

@ -9,9 +9,9 @@ before_install:
- sudo apt-get update - sudo apt-get update
- sudo apt-get install -y cmake valac libgee-0.8-dev libsqlite3-dev libgtk-3-dev libnotify-dev libgpgme-dev libsoup2.4-dev libgcrypt20-dev libqrencode-dev - sudo apt-get install -y cmake valac libgee-0.8-dev libsqlite3-dev libgtk-3-dev libnotify-dev libgpgme-dev libsoup2.4-dev libgcrypt20-dev libqrencode-dev
install: install:
- ./configure --with-tests --with-libsignal-in-tree $CONFIGURE_FLAGS - ./configure --with-tests --with-libomemo-in-tree $CONFIGURE_FLAGS
- make - make
script: script:
- build/xmpp-vala-test - build/xmpp-vala-test
- build/signal-protocol-vala-test - build/omemo-vala-test
cache: ccache cache: ccache

15
configure vendored
View file

@ -1,7 +1,7 @@
#!/bin/sh #!/bin/sh
OPTS=`getopt -o "h" --long \ OPTS=`getopt -o "h" --long \
help,fetch-only,no-debug,disable-fast-vapi,with-tests,release,with-libsignal-in-tree,\ help,fetch-only,no-debug,disable-fast-vapi,with-tests,release,with-libsignal-in-tree,with-libomemo-in-tree,without-libomemo-in-tree\
enable-plugin:,disable-plugin:,\ enable-plugin:,disable-plugin:,\
prefix:,program-prefix:,exec-prefix:,lib-suffix:,\ prefix:,program-prefix:,exec-prefix:,lib-suffix:,\
bindir:,libdir:,includedir:,datadir:,\ bindir:,libdir:,includedir:,datadir:,\
@ -17,7 +17,7 @@ eval set -- "$OPTS"
PREFIX=${PREFIX:-/usr/local} PREFIX=${PREFIX:-/usr/local}
ENABLED_PLUGINS= ENABLED_PLUGINS=
DISABLED_PLUGINS= DISABLED_PLUGINS=
BUILD_LIBSIGNAL_IN_TREE= BUILD_LIBOMEMO_IN_TREE=yes
BUILD_TESTS= BUILD_TESTS=
BUILD_TYPE=Debug BUILD_TYPE=Debug
DISABLE_FAST_VAPI= DISABLE_FAST_VAPI=
@ -56,8 +56,7 @@ Configuration:
without network access later and exit. without network access later and exit.
--no-debug Build without debug symbols --no-debug Build without debug symbols
--release Configure to build an optimized release version --release Configure to build an optimized release version
--with-libsignal-in-tree Build libsignal-protocol-c in tree and link it --with-libomemo-in-tree Build libomemo-c in tree and link it statically.
statically.
--with-tests Also build tests. --with-tests Also build tests.
Plugin configuration: Plugin configuration:
@ -113,7 +112,9 @@ while true; do
--valac ) VALA_EXECUTABLE="$2"; shift; shift ;; --valac ) VALA_EXECUTABLE="$2"; shift; shift ;;
--valac-flags ) VALAC_FLAGS="$2"; shift; shift ;; --valac-flags ) VALAC_FLAGS="$2"; shift; shift ;;
--lib-suffix ) LIB_SUFFIX="$2"; shift; shift ;; --lib-suffix ) LIB_SUFFIX="$2"; shift; shift ;;
--with-libsignal-in-tree ) BUILD_LIBSIGNAL_IN_TREE=yes; shift ;; --with-libsignal-in-tree ) BUILD_LIBOMEMO_IN_TREE=yes; shift ;;
--with-libomemo-in-tree ) BUILD_LIBOMEMO_IN_TREE=yes; shift ;;
--without-libomemo-in-tree ) BUILD_LIBOMEMO_IN_TREE=no; shift ;;
--disable-fast-vapi ) DISABLE_FAST_VAPI=yes; shift ;; --disable-fast-vapi ) DISABLE_FAST_VAPI=yes; shift ;;
--no-debug ) NO_DEBUG=yes; shift ;; --no-debug ) NO_DEBUG=yes; shift ;;
--fetch-only ) FETCH_ONLY=yes; shift ;; --fetch-only ) FETCH_ONLY=yes; shift ;;
@ -145,7 +146,7 @@ while true; do
esac esac
done done
if [ "$BUILD_LIBSIGNAL_IN_TREE" = "yes" ] || [ "$FETCH_ONLY" = "yes" ]; then if [ "$BUILD_LIBOMEMO_IN_TREE" = "yes" ] || [ "$FETCH_ONLY" = "yes" ]; then
if [ -d ".git" ]; then if [ -d ".git" ]; then
git submodule update --init 2>/dev/null git submodule update --init 2>/dev/null
else else
@ -262,7 +263,7 @@ cmake -G "$cmake_type" \
-DENABLED_PLUGINS="$ENABLED_PLUGINS" \ -DENABLED_PLUGINS="$ENABLED_PLUGINS" \
-DDISABLED_PLUGINS="$DISABLED_PLUGINS" \ -DDISABLED_PLUGINS="$DISABLED_PLUGINS" \
-DBUILD_TESTS="$BUILD_TESTS" \ -DBUILD_TESTS="$BUILD_TESTS" \
-DBUILD_LIBSIGNAL_IN_TREE="$BUILD_LIBSIGNAL_IN_TREE" \ -DBUILD_LIBOMEMO_IN_TREE="$BUILD_LIBOMEMO_IN_TREE" \
-DVALA_EXECUTABLE="$VALAC" \ -DVALA_EXECUTABLE="$VALAC" \
-DCMAKE_VALA_FLAGS="$VALACFLAGS" \ -DCMAKE_VALA_FLAGS="$VALACFLAGS" \
-DDISABLE_FAST_VAPI="$DISABLE_FAST_VAPI" \ -DDISABLE_FAST_VAPI="$DISABLE_FAST_VAPI" \

View file

@ -33,7 +33,10 @@ set_property(TARGET curve25519 PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET protobuf-c PROPERTY POSITION_INDEPENDENT_CODE ON) set_property(TARGET protobuf-c PROPERTY POSITION_INDEPENDENT_CODE ON)
set_property(TARGET omemo-c PROPERTY POSITION_INDEPENDENT_CODE ON) set_property(TARGET omemo-c PROPERTY POSITION_INDEPENDENT_CODE ON)
set(OMEMO_VALA_C_HEADERS if(NOT BUILD_LIBOMEMO_IN_TREE)
find_package(Omemo REQUIRED)
else()
set(OMEMO_C_HEADERS
signal_protocol.h signal_protocol.h
signal_protocol_types.h signal_protocol_types.h
curve.h curve.h
@ -53,11 +56,11 @@ set(OMEMO_VALA_C_HEADERS
group_cipher.h group_cipher.h
fingerprint.h fingerprint.h
device_consistency.h device_consistency.h
) )
file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/exports/omemo-vala") file(MAKE_DIRECTORY "${CMAKE_BINARY_DIR}/exports/omemo")
foreach(f ${OMEMO_VALA_C_HEADERS}) foreach(f ${OMEMO_C_HEADERS})
list(APPEND C_HEADERS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/libomemo-c/src/${f}") list(APPEND C_HEADERS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/libomemo-c/src/${f}")
list(APPEND C_HEADERS_TARGET "${CMAKE_BINARY_DIR}/exports/omemo/${f}") list(APPEND C_HEADERS_TARGET "${CMAKE_BINARY_DIR}/exports/omemo/${f}")
add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/exports/omemo/${f}" add_custom_command(OUTPUT "${CMAKE_BINARY_DIR}/exports/omemo/${f}"
@ -68,7 +71,8 @@ foreach(f ${OMEMO_VALA_C_HEADERS})
COMMENT COMMENT
Copy header file omemo/${f} Copy header file omemo/${f}
) )
endforeach(f) endforeach(f)
endif()
list(APPEND C_HEADERS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/signal_helper.h") list(APPEND C_HEADERS_SRC "${CMAKE_CURRENT_SOURCE_DIR}/src/signal_helper.h")
list(APPEND C_HEADERS_TARGET "${CMAKE_BINARY_DIR}/exports/signal_helper.h") list(APPEND C_HEADERS_TARGET "${CMAKE_BINARY_DIR}/exports/signal_helper.h")

View file

@ -1,7 +1,7 @@
#ifndef SIGNAL_PROTOCOL_VALA_HELPER #ifndef SIGNAL_PROTOCOL_VALA_HELPER
#define SIGNAL_PROTOCOL_VALA_HELPER 1 #define SIGNAL_PROTOCOL_VALA_HELPER 1
#include <signal/signal_protocol.h> #include <omemo/signal_protocol.h>
#include <string.h> #include <string.h>
#include <glib.h> #include <glib.h>