You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nifi.apache.org by al...@apache.org on 2019/04/02 16:40:14 UTC
[nifi-minifi-cpp] branch master updated: MINIFICPP-790: Enable EL
support for windows
This is an automated email from the ASF dual-hosted git repository.
aldrin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nifi-minifi-cpp.git
The following commit(s) were added to refs/heads/master by this push:
new 01dd04e MINIFICPP-790: Enable EL support for windows
01dd04e is described below
commit 01dd04e1b0488dd1aa6700e8065b14a931505c17
Author: Marc Parisi <ph...@apache.org>
AuthorDate: Mon Mar 25 17:07:05 2019 -0400
MINIFICPP-790: Enable EL support for windows
This closes #526.
Signed-off-by: Aldrin Piri <al...@apache.org>
---
CMakeLists.txt | 2 +-
CMakeSettings.json | 8 -
LICENSE | 44 +++++
appveyor.yml | 2 +-
cmake/winflexbison/FindBISON.cmake | 240 +++++++++++++++++++++++++
cmake/winflexbison/FindFLEX.cmake | 244 ++++++++++++++++++++++++++
extensions/expression-language/CMakeLists.txt | 73 +++++++-
extensions/expression-language/Expression.cpp | 12 ++
8 files changed, 610 insertions(+), 15 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8e49102..23ec72a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -56,6 +56,7 @@ cmake_dependent_option(USE_SYSTEM_ZLIB "Instructs the build system to search for
option(USE_SYSTEM_BZIP2 "Instructs the build system to search for and use a bzip2 library available in the host system" ON)
option(BUILD_ROCKSDB "Instructs the build system to use RocksDB from the third party directory" ON)
option(FORCE_WINDOWS "Instructs the build system to force Windows builds when WIN32 is specified" OFF)
+option(DISABLE_CURL "Disables libCurl Properties." OFF)
if (OPENSSL_ROOT_DIR )
set(OPENSSL_PASSTHROUGH "-DOPENSSL_ROOT_DIR=${OPENSSL_ROOT_DIR}")
@@ -465,7 +466,6 @@ if (WIN32 OR NOT USE_SYSTEM_ZLIB)
endif(WIN32 OR NOT USE_SYSTEM_ZLIB)
#### EXTENSIONS
-option(DISABLE_CURL "Disables libCurl Properties." OFF)
if ((DISABLE_CURL STREQUAL "OFF" OR NOT DISABLE_CURL) AND NOT DISABLE_CIVET)
createExtension(HTTP-CURL "HTTP CURL" "This enables RESTProtocol, InvokeHTTP, and the HTTPClient for Site to Site" "extensions/http-curl" "extensions/http-curl/tests/")
if(NOT USE_SYSTEM_CURL)
diff --git a/CMakeSettings.json b/CMakeSettings.json
index ea5ce2b..a0c51b2 100644
--- a/CMakeSettings.json
+++ b/CMakeSettings.json
@@ -76,10 +76,6 @@
"value": "TRUE"
},
{
- "name": "DISABLE_EXPRESSION_LANGUAGE",
- "value": "TRUE"
- },
- {
"name": "SKIP_TESTS",
"value": "TRUE"
}
@@ -173,10 +169,6 @@
"value": "TRUE"
},
{
- "name": "DISABLE_EXPRESSION_LANGUAGE",
- "value": "TRUE"
- },
- {
"name": "SKIP_TESTS",
"value": "TRUE"
}
diff --git a/LICENSE b/LICENSE
index 78e086e..8f2a2cd 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1661,3 +1661,47 @@ OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
+This project bundles `FindFLEX.cmake` and` FindBISON.cmake` from Kitware, Inc.
+These files are available under a 3-Clause BSD license:
+=============================================================================
+ Copyright 2009 Kitware, Inc.
+ Copyright 2006 Tristan Carel
+ Modified 2010 by Jon Siwek, adding HEADER option
+
+ Distributed under the OSI-approved BSD License (the "License"):
+ CMake - Cross Platform Makefile Generator
+ Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions
+ are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ * Neither the names of Kitware, Inc., the Insight Software Consortium,
+ nor the names of their contributors may be used to endorse or promote
+ products derived from this software without specific prior written
+ permission.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ This software is distributed WITHOUT ANY WARRANTY; without even the
+ implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the License for more information.
+=============================================================================
\ No newline at end of file
diff --git a/appveyor.yml b/appveyor.yml
index 57fbf15..03b59e1 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -22,6 +22,6 @@ build_script:
- cd C:\projects\nifi-minifi-cpp
- mkdir build & exit 0
- cd build
- - cmake -g"Ninja" -DWIN32=WIN32 -DOPENSSL_OFF=ON -DUSE_SYSTEM_ZLIB=OFF -DFORCE_WINDOWS=ON -DUSE_SYSTEM_CURL=OFF -DUSE_SYSTEM_UUID=OFF -DDISABLE_ROCKSDB=ON -DDISABLE_CURL=ON -DDISABLE_LIBARCHIVE=ON -DDISABLE_SCRIPTING=ON -DEXCLUDE_BOOST=ON -DDISABLE_EXPRESSION_LANGUAGE=ON -DENABLE_WEL=TRUE -DSKIP_TESTS=ON ..
+ - cmake -g"Ninja" -DWIN32=WIN32 -DOPENSSL_OFF=ON -DUSE_SYSTEM_ZLIB=OFF -DFORCE_WINDOWS=ON -DUSE_SYSTEM_UUID=OFF -DDISABLE_ROCKSDB=ON -DDISABLE_CURL=ON -DDISABLE_LIBARCHIVE=ON -DDISABLE_SCRIPTING=ON -DEXCLUDE_BOOST=ON -DENABLE_WEL=TRUE -DSKIP_TESTS=ON ..
- set msbuild_platform=x64
- msbuild nifi-minifi-cpp.sln
diff --git a/cmake/winflexbison/FindBISON.cmake b/cmake/winflexbison/FindBISON.cmake
new file mode 100644
index 0000000..c0de565
--- /dev/null
+++ b/cmake/winflexbison/FindBISON.cmake
@@ -0,0 +1,240 @@
+# 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.
+
+#.rst:
+# FindBISON
+# ---------
+#
+# Find bison executable and provides macros to generate custom build rules
+#
+# The module defines the following variables:
+#
+# ::
+#
+# BISON_EXECUTABLE - path to the bison program
+# BISON_VERSION - version of bison
+# BISON_FOUND - true if the program was found
+#
+#
+#
+# The minimum required version of bison can be specified using the
+# standard CMake syntax, e.g. find_package(BISON 2.1.3)
+#
+# If bison is found, the module defines the macros:
+#
+# ::
+#
+# BISON_TARGET(<Name> <YaccInput> <CodeOutput> [VERBOSE <file>]
+# [COMPILE_FLAGS <string>])
+#
+# which will create a custom rule to generate a parser. <YaccInput> is
+# the path to a yacc file. <CodeOutput> is the name of the source file
+# generated by bison. A header file is also be generated, and contains
+# the token list. If COMPILE_FLAGS option is specified, the next
+# parameter is added in the bison command line. if VERBOSE option is
+# specified, <file> is created and contains verbose descriptions of the
+# grammar and parser. The macro defines a set of variables:
+#
+# ::
+#
+# BISON_${Name}_DEFINED - true is the macro ran successfully
+# BISON_${Name}_INPUT - The input source file, an alias for <YaccInput>
+# BISON_${Name}_OUTPUT_SOURCE - The source file generated by bison
+# BISON_${Name}_OUTPUT_HEADER - The header file generated by bison
+# BISON_${Name}_OUTPUTS - The sources files generated by bison
+# BISON_${Name}_COMPILE_FLAGS - Options used in the bison command line
+#
+#
+#
+# ::
+#
+# ====================================================================
+# Example:
+#
+#
+#
+# ::
+#
+# find_package(BISON)
+# BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
+# add_executable(Foo main.cpp ${BISON_MyParser_OUTPUTS})
+# ====================================================================
+
+
+#=============================================================================
+# Copyright 2009 Kitware, Inc.
+# Copyright 2006 Tristan Carel
+# Modified 2010 by Jon Siwek, adding HEADER option
+#
+# Distributed under the OSI-approved BSD License (the "License"):
+# CMake - Cross Platform Makefile Generator
+# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+# All rights reserved.
+
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# * Neither the names of Kitware, Inc., the Insight Software Consortium,
+# nor the names of their contributors may be used to endorse or promote
+# products derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+
+if(BISON_EXECUTABLE)
+ # the bison commands should be executed with the C locale, otherwise
+ # the message (which are parsed) may be translated
+ set(_Bison_SAVED_LC_ALL "$ENV{LC_ALL}")
+ set(ENV{LC_ALL} C)
+
+ execute_process(COMMAND ${BISON_EXECUTABLE} --version
+ OUTPUT_VARIABLE BISON_version_output
+ ERROR_VARIABLE BISON_version_error
+ RESULT_VARIABLE BISON_version_result
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+
+ set(ENV{LC_ALL} ${_Bison_SAVED_LC_ALL})
+
+ if(NOT ${BISON_version_result} EQUAL 0)
+ message(SEND_ERROR "Command \"${BISON_EXECUTABLE} --version\" failed with output:\n${BISON_version_error}")
+ else()
+ # Bison++
+ if("${BISON_version_output}" MATCHES "^bison\\+\\+ Version ([^,]+)")
+ set(BISON_VERSION "${CMAKE_MATCH_1}")
+ # GNU Bison
+ elseif("${BISON_version_output}" MATCHES "^bison \\(GNU Bison\\) ([^\n]+)\n")
+ set(BISON_VERSION "${CMAKE_MATCH_1}")
+ elseif("${BISON_version_output}" MATCHES "^GNU Bison (version )?([^\n]+)")
+ set(BISON_VERSION "${CMAKE_MATCH_2}")
+ endif()
+ endif()
+
+ # internal macro
+ macro(BISON_TARGET_option_verbose Name BisonOutput filename)
+ list(APPEND BISON_TARGET_cmdopt "--verbose")
+ get_filename_component(BISON_TARGET_output_path "${BisonOutput}" PATH)
+ get_filename_component(BISON_TARGET_output_name "${BisonOutput}" NAME_WE)
+ add_custom_command(OUTPUT ${filename}
+ COMMAND ${CMAKE_COMMAND}
+ ARGS -E copy
+ "${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output"
+ "${filename}"
+ DEPENDS
+ "${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output"
+ COMMENT "[BISON][${Name}] Copying bison verbose table to ${filename}"
+ WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})
+ set(BISON_${Name}_VERBOSE_FILE ${filename})
+ list(APPEND BISON_TARGET_extraoutputs
+ "${BISON_TARGET_output_path}/${BISON_TARGET_output_name}.output")
+ endmacro()
+
+ # internal macro
+ macro(BISON_TARGET_option_extraopts Options)
+ set(BISON_TARGET_extraopts "${Options}")
+ separate_arguments(BISON_TARGET_extraopts)
+ list(APPEND BISON_TARGET_cmdopt ${BISON_TARGET_extraopts})
+ endmacro()
+
+ #============================================================
+ # BISON_TARGET (public macro)
+ #============================================================
+ #
+ macro(BISON_TARGET Name BisonInput BisonOutput)
+ set(BISON_TARGET_output_header "")
+ set(BISON_TARGET_cmdopt "")
+ set(BISON_TARGET_outputs "${BisonOutput}")
+ if(NOT ${ARGC} EQUAL 3 AND NOT ${ARGC} EQUAL 5 AND NOT ${ARGC} EQUAL 7)
+ message(SEND_ERROR "Usage")
+ else()
+ # Parsing parameters
+ if(${ARGC} GREATER 5 OR ${ARGC} EQUAL 5)
+ if("${ARGV3}" STREQUAL "VERBOSE")
+ BISON_TARGET_option_verbose(${Name} ${BisonOutput} "${ARGV4}")
+ endif()
+ if("${ARGV3}" STREQUAL "COMPILE_FLAGS")
+ BISON_TARGET_option_extraopts("${ARGV4}")
+ endif()
+ endif()
+
+ if(${ARGC} EQUAL 7)
+ if("${ARGV5}" STREQUAL "VERBOSE")
+ BISON_TARGET_option_verbose(${Name} ${BisonOutput} "${ARGV6}")
+ endif()
+
+ if("${ARGV5}" STREQUAL "COMPILE_FLAGS")
+ BISON_TARGET_option_extraopts("${ARGV6}")
+ endif()
+ endif()
+
+ # Header's name generated by bison (see option -d)
+ list(APPEND BISON_TARGET_cmdopt "-d")
+ string(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\2" _fileext "${ARGV2}")
+ string(REPLACE "c" "h" _fileext ${_fileext})
+ string(REGEX REPLACE "^(.*)(\\.[^.]*)$" "\\1${_fileext}"
+ BISON_${Name}_OUTPUT_HEADER "${ARGV2}")
+ list(APPEND BISON_TARGET_outputs "${BISON_${Name}_OUTPUT_HEADER}")
+
+ add_custom_command(OUTPUT ${BISON_TARGET_outputs}
+ ${BISON_TARGET_extraoutputs}
+ COMMAND ${BISON_EXECUTABLE}
+ ARGS ${BISON_TARGET_cmdopt} -o ${ARGV2} ${ARGV1}
+ DEPENDS ${ARGV1}
+ COMMENT "[BISON][${Name}] Building parser with bison ${BISON_VERSION}"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+
+ # define target variables
+ set(BISON_${Name}_DEFINED TRUE)
+ set(BISON_${Name}_INPUT ${ARGV1})
+ set(BISON_${Name}_OUTPUTS ${BISON_TARGET_outputs})
+ set(BISON_${Name}_COMPILE_FLAGS ${BISON_TARGET_cmdopt})
+ set(BISON_${Name}_OUTPUT_SOURCE "${BisonOutput}")
+
+ endif()
+ endmacro()
+ #
+ #============================================================
+
+endif()
+
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(BISON REQUIRED_VARS BISON_EXECUTABLE
+ VERSION_VAR BISON_VERSION)
+
+# FindBISON.cmake ends here
\ No newline at end of file
diff --git a/cmake/winflexbison/FindFLEX.cmake b/cmake/winflexbison/FindFLEX.cmake
new file mode 100644
index 0000000..0df8067
--- /dev/null
+++ b/cmake/winflexbison/FindFLEX.cmake
@@ -0,0 +1,244 @@
+# 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.
+#.rst:
+# FindFLEX
+# --------
+#
+# Find flex executable and provides a macro to generate custom build rules
+#
+#
+#
+# The module defines the following variables:
+#
+# ::
+#
+# FLEX_FOUND - true is flex executable is found
+# FLEX_EXECUTABLE - the path to the flex executable
+# FLEX_VERSION - the version of flex
+# FLEX_LIBRARIES - The flex libraries
+# FLEX_INCLUDE_DIRS - The path to the flex headers
+#
+#
+#
+# The minimum required version of flex can be specified using the
+# standard syntax, e.g. find_package(FLEX 2.5.13)
+#
+#
+#
+# If flex is found on the system, the module provides the macro:
+#
+# ::
+#
+# FLEX_TARGET(Name FlexInput FlexOutput [COMPILE_FLAGS <string>])
+#
+# which creates a custom command to generate the <FlexOutput> file from
+# the <FlexInput> file. If COMPILE_FLAGS option is specified, the next
+# parameter is added to the flex command line. Name is an alias used to
+# get details of this custom command. Indeed the macro defines the
+# following variables:
+#
+# ::
+#
+# FLEX_${Name}_DEFINED - true is the macro ran successfully
+# FLEX_${Name}_OUTPUTS - the source file generated by the custom rule, an
+# alias for FlexOutput
+# FLEX_${Name}_INPUT - the flex source file, an alias for ${FlexInput}
+#
+#
+#
+# Flex scanners oftenly use tokens defined by Bison: the code generated
+# by Flex depends of the header generated by Bison. This module also
+# defines a macro:
+#
+# ::
+#
+# ADD_FLEX_BISON_DEPENDENCY(FlexTarget BisonTarget)
+#
+# which adds the required dependency between a scanner and a parser
+# where <FlexTarget> and <BisonTarget> are the first parameters of
+# respectively FLEX_TARGET and BISON_TARGET macros.
+#
+# ::
+#
+# ====================================================================
+# Example:
+#
+#
+#
+# ::
+#
+# find_package(BISON)
+# find_package(FLEX)
+#
+#
+#
+# ::
+#
+# BISON_TARGET(MyParser parser.y ${CMAKE_CURRENT_BINARY_DIR}/parser.cpp)
+# FLEX_TARGET(MyScanner lexer.l ${CMAKE_CURRENT_BINARY_DIR}/lexer.cpp)
+# ADD_FLEX_BISON_DEPENDENCY(MyScanner MyParser)
+#
+#
+#
+# ::
+#
+# include_directories(${CMAKE_CURRENT_BINARY_DIR})
+# add_executable(Foo
+# Foo.cc
+# ${BISON_MyParser_OUTPUTS}
+# ${FLEX_MyScanner_OUTPUTS}
+# )
+# ====================================================================
+
+
+#=============================================================================
+# Copyright 2009 Kitware, Inc.
+# Copyright 2006 Tristan Carel
+# Modified 2010 by Jon Siwek, adding HEADER option
+#
+# Distributed under the OSI-approved BSD License (the "License"):
+# CMake - Cross Platform Makefile Generator
+# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium
+# All rights reserved.
+
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+#
+# * Redistributions of source code must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# * Redistributions in binary form must reproduce the above copyright
+# notice, this list of conditions and the following disclaimer in the
+# documentation and/or other materials provided with the distribution.
+#
+# * Neither the names of Kitware, Inc., the Insight Software Consortium,
+# nor the names of their contributors may be used to endorse or promote
+# products derived from this software without specific prior written
+# permission.
+#
+# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+# HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#
+# This software is distributed WITHOUT ANY WARRANTY; without even the
+# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+# See the License for more information.
+#=============================================================================
+
+find_library(FL_LIBRARY NAMES fl
+ DOC "Path to the fl library")
+
+find_path(FLEX_INCLUDE_DIR FlexLexer.h
+ DOC "Path to the flex headers")
+
+mark_as_advanced(FL_LIBRARY FLEX_INCLUDE_DIR)
+
+set(FLEX_INCLUDE_DIRS ${FLEX_INCLUDE_DIR})
+set(FLEX_LIBRARIES ${FL_LIBRARY})
+
+if(FLEX_EXECUTABLE)
+
+ execute_process(COMMAND ${FLEX_EXECUTABLE} --version
+ OUTPUT_VARIABLE FLEX_version_output
+ ERROR_VARIABLE FLEX_version_error
+ RESULT_VARIABLE FLEX_version_result
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if(NOT ${FLEX_version_result} EQUAL 0)
+ if(FLEX_FIND_REQUIRED)
+ message(SEND_ERROR "Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_output}\n${FLEX_version_error}")
+ else()
+ message("Command \"${FLEX_EXECUTABLE} --version\" failed with output:\n${FLEX_version_output}\n${FLEX_version_error}\nFLEX_VERSION will not be available")
+ endif()
+ else()
+ # older versions of flex printed "/full/path/to/executable version X.Y"
+ # newer versions use "basename(executable) X.Y"
+ get_filename_component(FLEX_EXE_NAME_WE "${FLEX_EXECUTABLE}" NAME_WE)
+ get_filename_component(FLEX_EXE_EXT "${FLEX_EXECUTABLE}" EXT)
+ string(REGEX REPLACE "^.*${FLEX_EXE_NAME_WE}(${FLEX_EXE_EXT})?\"? (version )?([0-9]+[^ ]*)( .*)?$" "\\3"
+ FLEX_VERSION "${FLEX_version_output}")
+ unset(FLEX_EXE_EXT)
+ unset(FLEX_EXE_NAME_WE)
+ endif()
+
+ #============================================================
+ # FLEX_TARGET (public macro)
+ #============================================================
+ #
+ macro(FLEX_TARGET Name Input Output)
+ set(FLEX_TARGET_usage "FLEX_TARGET(<Name> <Input> <Output> [COMPILE_FLAGS <string>]")
+ if(${ARGC} GREATER 3)
+ if(${ARGC} EQUAL 5)
+ if("${ARGV3}" STREQUAL "COMPILE_FLAGS")
+ set(FLEX_EXECUTABLE_opts "${ARGV4}")
+ separate_arguments(FLEX_EXECUTABLE_opts)
+ else()
+ message(SEND_ERROR ${FLEX_TARGET_usage})
+ endif()
+ else()
+ message(SEND_ERROR ${FLEX_TARGET_usage})
+ endif()
+ endif()
+
+ add_custom_command(OUTPUT ${Output}
+ COMMAND ${FLEX_EXECUTABLE}
+ ARGS ${FLEX_EXECUTABLE_opts} --wincompat -o${Output} ${Input}
+ DEPENDS ${Input}
+ COMMENT "[FLEX][${Name}] Building scanner with flex ${FLEX_VERSION}"
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR})
+
+ set(FLEX_${Name}_DEFINED TRUE)
+ set(FLEX_${Name}_OUTPUTS ${Output})
+ set(FLEX_${Name}_INPUT ${Input})
+ set(FLEX_${Name}_COMPILE_FLAGS ${FLEX_EXECUTABLE_opts})
+ endmacro()
+ #============================================================
+
+
+ #============================================================
+ # ADD_FLEX_BISON_DEPENDENCY (public macro)
+ #============================================================
+ #
+ macro(ADD_FLEX_BISON_DEPENDENCY FlexTarget BisonTarget)
+
+ if(NOT FLEX_${FlexTarget}_OUTPUTS)
+ message(SEND_ERROR "Flex target `${FlexTarget}' does not exists.")
+ endif()
+
+ if(NOT BISON_${BisonTarget}_OUTPUT_HEADER)
+ message(SEND_ERROR "Bison target `${BisonTarget}' does not exists.")
+ endif()
+
+ set_source_files_properties(${FLEX_${FlexTarget}_OUTPUTS}
+ PROPERTIES OBJECT_DEPENDS ${BISON_${BisonTarget}_OUTPUT_HEADER})
+ endmacro()
+ #============================================================
+
+endif()
+
+FIND_PACKAGE_HANDLE_STANDARD_ARGS(FLEX REQUIRED_VARS FLEX_EXECUTABLE
+ VERSION_VAR FLEX_VERSION)
+
+# FindFLEX.cmake ends here
\ No newline at end of file
diff --git a/extensions/expression-language/CMakeLists.txt b/extensions/expression-language/CMakeLists.txt
index 483c807..6b946a3 100644
--- a/extensions/expression-language/CMakeLists.txt
+++ b/extensions/expression-language/CMakeLists.txt
@@ -16,6 +16,68 @@
# specific language governing permissions and limitations
# under the License.
#
+if(WIN32)
+
+ include(FetchContent)
+
+ set(BASE_DIR "${CMAKE_CURRENT_BINARY_DIR}")
+
+ FetchContent_Declare(
+ winflexbison
+ GIT_REPOSITORY "https://github.com/lexxmark/winflexbison.git"
+ GIT_TAG "a72f3d6b5102b65f064a5054ba634d3d62e94f41"
+ )
+ FetchContent_GetProperties("winflexbison")
+
+ if(NOT winflexbison_POPULATED)
+ FetchContent_Populate("winflexbison")
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} .
+ WORKING_DIRECTORY ${winflexbison_SOURCE_DIR}
+ RESULT_VARIABLE result
+ OUTPUT_VARIABLE bisonbuild
+ ERROR_VARIABLE bisonbuildE
+ )
+
+ execute_process(
+ COMMAND ${CMAKE_COMMAND} --build . --config RelWithDebInfo
+ WORKING_DIRECTORY ${winflexbison_SOURCE_DIR}
+ RESULT_VARIABLE result
+ OUTPUT_VARIABLE bisonbuild
+ ERROR_VARIABLE bisonbuildE
+ )
+
+ file(COPY ${winflexbison_SOURCE_DIR}/bison/Data DESTINATION ${winflexbison_SOURCE_DIR}/bison/RelWithDebInfo/)
+
+ endif()
+
+ set(BISON_EXECUTABLE "${winflexbison_SOURCE_DIR}/bison/RelWithDebInfo/win_bison.exe" CACHE PATH "bison executable")
+
+ set(FLEX_EXECUTABLE "${winflexbison_SOURCE_DIR}/flex/RelWithDebInfo/win_flex.exe" CACHE PATH "flex executable")
+
+ include_directories(${winflexbison_SOURCE_DIR}/flex/src/)
+
+ list(APPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/winflexbison")
+
+ find_package(BISON REQUIRED)
+ find_package(FLEX REQUIRED)
+
+ bison_target(
+ el-parser
+ ${CMAKE_CURRENT_SOURCE_DIR}/Parser.yy
+ ${CMAKE_CURRENT_SOURCE_DIR}/Parser.cpp
+ )
+
+ flex_target(
+ el-scanner
+ ${CMAKE_CURRENT_SOURCE_DIR}/Scanner.ll
+ ${CMAKE_CURRENT_SOURCE_DIR}/Scanner.cpp
+ )
+
+ add_flex_bison_dependency(el-scanner el-parser)
+
+else()
+
find_package(BISON REQUIRED)
find_package(FLEX REQUIRED)
@@ -33,7 +95,7 @@ flex_target(
)
add_flex_bison_dependency(el-scanner el-parser)
-
+endif()
include_directories(../../libminifi/include ../../libminifi/include/core ../../thirdparty/spdlog-20170710/include ../../thirdparty/concurrentqueue ../../thirdparty/yaml-cpp-yaml-cpp-0.5.3/include ${CIVET_THIRDPARTY_ROOT}/include ../../thirdparty/)
include_directories(common)
include_directories(impl)
@@ -56,10 +118,11 @@ target_link_libraries(minifi-expression-language-extensions ${LIBMINIFI} tz)
target_link_libraries(minifi-expression-language-extensions ${LIBMINIFI} ${UUID_LIBRARIES})
if (NOT DISABLE_CURL)
-
-find_package(CURL REQUIRED)
-include_directories(${CURL_INCLUDE_DIRS})
-target_link_libraries(minifi-expression-language-extensions ${CURL_LIBRARIES})
+ if (NOT CURL_FOUND)
+ find_package(CURL REQUIRED)
+ endif(NOT CURL_FOUND)
+ include_directories(${CURL_INCLUDE_DIRS})
+ target_link_libraries(minifi-expression-language-extensions ${CURL_LIBRARIES})
endif()
find_package(OpenSSL REQUIRED)
include_directories(${OPENSSL_INCLUDE_DIR})
diff --git a/extensions/expression-language/Expression.cpp b/extensions/expression-language/Expression.cpp
index 2b60c4c..1ccb124 100644
--- a/extensions/expression-language/Expression.cpp
+++ b/extensions/expression-language/Expression.cpp
@@ -31,8 +31,20 @@
#ifndef DISABLE_CURL
#include <curl/curl.h>
#endif
+
+
+#ifdef WIN32
+#ifndef WIN32_LEAN_AND_MEAN
+#define WIN32_LEAN_AND_MEAN
+#endif
+#include <Windows.h>
+#include <WS2tcpip.h>
+#pragma comment(lib, "Ws2_32.lib")
+#else
#include <netdb.h>
#include <arpa/inet.h>
+#endif
+
#include "base64.h"
#include "Driver.h"