Skip to content

Commit

Permalink
build: get CFLAGS (including -werror) used for examples and tests
Browse files Browse the repository at this point in the history
... so that the CI and more detects compiler warnings/errors properly!

Closes #2337
  • Loading branch information
bagder committed Mar 4, 2018
1 parent 68d84cf commit 8b0b1a3
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
5 changes: 4 additions & 1 deletion docs/examples/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
Expand Down Expand Up @@ -53,6 +53,9 @@ else
LDADD = $(LIBDIR)/libcurl.la
endif

# This might hold -Werror
CFLAGS += @CURL_CFLAG_EXTRAS@

# Makefile.inc provides the check_PROGRAMS and COMPLICATED_EXAMPLES defines
include Makefile.inc

Expand Down
4 changes: 3 additions & 1 deletion tests/libtest/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
Expand Down Expand Up @@ -49,6 +49,8 @@ test1022.pl Makefile.inc notexists.pl CMakeLists.txt mk-lib1521.pl

CFLAG_CURL_SYMBOL_HIDING = @CFLAG_CURL_SYMBOL_HIDING@

CFLAGS += @CURL_CFLAG_EXTRAS@

# Prevent LIBS from being used for all link targets
LIBS = $(BLANK_AT_MAKETIME)

Expand Down
4 changes: 2 additions & 2 deletions tests/libtest/lib655.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
Expand All @@ -23,7 +23,7 @@

#include "memdebug.h"

static const char TEST_DATA_STRING[] = "Test data";
static const char *TEST_DATA_STRING = "Test data";
static int cb_count = 0;

static int
Expand Down
4 changes: 3 additions & 1 deletion tests/unit/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# | (__| |_| | _ <| |___
# \___|\___/|_| \_\_____|
#
# Copyright (C) 1998 - 2017, Daniel Stenberg, <daniel@haxx.se>, et al.
# Copyright (C) 1998 - 2018, Daniel Stenberg, <daniel@haxx.se>, et al.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution. The terms
Expand Down Expand Up @@ -50,6 +50,8 @@ endif

EXTRA_DIST = Makefile.inc CMakeLists.txt

CFLAGS += @CURL_CFLAG_EXTRAS@

# Prevent LIBS from being used for all link targets
LIBS = $(BLANK_AT_MAKETIME)

Expand Down
2 changes: 1 addition & 1 deletion tests/unit/unit1607.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
#include "memdebug.h" /* LAST include file */

static struct Curl_easy *easy;
struct curl_hash *hostcache;
static struct curl_hash *hostcache;

static void unit_stop(void)
{
Expand Down

0 comments on commit 8b0b1a3

Please sign in to comment.