This is an automated email from the ASF dual-hosted git repository.
rlenferink pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/celix.git
The following commit(s) were added to refs/heads/develop by this push:
new d384385 Fix for curl dependency (#45)
d384385 is described below
commit d384385b6f3d28fbcfe5dd165633bfacac93bf24
Author: idzardh <[email protected]>
AuthorDate: Tue Sep 3 13:01:52 2019 +0200
Fix for curl dependency (#45)
---
.travis.yml | 2 +-
CMakeLists.txt | 44 +++++++++++++++++++---
bundles/deployment_admin/CMakeLists.txt | 2 +-
.../src/pubsub_udpmc_topic_sender.c | 1 +
bundles/pubsub/pubsub_discovery/CMakeLists.txt | 2 +-
.../discovery_configured/CMakeLists.txt | 2 +-
.../remote_services/discovery_etcd/CMakeLists.txt | 2 +-
.../remote_services/discovery_shm/CMakeLists.txt | 2 +-
.../remote_service_admin_dfi/CMakeLists.txt | 5 +--
.../remote_service_admin_dfi/test/CMakeLists.txt | 2 +-
.../private/test/CMakeLists.txt | 2 +-
bundles/shell/shell/CMakeLists.txt | 2 +-
libs/etcdlib/CMakeLists.txt | 6 +--
libs/framework/CMakeLists.txt | 2 +-
14 files changed, 55 insertions(+), 21 deletions(-)
diff --git a/.travis.yml b/.travis.yml
index d808a5b..1d1cd30 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -42,7 +42,7 @@ matrix:
before_install:
- if [ "$TRAVIS_OS_NAME" = "linux" ] && [ -z "$ANDROID" ]; then sudo
add-apt-repository ppa:ubuntu-toolchain-r/test -y && sudo apt-get -qq update &&
sudo apt-get install -y uuid-dev libxml2-dev lcov libffi-dev gcc-4.8 g++-4.8; fi
- - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update && brew install lcov
libffi zeromq czmq && brew link --force libffi; fi
+ - if [ "$TRAVIS_OS_NAME" = "osx" ]; then brew update && brew install lcov
libffi zeromq czmq openssl && brew link --force libffi; fi
before_script:
- wget
https://github.com/cpputest/cpputest/releases/download/v3.8/cpputest-3.8.tar.gz
-O /tmp/cpputest.tar.gz
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 792114a..2bac90d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -5,9 +5,9 @@
# 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
@@ -32,11 +32,14 @@ IF (${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION} EQUAL 3.3
AND ${CMAKE_GENERATO
message( FATAL_ERROR "Building Celix using CMake 3.3 and makefiles is not
supported due to a bug in the Makefile Generator (see Bug 15696). Please change
the used CMake version - both, CMake 3.2 and CMake 3.4 are working fine. Or use
a different generator (e.g. Ninja)." )
ENDIF()
+set(ENABLE_W_ERROR ON)
+set(ENABLE_MORE_WARNINGS OFF)
+
IF (ANDROID)
set(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 -Wall ${CMAKE_C_FLAGS}")
ELSE ()
- set(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 -Wall -Werror -fPIC
${CMAKE_C_FLAGS}") #TODO add -Wextra
- set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Werror -Wextra -Weffc++ -fno-rtti
-fno-exceptions ${CMAKE_CXX_FLAGS}")
+ set(CMAKE_C_FLAGS "-D_GNU_SOURCE -std=gnu99 -Wall -Werror -fPIC
${CMAKE_C_FLAGS}")
+ set(CMAKE_CXX_FLAGS "-std=c++11 -Wall -Wextra -Weffc++ -fno-rtti
-fno-exceptions ${CMAKE_CXX_FLAGS}")
set(CMAKE_C_FLAGS_DEBUG "-g -DDEBUG ${CMAKE_C_FLAGS}")
set(CMAKE_CXX_FLAGS_DEBUG "-g -DDEBUG ${CMAKE_CXX_FLAGS}")
ENDIF()
@@ -49,6 +52,37 @@ ELSE ()
set(CMAKE_EXE_LINKER_FLAGS "-pthread ${CMAKE_EXE_LINKER_FLAGS}")
ENDIF()
+if (ENABLE_MORE_WARNINGS)
+ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4)
+ set(CMAKE_CXX_EXTRA_FLAGS "-Wlogical-op -Wold-style-cast
-Wuseless-cast -Wdouble-promotion -Wshadow -Wformat=2")
+ endif()
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 6)
+ set(CMAKE_CXX_EXTRA_FLAGS "-Wduplicated-cond -Wnull-dereference
${CMAKE_CXX_EXTRA_FLAGS}")
+ endif()
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7)
+ set(CMAKE_CXX_EXTRA_FLAGS "-Wrestrict -Wduplicated-branches
${CMAKE_CXX_EXTRA_FLAGS}")
+ endif()
+ endif()
+
+ if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 3.5)
+ set(CMAKE_CXX_EXTRA_FLAGS "-Wlogical-op -Wold-style-cast -Wshadow
-Wformat=2 -Wnull-dereference")
+ endif()
+ if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 4)
+ set(CMAKE_CXX_EXTRA_FLAGS "-Wold-style-cast -Wuseless-cast
${CMAKE_CXX_EXTRA_FLAGS}")
+ endif()
+ endif()
+
+ set(CMAKE_CXX_FLAGS "${CMAKE_CXX_EXTRA_FLAGS} ${CMAKE_CXX_FLAGS}")
+ set(CMAKE_CXX_FLAGS_DEBUG "-Werror ${CMAKE_CXX_EXTRA_FLAGS}
${CMAKE_CXX_FLAGS_DEBUG}")
+endif()
+
+if(ENABLE_W_ERROR)
+ set(CMAKE_CXX_FLAGS "-Werror ${CMAKE_CXX_FLAGS}")
+ set(CMAKE_CXX_FLAGS_DEBUG "-Werror ${CMAKE_CXX_FLAGS_DEBUG}")
+endif()
+
# Set version for the framework package/release
set(CELIX_MAJOR "2")
set(CELIX_MINOR "2")
@@ -57,7 +91,7 @@ set(CELIX_MICRO "0")
option(ENABLE_TESTING "Enables unit/bundle testing" FALSE)
if (ENABLE_TESTING)
- enable_testing()
+ enable_testing()
endif()
# Default bundle version
diff --git a/bundles/deployment_admin/CMakeLists.txt
b/bundles/deployment_admin/CMakeLists.txt
index 25286b7..c1d23a6 100644
--- a/bundles/deployment_admin/CMakeLists.txt
+++ b/bundles/deployment_admin/CMakeLists.txt
@@ -50,7 +50,7 @@ if (DEPLOYMENT_ADMIN)
)
target_compile_definitions(deployment_admin PRIVATE -DUSE_FILE32API)
- target_link_libraries(deployment_admin PRIVATE ${CURL_LIBRARIES}
${UUID_LIBRARY} ${ZLIB_LIBRARIES} deployment_admin_api)
+ target_link_libraries(deployment_admin PRIVATE ${CURL_LIBRARY}
${UUID_LIBRARY} ${ZLIB_LIBRARIES} deployment_admin_api)
target_include_directories(deployment_admin PRIVATE ${CURL_INCLUDE_DIRS})
install(TARGETS deployment_admin_api EXPORT celix COMPONENT
deployment_admin)
diff --git a/bundles/pubsub/pubsub_admin_udp_mc/src/pubsub_udpmc_topic_sender.c
b/bundles/pubsub/pubsub_admin_udp_mc/src/pubsub_udpmc_topic_sender.c
index 1023005..3f37325 100644
--- a/bundles/pubsub/pubsub_admin_udp_mc/src/pubsub_udpmc_topic_sender.c
+++ b/bundles/pubsub/pubsub_admin_udp_mc/src/pubsub_udpmc_topic_sender.c
@@ -18,6 +18,7 @@
*/
#include <pubsub_serializer.h>
+#include <stdint.h>
#include <stdlib.h>
#include <memory.h>
#include <pubsub_constants.h>
diff --git a/bundles/pubsub/pubsub_discovery/CMakeLists.txt
b/bundles/pubsub/pubsub_discovery/CMakeLists.txt
index a85fde6..0d48101 100644
--- a/bundles/pubsub/pubsub_discovery/CMakeLists.txt
+++ b/bundles/pubsub/pubsub_discovery/CMakeLists.txt
@@ -34,7 +34,7 @@ target_include_directories(celix_pubsub_discovery_etcd SYSTEM
PRIVATE
target_link_libraries(celix_pubsub_discovery_etcd PRIVATE
Celix::pubsub_spi Celix::framework Celix::etcdlib_static
Celix::shell_api Celix::log_helper
- ${CURL_LIBRARIES} ${JANSSON_LIBRARIES})
+ ${CURL_LIBRARY} ${JANSSON_LIBRARIES})
install_celix_bundle(celix_pubsub_discovery_etcd EXPORT celix COMPONENT pubsub)
diff --git a/bundles/remote_services/discovery_configured/CMakeLists.txt
b/bundles/remote_services/discovery_configured/CMakeLists.txt
index 089d1bd..fbfbd5b 100644
--- a/bundles/remote_services/discovery_configured/CMakeLists.txt
+++ b/bundles/remote_services/discovery_configured/CMakeLists.txt
@@ -33,7 +33,7 @@ if (RSA_DISCOVERY_CONFIGURED)
$<TARGET_PROPERTY:Celix::rsa_discovery_common,INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:Celix::civetweb,INCLUDE_DIRECTORIES>
)
- target_link_libraries(rsa_discovery_configured PRIVATE ${CURL_LIBRARIES}
${LIBXML2_LIBRARIES} Celix::log_helper Celix::rsa_common)
+ target_link_libraries(rsa_discovery_configured PRIVATE ${CURL_LIBRARY}
${LIBXML2_LIBRARIES} Celix::log_helper Celix::rsa_common)
install_celix_bundle(rsa_discovery_configured EXPORT celix COMPONENT rsa)
#Setup target aliases to match external usage
diff --git a/bundles/remote_services/discovery_etcd/CMakeLists.txt
b/bundles/remote_services/discovery_etcd/CMakeLists.txt
index 481885f..d1d9e40 100644
--- a/bundles/remote_services/discovery_etcd/CMakeLists.txt
+++ b/bundles/remote_services/discovery_etcd/CMakeLists.txt
@@ -43,7 +43,7 @@ if (RSA_DISCOVERY_ETCD)
${JANSSON_INCLUDE_DIR}
${LIBXML2_INCLUDE_DIR}
)
- target_link_libraries(rsa_discovery_etcd PRIVATE ${CURL_LIBRARIES}
${LIBXML2_LIBRARIES} ${JANSSON_LIBRARIES})
+ target_link_libraries(rsa_discovery_etcd PRIVATE ${CURL_LIBRARY}
${LIBXML2_LIBRARIES} ${JANSSON_LIBRARIES})
install_celix_bundle(rsa_discovery_etcd EXPORT celix COMPONENT rsa)
#Setup target aliases to match external usage
diff --git a/bundles/remote_services/discovery_shm/CMakeLists.txt
b/bundles/remote_services/discovery_shm/CMakeLists.txt
index bb9066f..5da43a2 100644
--- a/bundles/remote_services/discovery_shm/CMakeLists.txt
+++ b/bundles/remote_services/discovery_shm/CMakeLists.txt
@@ -39,7 +39,7 @@ find_package(CURL REQUIRED)
$<TARGET_PROPERTY:Celix::rsa_discovery_common,INCLUDE_DIRECTORIES>
$<TARGET_PROPERTY:Celix::civetweb,INCLUDE_DIRECTORIES>
)
- target_link_libraries(rsa_discovery_shm PRIVATE Celix::framework
${CURL_LIBRARIES} ${LIBXML2_LIBRARIES})
+ target_link_libraries(rsa_discovery_shm PRIVATE Celix::framework
${CURL_LIBRARY} ${LIBXML2_LIBRARIES})
install_celix_bundle(rsa_discovery_shm EXPORT celix COMPONENT rsa)
diff --git a/bundles/remote_services/remote_service_admin_dfi/CMakeLists.txt
b/bundles/remote_services/remote_service_admin_dfi/CMakeLists.txt
index b362ffa..bb06763 100644
--- a/bundles/remote_services/remote_service_admin_dfi/CMakeLists.txt
+++ b/bundles/remote_services/remote_service_admin_dfi/CMakeLists.txt
@@ -45,13 +45,12 @@ if (RSA_REMOTE_SERVICE_ADMIN_DFI)
)
celix_bundle_private_libs(rsa_dfi Celix::dfi)
target_include_directories(rsa_dfi PRIVATE
$<TARGET_PROPERTY:Celix::civetweb,INCLUDE_DIRECTORIES>)
- #target_include_directories(rsa_dfi SYSTEM PRIVATE ${CURL_INCLUDE_DIRS}
${JANSSON_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS})
- target_include_directories(rsa_dfi PRIVATE ${JANSSON_INCLUDE_DIRS}
${UUID_INCLUDE_DIRS})
+ target_include_directories(rsa_dfi SYSTEM PRIVATE ${CURL_INCLUDE_DIRS}
${JANSSON_INCLUDE_DIRS} ${UUID_INCLUDE_DIRS})
target_link_libraries(rsa_dfi PRIVATE
Celix::dfi
Celix::log_helper
Celix::rsa_common
- ${CURL_LIBRARIES} ${JANSSON_LIBRARIES})
+ ${CURL_LIBRARY} ${JANSSON_LIBRARIES})
if (ENABLE_TESTING)
add_subdirectory(test)
diff --git
a/bundles/remote_services/remote_service_admin_dfi/test/CMakeLists.txt
b/bundles/remote_services/remote_service_admin_dfi/test/CMakeLists.txt
index aa10ec3..9790181 100644
--- a/bundles/remote_services/remote_service_admin_dfi/test/CMakeLists.txt
+++ b/bundles/remote_services/remote_service_admin_dfi/test/CMakeLists.txt
@@ -34,7 +34,7 @@ add_executable(test_rsa_dfi
src/rsa_client_server_tests.cpp
)
target_include_directories(test_rsa_dfi PRIVATE src)
-target_link_libraries(test_rsa_dfi PRIVATE ${CURL_LIBRARIES}
${CPPUTEST_LIBRARY}
+target_link_libraries(test_rsa_dfi PRIVATE ${CURL_LIBRARY} ${CPPUTEST_LIBRARY}
Celix::framework
Celix::rsa_common
calculator_api)
diff --git
a/bundles/remote_services/remote_service_admin_shm/private/test/CMakeLists.txt
b/bundles/remote_services/remote_service_admin_shm/private/test/CMakeLists.txt
index 5e32643..e43cede 100644
---
a/bundles/remote_services/remote_service_admin_shm/private/test/CMakeLists.txt
+++
b/bundles/remote_services/remote_service_admin_shm/private/test/CMakeLists.txt
@@ -35,7 +35,7 @@ add_executable(test_rsa_shm
${PROJECT_SOURCE_DIR}/remote_services/remote_service_admin/private/src/endpoint_description.c
)
-target_link_libraries(test_rsa_shm celix_framework celix_utils
${CURL_LIBRARIES} ${CPPUTEST_LIBRARY})
+target_link_libraries(test_rsa_shm celix_framework celix_utils ${CURL_LIBRARY}
${CPPUTEST_LIBRARY})
get_property(rsa_bundle_file TARGET remote_service_admin_shm PROPERTY
BUNDLE_FILE)
get_property(calc_bundle_file TARGET calculator PROPERTY BUNDLE_FILE)
diff --git a/bundles/shell/shell/CMakeLists.txt
b/bundles/shell/shell/CMakeLists.txt
index e6e15ae..da45417 100644
--- a/bundles/shell/shell/CMakeLists.txt
+++ b/bundles/shell/shell/CMakeLists.txt
@@ -47,7 +47,7 @@ if (SHELL)
)
target_include_directories(shell PRIVATE src)
target_include_directories(shell SYSTEM PRIVATE ${CURL_INCLUDE_DIRS})
- target_link_libraries(shell PRIVATE Celix::shell_api ${CURL_LIBRARIES}
Celix::log_service_api Celix::log_helper)
+ target_link_libraries(shell PRIVATE Celix::shell_api ${CURL_LIBRARY}
Celix::log_service_api Celix::log_helper)
install_celix_bundle(shell EXPORT celix COMPONENT shell)
diff --git a/libs/etcdlib/CMakeLists.txt b/libs/etcdlib/CMakeLists.txt
index eae7d0f..9a9962f 100644
--- a/libs/etcdlib/CMakeLists.txt
+++ b/libs/etcdlib/CMakeLists.txt
@@ -56,7 +56,7 @@ target_include_directories(etcdlib SYSTEM PRIVATE
set_target_properties(etcdlib PROPERTIES SOVERSION 1)
set_target_properties(etcdlib PROPERTIES VERSION 1.0.0)
-target_link_libraries(etcdlib PRIVATE ${CURL_LIBRARIES} ${JANSSON_LIBRARIES})
+target_link_libraries(etcdlib PRIVATE ${CURL_LIBRARY} ${JANSSON_LIBRARIES})
add_library(etcdlib_static STATIC
src/etcd.c
@@ -71,10 +71,10 @@ target_include_directories(etcdlib_static SYSTEM PRIVATE
${JANSSON_INCLUDE_DIRS}
)
set_target_properties(etcdlib_static PROPERTIES "SOVERSION" 1)
-target_link_libraries(etcdlib_static PRIVATE ${CURL_LIBRARIES}
${JANSSON_LIBRARY})
+target_link_libraries(etcdlib_static PRIVATE ${CURL_LIBRARY}
${JANSSON_LIBRARY})
add_executable(etcdlib_test ${CMAKE_CURRENT_SOURCE_DIR}/test/etcdlib_test.c)
-target_link_libraries(etcdlib_test PRIVATE etcdlib_static)
+target_link_libraries(etcdlib_test PRIVATE etcdlib_static ${CURL_LIBRARY}
${JANSSON_LIBRARY})
#TODO install etcdlib_static. For now left out, because the imported target
leaks library paths
install(DIRECTORY api/ DESTINATION include/etcdlib COMPONENT ${ETCDLIB_CMP})
diff --git a/libs/framework/CMakeLists.txt b/libs/framework/CMakeLists.txt
index 461514d..05f663d 100644
--- a/libs/framework/CMakeLists.txt
+++ b/libs/framework/CMakeLists.txt
@@ -47,7 +47,7 @@ target_include_directories(framework PUBLIC
target_compile_options(framework PRIVATE -DUSE_FILE32API)
set_target_properties(framework PROPERTIES "SOVERSION" 2)
target_link_libraries(framework PUBLIC Celix::utils)
-target_link_libraries(framework PRIVATE ${UUID_LIBRARY} ${ZLIB_LIBRARY}
${CURL_LIBRARIES})
+target_link_libraries(framework PRIVATE ${UUID_LIBRARY} ${ZLIB_LIBRARY}
${CURL_LIBRARY})
target_include_directories(framework PRIVATE ${CURL_INCLUDE_DIR}
${UUID_INCLUDE_DIRS})
install(TARGETS framework EXPORT celix DESTINATION ${CMAKE_INSTALL_LIBDIR}
COMPONENT framework)