Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MINIFICPP-2231 Replace global CXX flags with target specific ones #1724

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 27 additions & 15 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,9 @@ set(PASSTHROUGH_CMAKE_ARGS -DANDROID_ABI=${ANDROID_ABI}
-G${CMAKE_GENERATOR}
)

set(MINIFI_CPP_COMPILE_OPTIONS "")
set(MINIFI_CPP_COMPILE_DEFINITIONS "")

if(CUSTOM_MALLOC)
if (CUSTOM_MALLOC STREQUAL jemalloc)
include(BundledJemalloc)
Expand All @@ -227,8 +230,7 @@ endif()

if(NOT WIN32)
if (ENABLE_JNI)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DENABLE_JNI")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DENABLE_JNI")
list(APPEND MINIFI_CPP_COMPILE_DEFINITIONS ENABLE_JNI)
endif()
endif()

Expand All @@ -248,16 +250,14 @@ if (NOT OPENSSL_OFF)
include(BundledOpenSSL)
use_openssl("${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}")
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/ssl")

set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DOPENSSL_SUPPORT")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DOPENSSL_SUPPORT")
list(APPEND MINIFI_CPP_COMPILE_DEFINITIONS OPENSSL_SUPPORT)
endif()

# libsodium
include(BundledLibSodium)
use_bundled_libsodium("${CMAKE_CURRENT_SOURCE_DIR}" "${CMAKE_CURRENT_BINARY_DIR}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DSODIUM_STATIC=1")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DSODIUM_STATIC=1")

list(APPEND MINIFI_CPP_COMPILE_DEFINITIONS SODIUM_STATIC=1)

# zlib
include(BundledZLIB)
Expand All @@ -274,8 +274,7 @@ if(NOT DISABLE_CURL)
use_bundled_curl(${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_BINARY_DIR})
list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/curl/dummy")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDISABLE_CURL")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DDISABLE_CURL")
list(APPEND MINIFI_CPP_COMPILE_DEFINITIONS DISABLE_CURL)
endif()

# spdlog
Expand Down Expand Up @@ -325,20 +324,33 @@ include(MagicEnum)

# Setup warning flags
if(MSVC)
list(APPEND MINIFI_CPP_COMPILE_OPTIONS /W3)
if(FAIL_ON_WARNINGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /WX")
list(APPEND MINIFI_CPP_COMPILE_OPTIONS /WX)
endif()
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra")
list(APPEND MINIFI_CPP_COMPILE_OPTIONS -Wall -Wextra)
if(FAIL_ON_WARNINGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Werror")
list(APPEND MINIFI_CPP_COMPILE_OPTIONS -Werror)
# -Wrestrict may cause build failure in GCC 12 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104336
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-error=restrict")
list(APPEND MINIFI_CPP_COMPILE_OPTIONS -Wno-error=restrict)
endif()
endif()
endif()

function(add_minifi_library LIBRARY_NAME LINK_TYPE)
add_library(${LIBRARY_NAME} ${LINK_TYPE} ${ARGN})
target_compile_options(${LIBRARY_NAME} PRIVATE ${MINIFI_CPP_COMPILE_OPTIONS})
target_compile_definitions(${LIBRARY_NAME} PRIVATE ${MINIFI_CPP_COMPILE_DEFINITIONS})
endfunction()

function(add_minifi_executable EXECUTABLE_NAME)
add_executable(${EXECUTABLE_NAME} ${ARGN})
target_compile_options(${EXECUTABLE_NAME} PRIVATE ${MINIFI_CPP_COMPILE_OPTIONS})
target_compile_definitions(${EXECUTABLE_NAME} PRIVATE ${MINIFI_CPP_COMPILE_DEFINITIONS})
endfunction()

#### Extensions ####
SET(TEST_DIR ${CMAKE_SOURCE_DIR}/libminifi/test)
include(Extensions)
Expand Down Expand Up @@ -396,7 +408,7 @@ if (WIN32)
${CMAKE_CURRENT_BINARY_DIR}/libminifi
"${CMAKE_CXX_COMPILER}"
"${CMAKE_CXX_COMPILER_VERSION}"
"${CMAKE_CXX_FLAGS}"
"${CMAKE_CXX_FLAGS};${MINIFI_CPP_COMPILE_OPTIONS};${MINIFI_CPP_COMPILE_DEFINITIONS}"
\"${selected_extensions}\"
"${BUILD_IDENTIFIER}"
"${BUILD_REV}")
Expand All @@ -408,7 +420,7 @@ else()
${CMAKE_CURRENT_BINARY_DIR}/libminifi
"${CMAKE_CXX_COMPILER}"
"${CMAKE_CXX_COMPILER_VERSION}"
"${CMAKE_CXX_FLAGS}"
"${CMAKE_CXX_FLAGS};${MINIFI_CPP_COMPILE_OPTIONS};${MINIFI_CPP_COMPILE_DEFINITIONS}"
"${selected_extensions}"
"${BUILD_IDENTIFIER}")
endif()
Expand Down
10 changes: 5 additions & 5 deletions cmake/BuildTests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ enable_testing(test)
SET(TEST_BASE_LIB test_base)
set(TEST_BASE_SOURCES "TestBase.cpp" "StatefulProcessor.cpp" "WriteToFlowFileTestProcessor.cpp" "ReadFromFlowFileTestProcessor.cpp" "DummyProcessor.cpp")
list(TRANSFORM TEST_BASE_SOURCES PREPEND "${TEST_DIR}/")
add_library(${TEST_BASE_LIB} STATIC "${TEST_BASE_SOURCES}")
add_minifi_library(${TEST_BASE_LIB} STATIC "${TEST_BASE_SOURCES}")
target_link_libraries(${TEST_BASE_LIB} core-minifi)
target_include_directories(${TEST_BASE_LIB} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include/")
if(WIN32)
Expand All @@ -112,7 +112,7 @@ endif()
SET(UNIT_TEST_COUNT 0)
FOREACH(testfile ${UNIT_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
add_executable("${testfilename}" "${TEST_DIR}/unit/${testfile}")
add_minifi_executable("${testfilename}" "${TEST_DIR}/unit/${testfile}")
target_compile_definitions("${testfilename}" PRIVATE TZ_DATA_DIR="${CMAKE_BINARY_DIR}/tzdata")
createTests("${testfilename}")
target_link_libraries(${testfilename} Catch2WithMain)
Expand All @@ -125,7 +125,7 @@ if (NOT OPENSSL_OFF)
SET(UNIT_TEST_COUNT 0)
FOREACH(testfile ${TLS_UNIT_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
add_executable("${testfilename}" "${TEST_DIR}/unit/tls/${testfile}")
add_minifi_executable("${testfilename}" "${TEST_DIR}/unit/tls/${testfile}")
createTests("${testfilename}")
MATH(EXPR UNIT_TEST_COUNT "${UNIT_TEST_COUNT}+1")
add_test(NAME "${testfilename}" COMMAND "${testfilename}" "${TEST_RESOURCES}/")
Expand All @@ -137,7 +137,7 @@ if(NOT WIN32 AND ENABLE_NANOFI)
SET(UNIT_TEST_COUNT 0)
FOREACH(testfile ${NANOFI_UNIT_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
add_executable("${testfilename}" "${NANOFI_TEST_DIR}/${testfile}")
add_minifi_executable("${testfilename}" "${NANOFI_TEST_DIR}/${testfile}")
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/nanofi/include")
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/standard-processors/")
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/standard-processors/processors/")
Expand All @@ -160,7 +160,7 @@ endif()
SET(INT_TEST_COUNT 0)
FOREACH(testfile ${INTEGRATION_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
add_executable("${testfilename}" "${TEST_DIR}/integration/${testfile}")
add_minifi_executable("${testfilename}" "${TEST_DIR}/integration/${testfile}")
createTests("${testfilename}")
MATH(EXPR INT_TEST_COUNT "${INT_TEST_COUNT}+1")
ENDFOREACH()
Expand Down
4 changes: 0 additions & 4 deletions cmake/CivetWeb.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ add_dependencies(civetweb-c-library OpenSSL::Crypto OpenSSL::SSL)
add_dependencies(civetweb-cpp OpenSSL::Crypto OpenSSL::SSL)

target_compile_definitions(civetweb-c-library PRIVATE SOCKET_TIMEOUT_QUANTUM=200)
if (NOT WIN32)
target_compile_options(civetweb-c-library PRIVATE -Wno-error)
target_compile_options(civetweb-cpp PRIVATE -Wno-error)
endif()

add_library(civetweb::c-library ALIAS civetweb-c-library)
add_library(civetweb::civetweb-cpp ALIAS civetweb-cpp)
6 changes: 0 additions & 6 deletions cmake/Date.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -58,18 +58,12 @@ if (NOT date_src_POPULATED)
target_sources(date INTERFACE ${DATE_INCLUDE_DIR}/date/date.h)
target_include_directories(date SYSTEM INTERFACE ${DATE_INCLUDE_DIR})
target_compile_features(date INTERFACE cxx_std_11)
if (NOT WIN32)
target_compile_options(date INTERFACE -Wno-error)
endif()

add_library(date-tz STATIC ${date_src_SOURCE_DIR}/src/tz.cpp)
add_library(date::tz ALIAS date-tz)
target_include_directories(date-tz SYSTEM PUBLIC ${DATE_INCLUDE_DIR})
target_compile_features(date-tz PUBLIC cxx_std_11)
target_compile_options(date-tz PRIVATE $<IF:$<CXX_COMPILER_ID:MSVC>,/w,-w>)
if (NOT WIN32)
target_compile_options(date-tz PRIVATE -Wno-error)
endif()
target_compile_definitions(date-tz PRIVATE AUTO_DOWNLOAD=0 HAS_REMOTE_API=0)
if (WIN32)
target_compile_definitions(date-tz PRIVATE INSTALL=. PUBLIC USE_OS_TZDB=0)
Expand Down
13 changes: 0 additions & 13 deletions cmake/GoogleCloudCpp.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,3 @@ FetchContent_Declare(google-cloud-cpp
PATCH_COMMAND "${PC}")
add_compile_definitions(_SILENCE_CXX20_REL_OPS_DEPRECATION_WARNING _SILENCE_CXX17_CODECVT_HEADER_DEPRECATION_WARNING CURL_STATICLIB)
FetchContent_MakeAvailable(google-cloud-cpp)

if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang" AND CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL "14.0.0" )
target_compile_options(google_cloud_cpp_common PUBLIC -Wno-error=deprecated-pragma)
endif()

# MD5_Init, MD5_Update and MD5_Final used in Google Cloud C++ library are deprecated since OpenSSL 3.0
if (WIN32)
target_compile_options(google_cloud_cpp_storage PUBLIC /wd4996)
else()
target_compile_options(google_cloud_cpp_storage PUBLIC -Wno-error=deprecated-declarations)
target_compile_options(google_cloud_cpp_rest_internal PUBLIC -Wno-error)
endif()

19 changes: 0 additions & 19 deletions cmake/Grpc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,6 @@ FetchContent_Declare(
set(FETCHCONTENT_QUIET OFF)
FetchContent_MakeAvailable(grpc)

if (NOT WIN32)
target_compile_options(re2 PRIVATE -Wno-error)
target_compile_options(gpr PRIVATE -Wno-error)
target_compile_options(upb PRIVATE -Wno-error)
target_compile_options(libprotobuf-lite PRIVATE -Wno-error)
target_compile_options(libprotobuf PRIVATE -Wno-error)
target_compile_options(libprotoc PRIVATE -Wno-error)
target_compile_options(grpc PRIVATE -Wno-error)
target_compile_options(grpc_authorization_provider PRIVATE -Wno-error)
target_compile_options(grpc_unsecure PRIVATE -Wno-error)
target_compile_options(grpc_plugin_support PRIVATE -Wno-error)
target_compile_options(grpcpp_channelz PRIVATE -Wno-error)
target_compile_options(grpc++ PRIVATE -Wno-error)
target_compile_options(grpc++_unsecure PRIVATE -Wno-error)
target_compile_options(grpc++_alts PRIVATE -Wno-error)
target_compile_options(grpc++_reflection PRIVATE -Wno-error)
target_compile_options(grpc++_error_details PRIVATE -Wno-error)
endif()

add_dependencies(grpc++ OpenSSL::SSL OpenSSL::Crypto ZLIB::ZLIB)

set(GRPC_INCLUDE_DIR "${grpc_SOURCE_DIR}/include" CACHE STRING "" FORCE)
Expand Down
3 changes: 0 additions & 3 deletions cmake/JsonSchemaValidator.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,3 @@ FetchContent_Declare(json-schema-validator
FetchContent_MakeAvailable(json-schema-validator)

target_compile_options(nlohmann_json_schema_validator PRIVATE -fsigned-char)
if (NOT WIN32)
target_compile_options(nlohmann_json_schema_validator PRIVATE -Wno-error)
endif()
2 changes: 1 addition & 1 deletion controller/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ if (WIN32)
list(APPEND MINIFI_CONTROLLER_SOURCES "${CMAKE_CURRENT_BINARY_DIR}/versioninfo.rc")
endif()

add_executable(minificontroller ${MINIFI_CONTROLLER_SOURCES})
add_minifi_executable(minificontroller "${MINIFI_CONTROLLER_SOURCES}")
include(ArgParse)
target_link_libraries(minificontroller ${LIBMINIFI} argparse Threads::Threads)

Expand Down
2 changes: 1 addition & 1 deletion controller/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ list(REMOVE_ITEM CONTROLLER_SOURCES "${CMAKE_SOURCE_DIR}/controller/MiNiFiContro
set(CONTROLLER_TEST_COUNT 0)
foreach(testfile ${CONTROLLER_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
add_executable(${testfilename} "${testfile}" ${CONTROLLER_SOURCES})
add_minifi_executable(${testfilename} "${testfile}" "${CONTROLLER_SOURCES}")

target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/controller")
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include")
Expand Down
2 changes: 1 addition & 1 deletion encrypt-config/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if (WIN32)
configure_file(${CMAKE_SOURCE_DIR}/versioninfo.rc.in ${CMAKE_CURRENT_BINARY_DIR}/versioninfo.rc @ONLY)
list(APPEND ENCRYPT_CONFIG_FILES "${CMAKE_CURRENT_BINARY_DIR}/versioninfo.rc")
endif()
add_executable(encrypt-config "${ENCRYPT_CONFIG_FILES}")
add_minifi_executable(encrypt-config "${ENCRYPT_CONFIG_FILES}")
target_include_directories(encrypt-config PRIVATE ../libminifi/include)
include(ArgParse)
target_link_libraries(encrypt-config libsodium argparse ${LIBMINIFI})
Expand Down
2 changes: 1 addition & 1 deletion encrypt-config/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ list(REMOVE_ITEM ENCRYPT_CONFIG_SOURCES "${CMAKE_SOURCE_DIR}/encrypt-config/Encr
set(ENCRYPT_CONFIG_TEST_COUNT 0)
foreach(testfile ${ENCRYPT_CONFIG_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
add_executable(${testfilename} "${testfile}" ${ENCRYPT_CONFIG_SOURCES})
add_minifi_executable(${testfilename} "${testfile}" "${ENCRYPT_CONFIG_SOURCES}")

target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/encrypt-config")
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/include")
Expand Down
3 changes: 1 addition & 2 deletions extensions/aws/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ include_directories(controllerservices processors s3 ${CMAKE_SOURCE_DIR}/extensi

file(GLOB SOURCES "*.cpp" "s3/*.cpp" "controllerservices/*.cpp" "processors/*.cpp" "utils/*.cpp")

add_library(minifi-aws SHARED ${SOURCES})

add_minifi_library(minifi-aws SHARED "${SOURCES}")
target_link_libraries(minifi-aws PUBLIC ${LIBMINIFI} Threads::Threads)

target_wholearchive_library_private(minifi-aws AWS::aws-cpp-sdk-s3)
Expand Down
2 changes: 1 addition & 1 deletion extensions/aws/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ file(GLOB AWS_INTEGRATION_TESTS "*.cpp")
SET(AWS_TEST_COUNT 0)
FOREACH(testfile ${AWS_INTEGRATION_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
add_executable("${testfilename}" "${testfile}")
add_minifi_executable("${testfilename}" "${testfile}")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/standard-processors")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/aws")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/aws/s3")
Expand Down
2 changes: 1 addition & 1 deletion extensions/azure/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ include(${CMAKE_SOURCE_DIR}/extensions/ExtensionHeader.txt)

file(GLOB SOURCES "*.cpp" "storage/*.cpp" "controllerservices/*.cpp" "processors/*.cpp" "utils/*.cpp")

add_library(minifi-azure SHARED ${SOURCES})
add_minifi_library(minifi-azure SHARED "${SOURCES}")

target_compile_features(minifi-azure PUBLIC cxx_std_14)

Expand Down
2 changes: 1 addition & 1 deletion extensions/azure/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ file(GLOB AZURE_INTEGRATION_TESTS "*.cpp")
SET(AZURE_TEST_COUNT 0)
FOREACH(testfile ${AZURE_INTEGRATION_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
add_executable("${testfilename}" "${testfile}")
add_minifi_executable("${testfilename}" "${testfile}")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/standard-processors")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/azure")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/azure/storage")
Expand Down
2 changes: 1 addition & 1 deletion extensions/bustache/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ include(${CMAKE_SOURCE_DIR}/extensions/ExtensionHeader.txt)

file(GLOB SOURCES "*.cpp")

add_library(minifi-bustache-extensions SHARED ${SOURCES})
add_minifi_library(minifi-bustache-extensions SHARED "${SOURCES}")

target_link_libraries(minifi-bustache-extensions ${LIBMINIFI})
target_link_libraries(minifi-bustache-extensions bustache)
Expand Down
2 changes: 1 addition & 1 deletion extensions/bustache/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ file(GLOB BUSTACHE_INTEGRATION_TESTS "*.cpp")
SET(BUSTACHE-EXTENSIONS_TEST_COUNT 0)
FOREACH(testfile ${BUSTACHE_INTEGRATION_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
add_executable("${testfilename}" "${testfile}")
add_minifi_executable("${testfilename}" "${testfile}")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/bustache")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/standard-processors")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/libminifi/test/")
Expand Down
2 changes: 1 addition & 1 deletion extensions/civetweb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ include(${CMAKE_SOURCE_DIR}/extensions/ExtensionHeader.txt)

file(GLOB SOURCES "processors/*.cpp" "protocols/*.cpp")

add_library(minifi-civet-extensions SHARED ${SOURCES})
add_minifi_library(minifi-civet-extensions SHARED "${SOURCES}")
target_include_directories(minifi-civet-extensions BEFORE PUBLIC
${CMAKE_SOURCE_DIR}/libminifi/include
${CMAKE_SOURCE_DIR}/libminifi/include/core
Expand Down
2 changes: 1 addition & 1 deletion extensions/civetweb/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ if(NOT DISABLE_CURL)
SET(CIVETWEB-EXTENSIONS_TEST_COUNT 0)
FOREACH(testfile ${CIVETWEB_INTEGRATION_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
add_executable("${testfilename}" "${testfile}")
add_minifi_executable("${testfilename}" "${testfile}")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/libminifi/test/")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/civetweb")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/standard-processors")
Expand Down
4 changes: 2 additions & 2 deletions extensions/coap/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@ include_directories(../http-curl/)
file(GLOB CSOURCES "nanofi/*.c")
file(GLOB SOURCES "*.cpp" "protocols/*.cpp" "processors/*.cpp" "controllerservice/*.cpp" "server/*.cpp" )

add_library(nanofi-coap-c STATIC ${CSOURCES})
add_library(minifi-coap SHARED ${SOURCES})
add_minifi_library(nanofi-coap-c STATIC "${CSOURCES}")
add_minifi_library(minifi-coap SHARED "${SOURCES}")
fgerlits marked this conversation as resolved.
Show resolved Hide resolved

target_link_libraries(nanofi-coap-c COAP::libcoap Threads::Threads)
target_link_libraries(minifi-coap ${LIBMINIFI})
Expand Down
2 changes: 1 addition & 1 deletion extensions/coap/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ SET(CURL_INT_TEST_COUNT 0)
if (NOT DISABLE_CURL)
FOREACH(testfile ${COAP_INTEGRATION_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
add_executable("${testfilename}" "${testfile}")
add_minifi_executable("${testfilename}" "${testfile}")
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/extensions/standard-processors")
target_include_directories(${testfilename} BEFORE PRIVATE "${CMAKE_SOURCE_DIR}/libminifi/test/")
target_include_directories(${testfilename} BEFORE PRIVATE "../")
Expand Down
2 changes: 1 addition & 1 deletion extensions/elasticsearch/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ include(${CMAKE_SOURCE_DIR}/extensions/ExtensionHeader.txt)

file(GLOB SOURCES "*.cpp")

add_library(minifi-elasticsearch SHARED ${SOURCES})
add_minifi_library(minifi-elasticsearch SHARED "${SOURCES}")

target_include_directories(minifi-elasticsearch PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/http-curl")
target_link_libraries(minifi-elasticsearch ${LIBMINIFI})
Expand Down
2 changes: 1 addition & 1 deletion extensions/elasticsearch/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ file(GLOB ELASTICSEARCH_TESTS "*.cpp")
SET(ELASTICSEARCH_TEST_COUNT 0)
FOREACH(testfile ${ELASTICSEARCH_TESTS})
get_filename_component(testfilename "${testfile}" NAME_WE)
add_executable("${testfilename}" "${testfile}")
add_minifi_executable("${testfilename}" "${testfile}")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/standard-processors")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/extensions/elasticsearch")
target_include_directories(${testfilename} PRIVATE BEFORE "${CMAKE_SOURCE_DIR}/libminifi/test/")
Expand Down
2 changes: 1 addition & 1 deletion extensions/expression-language/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ if (NOT WIN32)
set_source_files_properties(${FLEX_el-scanner_OUTPUTS} PROPERTIES COMPILE_FLAGS -Wno-error)
endif()

add_library(minifi-expression-language-extensions SHARED ${SOURCES} ${BISON_el-parser_OUTPUTS} ${FLEX_el-scanner_OUTPUTS})
add_minifi_library(minifi-expression-language-extensions SHARED "${SOURCES}" "${BISON_el-parser_OUTPUTS}" "${FLEX_el-scanner_OUTPUTS}")

target_link_libraries(minifi-expression-language-extensions ${LIBMINIFI})
target_link_libraries(minifi-expression-language-extensions RapidJSON CURL::libcurl)
Expand Down