From 1054c46f6c9de6e8b86c2a23f345fe18bc1217e9 Mon Sep 17 00:00:00 2001 From: Alex Fabijanic <alex@sysdig.com> Date: Wed, 27 Sep 2017 11:51:43 -0500 Subject: [PATCH] compile pdjson as C++; disarm some windows warnings --- CMakeLists.txt | 2 +- CppUnit/CMakeLists.txt | 3 +++ JSON/CMakeLists.txt | 5 +++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fd951197d..a5855af22 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ # ENABLE_{COMPONENT} # ENABLE_TESTS -cmake_minimum_required(VERSION 2.8.12) +cmake_minimum_required(VERSION 3.2.0) project(Poco) diff --git a/CppUnit/CMakeLists.txt b/CppUnit/CMakeLists.txt index eafded440..956f3ae21 100644 --- a/CppUnit/CMakeLists.txt +++ b/CppUnit/CMakeLists.txt @@ -1,6 +1,9 @@ set(LIBNAME "CppUnit") # Sources +if (WIN32) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) +endif (WIN32) file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( SRCS ${SRCS_G}) diff --git a/JSON/CMakeLists.txt b/JSON/CMakeLists.txt index 5302eaebc..b49373cc8 100644 --- a/JSON/CMakeLists.txt +++ b/JSON/CMakeLists.txt @@ -2,6 +2,10 @@ set(LIBNAME "JSON") set(POCO_LIBNAME "Poco${LIBNAME}") # Sources +if (WIN32) + add_definitions(-D_CRT_SECURE_NO_WARNINGS) +endif (WIN32) + file(GLOB SRCS_G "src/*.cpp") POCO_SOURCES_AUTO( SRCS ${SRCS_G}) @@ -9,6 +13,7 @@ POCO_SOURCES_AUTO( SRCS ${SRCS_G}) file(GLOB_RECURSE HDRS_G "include/*.h" ) POCO_HEADERS_AUTO( SRCS ${HDRS_G}) POCO_SOURCES(SRCS pdjson src/pd_json.c) +SET_SOURCE_FILES_PROPERTIES(src/pd_json.c PROPERTIES LANGUAGE CXX) add_library( "${LIBNAME}" ${LIB_MODE} ${SRCS} ) add_library( "${POCO_LIBNAME}" ALIAS "${LIBNAME}")