Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Codec deflate #5

Closed
wants to merge 15 commits into from

1 participant

Hitwise
Hitwise

Hi there,

We've added (deflate) codec support to avro-c!

Please let me know what should be changed/fixed/etc

  • Lucas Martin-King (Experian Hitwise)
Hitwise

We have moved the branch, So I will need to close this pull request and make a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Nov 9, 2011
  1. Lucas Martin-King

    Added zlib as dependency in avro-c.pc.in

    Lucas Martin-King authored lmartinking committed
Commits on Nov 10, 2011
  1. Lucas Martin-King

    Initial codec support

    Lucas Martin-King authored lmartinking committed
  2. Lucas Martin-King

    Added codec.{c,h} to CMakeLists.txt

    Lucas Martin-King authored lmartinking committed
  3. Lucas Martin-King

    Make sure codec is created before file writer is initialized fully

    Lucas Martin-King authored lmartinking committed
  4. Lucas Martin-King

    Added libz to CMakeLists

    Lucas Martin-King authored lmartinking committed
  5. Lucas Martin-King

    Added public method for creating a file writer with codec

    Lucas Martin-King authored lmartinking committed
  6. Lucas Martin-King

    Use zlib directly so we have raw deflate blocks instead of zlib blocks

    Lucas Martin-King authored lmartinking committed
  7. Lucas Martin-King

    Added codec support to file_read_header

    Lucas Martin-King authored lmartinking committed
  8. Lucas Martin-King

    Make sure we free codec memory on file close

    Lucas Martin-King authored lmartinking committed
Commits on Nov 14, 2011
  1. Free up zlib private data; fix memory leak

    Lucas Martin-King authored
  2. Refactor null codec implementation into functions

    Lucas Martin-King authored
  3. Fixed invalid return value

    Lucas Martin-King authored
  4. Initial inflate codec support

    Lucas Martin-King authored
Commits on Nov 15, 2011
  1. Reading data files with codec support

    Lucas Martin-King authored
Commits on Nov 21, 2011
  1. Changed examples/quickstop to use defate codec

    Lucas Martin-King authored
This page is out of date. Refresh to see the latest.
2  lang/c/examples/CMakeLists.txt
View
@@ -18,7 +18,7 @@
#
add_executable(quickstop quickstop.c)
-target_link_libraries(quickstop avro-static)
+target_link_libraries(quickstop avro-static z)
add_test(quickstop
${CMAKE_COMMAND} -E chdir ${AvroC_SOURCE_DIR}/examples
2  lang/c/examples/quickstop.c
View
@@ -142,7 +142,7 @@ int main(void)
/* Delete the database if it exists */
unlink(dbname);
/* Create a new database */
- rval = avro_file_writer_create(dbname, person_schema, &db);
+ rval = avro_file_writer_create_with_codec(dbname, person_schema, &db, "deflate");
if (rval) {
fprintf(stderr, "There was an error creating %s\n", dbname);
exit(EXIT_FAILURE);
6 lang/c/src/CMakeLists.txt
View
@@ -35,6 +35,8 @@ set(AVRO_SRC
avro/value.h
avro_generic_internal.h
avro_private.h
+ codec.c
+ codec.h
consumer.c
consume-binary.c
datafile.c
@@ -128,9 +130,9 @@ install(FILES ${CMAKE_CURRENT_BINARY_DIR}/avro-c.pc
DESTINATION lib/pkgconfig)
add_executable(avrocat avrocat.c)
-target_link_libraries(avrocat avro-static)
+target_link_libraries(avrocat avro-static z)
install(TARGETS avrocat RUNTIME DESTINATION bin)
add_executable(avropipe avropipe.c)
-target_link_libraries(avropipe avro-static)
+target_link_libraries(avropipe avro-static z)
install(TARGETS avropipe RUNTIME DESTINATION bin)
1  lang/c/src/avro-c.pc.in
View
@@ -4,3 +4,4 @@ Version: @VERSION@
URL: http://avro.apache.org/
Libs: -L@prefix@/lib -lavro
Cflags: -I@prefix@/include
+Requires: zlib
3  lang/c/src/avro/io.h
View
@@ -97,6 +97,9 @@ typedef struct avro_file_writer_t_ *avro_file_writer_t;
int avro_file_writer_create(const char *path, avro_schema_t schema,
avro_file_writer_t * writer);
+int avro_file_writer_create_with_codec(const char *path,
+ avro_schema_t schema, avro_file_writer_t * writer,
+ const char *codec);
int avro_file_writer_open(const char *path, avro_file_writer_t * writer);
int avro_file_reader(const char *path, avro_file_reader_t * reader);
258 lang/c/src/codec.c
View
@@ -0,0 +1,258 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+#include <zlib.h>
+#include <string.h>
+#include "avro/errors.h"
+#include "avro/allocation.h"
+#include "codec.h"
+
+struct codec_data_deflate {
+ z_stream deflate;
+ z_stream inflate;
+};
+#define codec_data_deflate_stream(cd) &((struct codec_data_deflate *)cd)->deflate
+#define codec_data_inflate_stream(cd) &((struct codec_data_deflate *)cd)->inflate
+
+#define DEFLATE_BUFSIZE (16 * 1024)
+
+static int
+codec_deflate(avro_codec_t codec)
+{
+ codec->name = "deflate";
+ codec->type = AVRO_CODEC_DEFLATE;
+ codec->block_size = 0;
+ codec->block_data = NULL;
+ codec->codec_data = avro_new(struct codec_data_deflate);
+
+ if (!codec->codec_data) {
+ avro_set_error("Cannot allocate memory for zlib");
+ return 1;
+ }
+
+ z_stream *ds = codec_data_deflate_stream(codec->codec_data);
+ z_stream *is = codec_data_inflate_stream(codec->codec_data);
+
+ memset(ds, 0, sizeof(z_stream));
+ memset(is, 0, sizeof(z_stream));
+
+ ds->zalloc = is->zalloc = Z_NULL;
+ ds->zfree = is->zfree = Z_NULL;
+ ds->opaque = is->opaque = Z_NULL;
+
+ if (deflateInit2(ds, Z_BEST_COMPRESSION, Z_DEFLATED, -15, 8, Z_DEFAULT_STRATEGY) != Z_OK) {
+ avro_freet(struct codec_data_deflate, codec->codec_data);
+ avro_set_error("Cannot initialize zlib deflate");
+ return 1;
+ }
+
+ if (inflateInit2(is, -15) != Z_OK) {
+ avro_freet(struct codec_data_deflate, codec->codec_data);
+ avro_set_error("Cannot initialize zlib inflate");
+ return 1;
+ }
+
+ return 0;
+}
+
+static int
+codec_null(avro_codec_t codec)
+{
+ codec->name = "null";
+ codec->type = AVRO_CODEC_NULL;
+ codec->block_size = 0;
+ codec->block_data = NULL;
+ codec->codec_data = NULL;
+
+ return 0;
+}
+
+int avro_codec(avro_codec_t codec, const char *type)
+{
+ if (strcmp("deflate", type) == 0) {
+ return codec_deflate(codec);
+ } else {
+ return codec_null(codec);
+ }
+
+ return 0;
+}
+
+static int encode_deflate(avro_codec_t c, void * data, int64_t len)
+{
+ size_t defl_len;
+ int err;
+
+ defl_len = compressBound((uLong)len * 1.2);
+
+ if (!c->block_data) {
+ c->block_data = avro_malloc(defl_len);
+ } else {
+ c->block_data = avro_realloc(c->block_data, c->block_size, defl_len);
+ }
+
+ if (!c->block_data)
+ {
+ avro_set_error("Cannot allocate memory for deflate");
+ return 1;
+ }
+
+ c->block_size = defl_len;
+
+ z_stream *s = codec_data_deflate_stream(c->codec_data);
+
+ s->next_in = (Bytef*)data;
+ s->avail_in = (uInt)len;
+
+ s->next_out = c->block_data;
+ s->avail_out = (uInt)c->block_size;
+
+ s->total_out = 0;
+
+ err = deflate(s, Z_FINISH);
+ if (err != Z_STREAM_END) {
+ deflateEnd(s);
+ return err == Z_OK ? 1 : 0;
+ }
+
+ c->block_size = s->total_out;
+
+ if (deflateReset(s) != Z_OK) {
+ return 1;
+ }
+
+ return 0;
+}
+
+static int encode_null(avro_codec_t c, void * data, int64_t len)
+{
+ c->block_data = data;
+ c->block_size = len;
+
+ return 0;
+}
+
+int avro_codec_encode(avro_codec_t c, void * data, int64_t len)
+{
+ if (c->type == AVRO_CODEC_NULL) {
+ return encode_null(c, data, len);
+ } else if (c->type == AVRO_CODEC_DEFLATE) {
+ return encode_deflate(c, data, len);
+ }
+
+ return 0;
+}
+
+static int decode_deflate(avro_codec_t c, void * data, int64_t len)
+{
+ int err;
+
+ if (!c->block_data) {
+ c->block_data = avro_malloc(DEFLATE_BUFSIZE);
+ } else {
+ c->block_data = avro_realloc(c->block_data, c->block_size, DEFLATE_BUFSIZE);
+ }
+
+ if (!c->block_data)
+ {
+ avro_set_error("Cannot allocate memory for deflate");
+ return 1;
+ }
+
+ c->block_size = DEFLATE_BUFSIZE;
+
+ z_stream *s = codec_data_inflate_stream(c->codec_data);
+
+ s->next_in = data;
+ s->avail_in = len;
+
+ s->next_out = c->block_data;
+ s->avail_out = c->block_size;
+
+ s->total_out = 0;
+
+ err = inflate(s, Z_FINISH);
+ if (err != Z_STREAM_END) {
+ inflateEnd(s);
+ return err == Z_OK ? 1 : 0;
+ }
+
+ c->block_size = s->total_out;
+
+ if (inflateReset(s) != Z_OK) {
+ return 1;
+ }
+
+ return 0;
+}
+
+static int decode_null(avro_codec_t c, void * data, int64_t len)
+{
+ c->block_data = data;
+ c->block_size = len;
+
+ return 0;
+}
+
+int avro_codec_decode(avro_codec_t c, void * data, int64_t len)
+{
+ if (c->type == AVRO_CODEC_NULL) {
+ return decode_null(c, data, len);
+ } else if (c->type == AVRO_CODEC_DEFLATE) {
+ return decode_deflate(c, data, len);
+ }
+
+ return 0;
+}
+
+static int reset_deflate(avro_codec_t c)
+{
+ if (c->block_data) {
+ avro_free(c->block_data, c->block_size);
+ }
+ if (c->codec_data) {
+ deflateEnd(codec_data_deflate_stream(c->codec_data));
+ inflateEnd(codec_data_inflate_stream(c->codec_data));
+ avro_freet(struct codec_data_deflate, c->codec_data);
+ }
+
+ c->block_data = NULL;
+ c->block_size = 0;
+ c->codec_data = NULL;
+
+ return 0;
+}
+
+static int reset_null(avro_codec_t c)
+{
+ c->block_data = NULL;
+ c->block_size = 0;
+ c->codec_data = NULL;
+
+ return 0;
+}
+
+int avro_codec_reset(avro_codec_t c)
+{
+ if (c->type == AVRO_CODEC_NULL) {
+ return reset_null(c);
+ } else if (c->type == AVRO_CODEC_DEFLATE) {
+ return reset_deflate(c);
+ }
+
+ return 0;
+}
41 lang/c/src/codec.h
View
@@ -0,0 +1,41 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to you under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+ * implied. See the License for the specific language governing
+ * permissions and limitations under the License.
+ */
+
+#ifndef AVRO_CODEC_H
+#define AVRO_CODEC_H
+
+enum avro_codec_type_t {
+ AVRO_CODEC_NULL,
+ AVRO_CODEC_DEFLATE
+};
+typedef enum avro_codec_type_t avro_codec_type_t;
+
+struct avro_codec_t_ {
+ const char * name;
+ avro_codec_type_t type;
+ int64_t block_size;
+ void * block_data;
+ void * codec_data;
+};
+typedef struct avro_codec_t_* avro_codec_t;
+
+int avro_codec(avro_codec_t c, const char *type);
+int avro_codec_reset(avro_codec_t c);
+int avro_codec_encode(avro_codec_t c, void * data, int64_t len);
+int avro_codec_decode(avro_codec_t c, void * data, int64_t len);
+
+#endif
130 lang/c/src/datafile.c
View
@@ -21,6 +21,7 @@
#include "avro/errors.h"
#include "avro/value.h"
#include "encoding.h"
+#include "codec.h"
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
@@ -31,15 +32,19 @@
struct avro_file_reader_t_ {
avro_schema_t writers_schema;
avro_reader_t reader;
+ avro_reader_t block_reader;
+ avro_codec_t codec;
char sync[16];
int64_t blocks_read;
int64_t blocks_total;
int64_t current_blocklen;
+ char * current_blockdata;
};
struct avro_file_writer_t_ {
avro_schema_t writers_schema;
avro_writer_t writer;
+ avro_codec_t codec;
char sync[16];
int block_count;
size_t block_size;
@@ -82,7 +87,7 @@ static int write_header(avro_file_writer_t w)
check(rval, enc->write_string(w->writer, "avro.sync"));
check(rval, enc->write_bytes(w->writer, w->sync, sizeof(w->sync)));
check(rval, enc->write_string(w->writer, "avro.codec"));
- check(rval, enc->write_bytes(w->writer, "null", 4));
+ check(rval, enc->write_bytes(w->writer, w->codec->name, strlen(w->codec->name)));
check(rval, enc->write_string(w->writer, "avro.schema"));
schema_writer = avro_writer_memory(schema_buf, sizeof(schema_buf));
rval = avro_schema_to_json(w->writers_schema, schema_writer);
@@ -140,29 +145,48 @@ int
avro_file_writer_create(const char *path, avro_schema_t schema,
avro_file_writer_t * writer)
{
+ return avro_file_writer_create_with_codec(path, schema, writer, "null");
+}
+
+int avro_file_writer_create_with_codec(const char *path,
+ avro_schema_t schema, avro_file_writer_t * writer,
+ const char *codec)
+{
avro_file_writer_t w;
int rval;
check_param(EINVAL, path, "path");
check_param(EINVAL, is_avro_schema(schema), "schema");
check_param(EINVAL, writer, "writer");
+ check_param(EINVAL, codec, "codec");
w = avro_new(struct avro_file_writer_t_);
if (!w) {
avro_set_error("Cannot allocate new file writer");
return ENOMEM;
}
+ w->codec = avro_new(struct avro_codec_t_);
+ if (!w->codec) {
+ avro_set_error("Cannot allocate new codec");
+ return ENOMEM;
+ }
+ rval = avro_codec(w->codec, codec);
+ if (rval) {
+ avro_freet(struct avro_codec_t_, w->codec);
+ return rval;
+ }
rval = file_writer_create(path, schema, w);
if (rval) {
avro_freet(struct avro_file_writer_t_, w);
return rval;
}
*writer = w;
+
return 0;
}
static int file_read_header(avro_reader_t reader,
- avro_schema_t * writers_schema, char *sync,
- int synclen)
+ avro_schema_t * writers_schema, avro_codec_t codec,
+ char *sync, int synclen)
{
int rval;
avro_schema_t meta_schema;
@@ -170,6 +194,7 @@ static int file_read_header(avro_reader_t reader,
avro_value_iface_t *meta_iface;
avro_value_t meta;
char magic[4];
+ avro_value_t codec_val;
avro_value_t schema_bytes;
const void *p;
size_t len;
@@ -196,6 +221,40 @@ static int file_read_header(avro_reader_t reader,
}
avro_schema_decref(meta_schema);
+ rval = avro_value_get_by_name(&meta, "avro.codec", &codec_val, NULL);
+ if (rval) {
+ avro_set_error("File header doesn't contain a codec");
+ avro_value_decref(&meta);
+ return rval;
+ } else {
+ const void *buf;
+ size_t size;
+ const char *codec_name;
+
+ avro_type_t type = avro_value_get_type(&codec_val);
+
+ if (type != AVRO_BYTES) {
+ avro_set_error("Value type of codec is unexpected");
+ avro_value_decref(&meta);
+ return EILSEQ;
+ }
+
+ avro_value_get_bytes(&codec_val, &buf, &size);
+
+ if (size == 4 && strncmp((const char *) buf, "null", 4) == 0) {
+ codec_name = "null";
+ } else if (size == 7
+ && strncmp((const char *) buf, "deflate", 7) == 0) {
+ codec_name = "deflate";
+ } else {
+ avro_set_error("File header contains an unknown codec");
+ avro_value_decref(&meta);
+ return EILSEQ;
+ }
+
+ avro_codec(codec, codec_name);
+ }
+
rval = avro_value_get_by_name(&meta, "avro.schema", &schema_bytes, NULL);
if (rval) {
avro_set_error("File header doesn't contain a schema");
@@ -235,7 +294,7 @@ static int file_writer_open(const char *path, avro_file_writer_t w)
return ENOMEM;
}
rval =
- file_read_header(reader, &w->writers_schema, w->sync,
+ file_read_header(reader, &w->writers_schema, w->codec, w->sync,
sizeof(w->sync));
avro_reader_free(reader);
/* Position to end of file and get ready to write */
@@ -271,11 +330,33 @@ int avro_file_writer_open(const char *path, avro_file_writer_t * writer)
static int file_read_block_count(avro_file_reader_t r)
{
int rval;
+ int64_t len;
const avro_encoding_t *enc = &avro_binary_encoding;
check_prefix(rval, enc->read_long(r->reader, &r->blocks_total),
"Cannot read file block count: ");
- check_prefix(rval, enc->read_long(r->reader, &r->current_blocklen),
+ check_prefix(rval, enc->read_long(r->reader, &len),
"Cannot read file block size: ");
+
+ if (r->current_blockdata) {
+ r->current_blockdata = avro_realloc(r->current_blockdata, r->current_blocklen, len);
+ } else {
+ r->current_blockdata = avro_malloc(len);
+ }
+
+ r->current_blocklen = len;
+
+ check_prefix(rval, avro_read(r->reader, r->current_blockdata, len),
+ "Cannot read file block: ");
+ if (len < r->current_blocklen) {
+ fprintf(stderr, "Len: %lld Blocklen: %lld\n", len, r->current_blocklen);
+ avro_set_error("Could not read entire block");
+ return 1;
+ }
+
+ avro_codec_decode(r->codec, r->current_blockdata, r->current_blocklen);
+
+ avro_reader_memory_set_source(r->block_reader, r->codec->block_data, r->codec->block_size);
+
r->blocks_read = 0;
return 0;
}
@@ -301,14 +382,30 @@ int avro_file_reader(const char *path, avro_file_reader_t * reader)
avro_freet(struct avro_file_reader_t_, r);
return ENOMEM;
}
+ r->block_reader = avro_reader_memory(0, 0);
+ if (!r->block_reader) {
+ avro_set_error("Cannot allocate block reader for file %s", path);
+ avro_freet(struct avro_file_reader_t_, r);
+ return ENOMEM;
+ }
- rval = file_read_header(r->reader, &r->writers_schema, r->sync,
- sizeof(r->sync));
+ r->codec = avro_new(struct avro_codec_t_);
+ if (!r->codec) {
+ avro_set_error("Could not allocate codec for file %s", path);
+ avro_freet(struct avro_file_reader_t_, r);
+ return ENOMEM;
+ }
+
+ rval = file_read_header(r->reader, &r->writers_schema, r->codec,
+ r->sync, sizeof(r->sync));
if (rval) {
avro_freet(struct avro_file_reader_t_, r);
return rval;
}
+ r->current_blockdata = NULL;
+ r->current_blocklen = 0;
+
rval = file_read_block_count(r);
if (rval) {
avro_freet(struct avro_file_reader_t_, r);
@@ -335,11 +432,14 @@ static int file_write_block(avro_file_writer_t w)
/* Write the block count */
check_prefix(rval, enc->write_long(w->writer, w->block_count),
"Cannot write file block count: ");
+ /* Encode the block */
+ check_prefix(rval, avro_codec_encode(w->codec, w->datum_buffer, w->block_size),
+ "Cannot encode file block: ");
/* Write the block length */
- check_prefix(rval, enc->write_long(w->writer, w->block_size),
+ check_prefix(rval, enc->write_long(w->writer, w->codec->block_size),
"Cannot write file block size: ");
/* Write the block */
- check_prefix(rval, avro_write(w->writer, w->datum_buffer, w->block_size),
+ check_prefix(rval, avro_write(w->writer, w->codec->block_data, w->codec->block_size),
"Cannot write file block: ");
/* Write the sync marker */
check_prefix(rval, write_sync(w),
@@ -417,6 +517,8 @@ int avro_file_writer_close(avro_file_writer_t w)
check(rval, avro_file_writer_flush(w));
avro_writer_free(w->datum_writer);
avro_writer_free(w->writer);
+ avro_codec_reset(w->codec);
+ avro_freet(struct avro_codec_t_, w->codec);
avro_freet(struct avro_file_writer_t_, w);
return 0;
}
@@ -431,7 +533,7 @@ int avro_file_reader_read(avro_file_reader_t r, avro_schema_t readers_schema,
check_param(EINVAL, datum, "datum");
check(rval,
- avro_read_data(r->reader, r->writers_schema, readers_schema,
+ avro_read_data(r->block_reader, r->writers_schema, readers_schema,
datum));
r->blocks_read++;
@@ -457,7 +559,7 @@ avro_file_reader_read_value(avro_file_reader_t r, avro_value_t *value)
check_param(EINVAL, r, "reader");
check_param(EINVAL, value, "value");
- check(rval, avro_value_read(r->reader, value));
+ check(rval, avro_value_read(r->block_reader, value));
r->blocks_read++;
if (r->blocks_read == r->blocks_total) {
@@ -477,6 +579,12 @@ int avro_file_reader_close(avro_file_reader_t reader)
{
avro_schema_decref(reader->writers_schema);
avro_reader_free(reader->reader);
+ avro_reader_free(reader->block_reader);
+ avro_codec_reset(reader->codec);
+ avro_freet(struct avro_codec_t_, reader->codec);
+ if (reader->current_blockdata) {
+ avro_free(reader->current_blockdata, reader->current_blocklen);
+ }
avro_freet(struct avro_file_reader_t_, reader);
return 0;
}
18 lang/c/tests/CMakeLists.txt
View
@@ -18,34 +18,34 @@
#
add_executable(generate_interop_data generate_interop_data.c)
-target_link_libraries(generate_interop_data avro-static)
+target_link_libraries(generate_interop_data avro-static z)
add_executable(performance performance.c)
-target_link_libraries(performance avro-static)
+target_link_libraries(performance avro-static z)
add_executable(test_interop_data test_interop_data.c)
-target_link_libraries(test_interop_data avro-static)
+target_link_libraries(test_interop_data avro-static z)
add_executable(test_data_structures test_data_structures.c)
-target_link_libraries(test_data_structures avro-static)
+target_link_libraries(test_data_structures avro-static z)
add_test(test_data_structures ${CMAKE_COMMAND} -E chdir ${AvroC_SOURCE_DIR}/tests ${CMAKE_CURRENT_BINARY_DIR}/test_data_structures)
add_executable(test_avro_schema test_avro_schema.c)
-target_link_libraries(test_avro_schema avro-static)
+target_link_libraries(test_avro_schema avro-static z)
add_test(test_avro_schema ${CMAKE_COMMAND} -E chdir ${AvroC_SOURCE_DIR}/tests ${CMAKE_CURRENT_BINARY_DIR}/test_avro_schema)
add_executable(test_avro_schema_names test_avro_schema_names.c)
-target_link_libraries(test_avro_schema_names avro-static)
+target_link_libraries(test_avro_schema_names avro-static z)
add_test(test_avro_schema_names ${CMAKE_COMMAND} -E chdir ${AvroC_SOURCE_DIR}/tests ${CMAKE_CURRENT_BINARY_DIR}/test_avro_schema_names)
add_executable(test_avro_values test_avro_values.c)
-target_link_libraries(test_avro_values avro-static)
+target_link_libraries(test_avro_values avro-static z)
add_test(test_avro_values ${CMAKE_COMMAND} -E chdir ${AvroC_SOURCE_DIR}/tests ${CMAKE_CURRENT_BINARY_DIR}/test_avro_values)
add_executable(test_avro_data test_avro_data.c)
-target_link_libraries(test_avro_data avro-static)
+target_link_libraries(test_avro_data avro-static z)
add_test(test_avro_data ${CMAKE_COMMAND} -E chdir ${AvroC_SOURCE_DIR}/tests ${CMAKE_CURRENT_BINARY_DIR}/test_avro_data)
add_executable(test_cpp test_cpp.cpp)
-target_link_libraries(test_cpp avro-static)
+target_link_libraries(test_cpp avro-static z)
add_test(test_cpp ${CMAKE_COMMAND} -E chdir ${AvroC_SOURCE_DIR}/tests ${CMAKE_CURRENT_BINARY_DIR}/test_cpp)
Something went wrong with that request. Please try again.