Selaa lähdekoodia

Merge pull request #15741 from GordonSmith/HPCC-27138-SyncVCPKG

HPCC-27138 Sync Ubuntu / OSX / Windows vcpkg usage

Reviewed-By: Gavin Halliday <gavin.halliday@lexisnexis.com>
Reviewed-By: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman 3 vuotta sitten
vanhempi
commit
192d20d616

+ 11 - 13
.github/workflows/build-vcpkg.yml

@@ -33,7 +33,7 @@ jobs:
   build:
     strategy:
       matrix:
-        os: ["ubuntu-20.04", "windows-2019", "macos-10.15"]
+        os: ["ubuntu-20.04", "windows-2019", "macos-11"]
         include:
           - os: "ubuntu-20.04"
             triplet: "x64-linux"
@@ -47,7 +47,7 @@ jobs:
             sudo: ""
             cmake_config_options: '-G "Visual Studio 16 2019" -T host=x64 -A x64'
             cmake_build_options: "--config Debug -- -m"
-          - os: "macos-10.15"
+          - os: "macos-11"
             triplet: "x64-osx"
             mono: "mono"
             sudo: "sudo"
@@ -82,17 +82,10 @@ jobs:
           sudo apt-get install -y nodejs
 
       - name: OSX Dependencies
-        if: ${{ matrix.os == 'macos-10.15' }}
+        if: ${{ matrix.os == 'macos-11' }}
         shell: "bash"
         run: |
-          brew install bison flex
-          export CMAKE_INCLUDE_PATH="/usr/local/opt/flex/include"
-          export CMAKE_LIBRARY_PATH="/usr/local/opt/flex/lib;/usr/local/opt/bison/lib"
-          export PATH="/usr/local/opt/flex/bin:/usr/local/opt/bison/bin:$PATH"
-
-          brew install pkg-config automake libtool cppunit boost mysql-client openldap
-          brew tap AdoptOpenJDK/openjdk
-          brew install --cask adoptopenjdk13
+          brew install bison flex pkg-config automake libtool cmake
 
       - name: "Remove builtin vcpkg"
         working-directory: .
@@ -105,7 +98,7 @@ jobs:
         with:
           submodules: recursive
 
-      - name: "Bootstrap vcpkg"
+      - name: "vcpkg Bootstrap"
         working-directory: .
         shell: "bash"
         run: |
@@ -126,11 +119,16 @@ jobs:
             setapikey "${{ secrets.GITHUB_TOKEN }}" \
             -source "https://nuget.pkg.github.com/hpcc-systems/index.json"
 
-      - name: "Build HPCC-Platform"
+      - name: "Generate HPCC-Platform Build Files"
         working-directory: .
         shell: "bash"
         run: |
           mkdir build
           cd build
           cmake .. -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake ${{ matrix.cmake_config_options }}
+
+      - name: "Build HPCC-Platform"
+        working-directory: ./build
+        shell: "bash"
+        run: |
           cmake --build . ${{ matrix.cmake_build_options }}

+ 0 - 94
cmake_modules/FindICU.cmake

@@ -1,94 +0,0 @@
-################################################################################
-#    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
-#
-#    Licensed 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.
-################################################################################
-
-
-# - Try to find the ICU unicode library
-# Once done this will define
-#
-#  ICU_FOUND - system has the ICU library
-#  ICU_INCLUDE_DIR - the ICU include directory
-#  ICU_LIBRARIES - The libraries needed to use ICU
-#  ICU_VERSION - Version of unicode library
-
-IF (NOT ICU_FOUND)
-  IF (NOT "${EXTERNALS_DIRECTORY}" STREQUAL "")
-    IF (UNIX)
-      IF (${ARCH64BIT} EQUAL 1)
-        SET (libdir "lib/linux64_gcc4.1.1")
-      ELSE()
-        SET (libdir "lib/linux32_gcc4.1.1")
-      ENDIF()
-    ELSEIF(WIN32)
-      IF (${ARCH64BIT} EQUAL 1)
-        SET (libdir "lib64")
-      ELSE()
-        SET (libdir "lib")
-      ENDIF()
-    ELSE()
-      SET (libdir "unknown")
-    ENDIF()
-    IF (NOT ("${libdir}" STREQUAL "unknown"))
-      FIND_PATH (ICU_INCLUDE_DIR NAMES unicode/uchar.h PATHS "${EXTERNALS_DIRECTORY}/icu/include" NO_DEFAULT_PATH)
-      FIND_LIBRARY (ICU_LIBRARIES NAMES icuuc PATHS "${EXTERNALS_DIRECTORY}/icu/${libdir}" NO_DEFAULT_PATH)
-    ENDIF()
-  ENDIF()
-
-  if (USE_NATIVE_LIBRARIES)
-    # if we didn't find in externals, look in system include path
-    FIND_PATH (ICU_INCLUDE_DIR PATHS /usr/local/opt/icu4c/include NAMES unicode/uchar.h)
-    FIND_LIBRARY (ICU_LIBRARIES PATHS /usr/local/opt/icu4c/lib NAMES icuuc)
-  endif()
-
-  if(EXISTS ${ICU_INCLUDE_DIR}/unicode/uchar.h)
-    file(STRINGS ${ICU_INCLUDE_DIR}/unicode/uchar.h __ICU_VERSION REGEX
-        "^#define U_UNICODE_VERSION*")
-    string(REPLACE "#define U_UNICODE_VERSION" "" __ICU_VERSION
-        ${__ICU_VERSION})
-    string(REPLACE "\"" "" __ICU_VERSION ${__ICU_VERSION})
-    string(STRIP "${__ICU_VERSION}" __ICU_VERSION)
-    set(ICU_VERSION "${__ICU_VERSION}" CACHE STRING "unicode library version")
-  endif()
-
-  if(EXISTS ${ICU_INCLUDE_DIR}/unicode/uvernum.h)
-    file(STRINGS ${ICU_INCLUDE_DIR}/unicode/uvernum.h __ICU_MAJOR_VERSION REGEX
-        "^#define U_ICU_VERSION_MAJOR_NUM*")
-    string(REPLACE "#define U_ICU_VERSION_MAJOR_NUM" "" __ICU_MAJOR_VERSION
-        ${__ICU_MAJOR_VERSION})
-    string(REPLACE "\"" "" __ICU_MAJOR_VERSION ${__ICU_MAJOR_VERSION})
-    string(STRIP "${__ICU_MAJOR_VERSION}" __ICU_MAJOR_VERSION)
-    set(ICU_MAJOR_VERSION "${__ICU_MAJOR_VERSION}" CACHE STRING "icu library version")
-  endif()
-
-  include(FindPackageHandleStandardArgs)
-  find_package_handle_standard_args(ICU DEFAULT_MSG
-    ICU_LIBRARIES 
-    ICU_INCLUDE_DIR
-  )
-  message(STATUS "  version: ${ICU_MAJOR_VERSION} unicode: ${ICU_VERSION}")
-  IF (ICU_FOUND)
-    IF (UNIX)
-      STRING(REPLACE "icuuc" "icui18n" ICU_EXTRA1 "${ICU_LIBRARIES}")
-      STRING(REPLACE "icuuc" "icudata" ICU_EXTRA2 "${ICU_LIBRARIES}")
-    ELSE()
-      STRING(REPLACE "icuuc" "icuin" ICU_EXTRA1 "${ICU_LIBRARIES}")
-    ENDIF()
-    # The order is important for lib2 processing:
-    # depender, such as icuil8n, should be placed before the dependee
-    set (ICU_LIBRARIES ${ICU_EXTRA1} ${ICU_LIBRARIES} ${ICU_EXTRA2} )
-  ENDIF()
-
-  MARK_AS_ADVANCED(ICU_INCLUDE_DIR ICU_LIBRARIES ICU_MAJOR_VERSION ICU_VERSION)
-ENDIF()

+ 0 - 70
cmake_modules/FindLIBXML2.cmake

@@ -1,70 +0,0 @@
-################################################################################
-#    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
-#
-#    Licensed 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.
-################################################################################
-
-
-# - Try to find the libxml2 xml library
-# Once done this will define
-#
-#  LIBXML2_FOUND - system has the libxml2 library
-#  LIBXML2_INCLUDE_DIR - the libxml2 include directory
-#  LIBXML2_LIBRARIES - The libraries needed to use libxml2
-
-if (NOT LIBXML2_FOUND)
-  IF (WIN32)
-    SET (libxml2_libs "libxml2-2")
-  ELSE()
-    SET (libxml2_libs "xml2 libxml2")
-  ENDIF()
-
-  IF (NOT "${EXTERNALS_DIRECTORY}" STREQUAL "")
-    IF (UNIX)
-      IF (${ARCH64BIT} EQUAL 1)
-        SET (osdir "linux64_gcc4.1.1")
-      ELSE()
-        SET (osdir "linux32_gcc4.1.1")
-      ENDIF()
-    ELSEIF(WIN32)
-      SET (osdir "lib")
-    ELSE()
-      SET (osdir "unknown")
-    ENDIF()
-    IF (NOT ("${osdir}" STREQUAL "unknown"))
-      FIND_PATH (LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h PATHS "${EXTERNALS_DIRECTORY}/libxml2/include/" NO_DEFAULT_PATH)
-      FIND_LIBRARY (LIBXML2_LIBRARIES NAMES ${libxml2_libs} PATHS "${EXTERNALS_DIRECTORY}/libxml2/${osdir}" NO_DEFAULT_PATH)
-    ENDIF() 
-  ENDIF()
-
-  if (USE_NATIVE_LIBRARIES)
-    # if we didn't find in externals, look in system include path
-    FIND_PATH (LIBXML2_INCLUDE_DIR NAMES libxml/xpath.h PATH_SUFFIXES libxml2)
-    FIND_LIBRARY (LIBXML2_LIBRARIES NAMES xml2 libxml2)
-  endif()
-
-  include(FindPackageHandleStandardArgs)
-  find_package_handle_standard_args(Libxml2 DEFAULT_MSG
-    LIBXML2_LIBRARIES 
-    LIBXML2_INCLUDE_DIR
-  )
-
-  IF (LIBXML2_FOUND AND APPLE)
-     STRING(REPLACE "libxml2" "liblzma"  LIBXML2_EXTRA "${LIBXML2_LIBRARIES}")
-     STRING(REPLACE "libxml2" "libiconv" LIBXML2_EXTRA2 "${LIBXML2_LIBRARIES}")
-     set (LIBXML2_LIBRARIES ${LIBXML2_LIBRARIES} "${LIBXML2_EXTRA}" "${LIBXML2_EXTRA2}" )
-  ENDIF()
-
-  MARK_AS_ADVANCED(LIBXML2_INCLUDE_DIR LIBXML2_LIBRARIES)
-ENDIF()
-

+ 0 - 71
cmake_modules/FindLIBXSLT.cmake

@@ -1,71 +0,0 @@
-################################################################################
-#    HPCC SYSTEMS software Copyright (C) 2012 HPCC Systems®.
-#
-#    Licensed 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.
-################################################################################
-
-
-# - Try to find the LIBXSLT xml library
-# Once done this will define
-#
-#  LIBXSLT_FOUND - system has the LIBXSLT library
-#  LIBXSLT_INCLUDE_DIR - the LIBXSLT include directory
-#  LIBXSLT_LIBRARIES - The libraries needed to use LIBXSLT
-
-if (NOT LIBXSLT_FOUND)
-  IF (WIN32)
-    SET (libxslt_libs "libxslt-1")
-    SET (libexslt_libs "libexslt")
-  ELSE()
-    SET (libxslt_libs "xslt libxslt")
-    SET (libexslt_libs "exslt libexslt")
-  ENDIF()
-
-  IF (NOT "${EXTERNALS_DIRECTORY}" STREQUAL "")
-    IF (UNIX)
-      IF (${ARCH64BIT} EQUAL 1)
-        SET (osdir "linux64_gcc4.1.1")
-      ELSE()
-        SET (osdir "linux32_gcc4.1.1")
-      ENDIF()
-    ELSEIF(WIN32)
-      SET (osdir "lib")
-    ELSE()
-      SET (osdir "unknown")
-    ENDIF()
-    IF (NOT ("${osdir}" STREQUAL "unknown"))
-      FIND_PATH (LIBXSLT_INCLUDE_DIR NAMES libxslt/xslt.h PATHS "${EXTERNALS_DIRECTORY}/libxslt/include" NO_DEFAULT_PATH)
-      FIND_LIBRARY (LIBXSLT_LIBRARIES NAMES ${libxslt_libs} PATHS "${EXTERNALS_DIRECTORY}/libxslt/${osdir}" NO_DEFAULT_PATH)
-      FIND_PATH (LIBEXSLT_INCLUDE_DIR NAMES libexslt/exslt.h PATHS "${EXTERNALS_DIRECTORY}/libxslt/include" NO_DEFAULT_PATH)
-      FIND_LIBRARY (LIBEXSLT_LIBRARIES NAMES ${libexslt_libs} PATHS "${EXTERNALS_DIRECTORY}/libxslt/${osdir}" NO_DEFAULT_PATH)
-    ENDIF() 
-  ENDIF()
-
-  if (USE_NATIVE_LIBRARIES)
-    # if we didn't find in externals, look in system include path
-    FIND_PATH (LIBXSLT_INCLUDE_DIR NAMES libxslt/xslt.h )
-    FIND_LIBRARY (LIBXSLT_LIBRARIES NAMES xslt libxslt)
-    FIND_PATH (LIBEXSLT_INCLUDE_DIR NAMES libexslt/exslt.h )
-    FIND_LIBRARY (LIBEXSLT_LIBRARIES NAMES exslt libexslt)
-  endif()
-
-  include(FindPackageHandleStandardArgs)
-  find_package_handle_standard_args(Libxslt DEFAULT_MSG
-    LIBXSLT_LIBRARIES 
-    LIBXSLT_INCLUDE_DIR
-    LIBEXSLT_LIBRARIES 
-    LIBEXSLT_INCLUDE_DIR
-  )
-  MARK_AS_ADVANCED(LIBXSLT_INCLUDE_DIR LIBEXSLT_INCLUDE_DIR LIBXSLT_LIBRARIES LIBEXSLT_LIBRARIES)
-ENDIF()
-

+ 14 - 3
cmake_modules/commonSetup.cmake

@@ -126,6 +126,7 @@ IF ("${COMMONSETUP_DONE}" STREQUAL "")
   option(INCLUDE_TREEVIEW "Build legacy treeview" OFF)
   option(INCLUDE_CONFIG_MANAGER "Build config manager" ON)
   option(USE_ELASTICSTACK_CLIENT "Configure use of Elastic Stack client" ON)
+  option(SKIP_ECLWATCH "Skip building ECL Watch" OFF)
 if (WIN32)
   option(USE_JWT "Enable JSON Web Tokens" OFF)
 else ()
@@ -864,7 +865,7 @@ endif ()
       ENDIF(CONTAINERIZED)
 
       IF (USE_ICU)
-        find_package(ICU)
+        find_package(ICU COMPONENTS data i18n io tu uc)
         IF (ICU_FOUND)
           add_definitions (-D_USE_ICU)
           IF (NOT WIN32)
@@ -886,7 +887,7 @@ endif ()
       endif(USE_XALAN)
 
       if(USE_LIBXSLT)
-        find_package(LIBXSLT)
+        find_package(LibXslt)
         if (LIBXSLT_FOUND)
           add_definitions (-D_USE_LIBXSLT)
         else()
@@ -904,7 +905,7 @@ endif ()
       endif(USE_XERCES)
 
       if(USE_LIBXML2)
-        find_package(LIBXML2)
+        find_package(LibXml2)
         if (LIBXML2_FOUND)
           add_definitions (-D_USE_LIBXML2)
         else()
@@ -1079,6 +1080,15 @@ endif ()
         endif()
   ENDMACRO()
 
+  macro(print_all_variables)
+      message(STATUS "print_all_variables------------------------------------------{")
+      get_cmake_property(_variableNames VARIABLES)
+      foreach (_variableName ${_variableNames})
+          message(STATUS "${_variableName}=${${_variableName}}")
+      endforeach()
+      message(STATUS "print_all_variables------------------------------------------}")
+  endmacro()
+
   function(LIST_TO_STRING separator outvar)
     set ( tmp_str "" )
     list (LENGTH ARGN list_length)
@@ -1166,4 +1176,5 @@ endif ()
       add_dependencies(${module_without_extension}-ecl export-stdlib-pubkey)
     endif()
   ENDMACRO()
+
 endif ("${COMMONSETUP_DONE}" STREQUAL "")

+ 2 - 1
cmake_modules/vcpkgSetup.cmake

@@ -28,5 +28,6 @@ set (CMAKE_EXPORT_COMPILE_COMMANDS TRUE)
 # Additional
 option(BUILD_TESTS "Enable libgit2 tests (override libgit2 option)" ON)
 set (BUILD_TESTS OFF)
+set (SKIP_ECLWATCH ON)
 set (USE_JWT OFF)
-
+set (USE_OPTIONAL OFF)

+ 4 - 3
esp/CMakeLists.txt

@@ -18,7 +18,9 @@ HPCC_ADD_SUBDIRECTORY (bindings)
 HPCC_ADD_SUBDIRECTORY (clients "PLATFORM")
 HPCC_ADD_SUBDIRECTORY (eclwatch "PLATFORM")
 HPCC_ADD_SUBDIRECTORY (files "PLATFORM")
-HPCC_ADD_SUBDIRECTORY (src "PLATFORM")
+if (NOT SKIP_ECLWATCH)
+  HPCC_ADD_SUBDIRECTORY (src "PLATFORM")
+endif()
 HPCC_ADD_SUBDIRECTORY (platform "PLATFORM")
 HPCC_ADD_SUBDIRECTORY (protocols)
 HPCC_ADD_SUBDIRECTORY (scm)
@@ -30,6 +32,5 @@ HPCC_ADD_SUBDIRECTORY (xslt)
 HPCC_ADD_SUBDIRECTORY (esdllib)
 HPCC_ADD_SUBDIRECTORY (applications)
 if (LOGGING_SERVICE)
-HPCC_ADD_SUBDIRECTORY (logging)
+  HPCC_ADD_SUBDIRECTORY (logging)
 endif()
-

+ 2 - 2
system/xmllib/CMakeLists.txt

@@ -33,8 +33,8 @@ if ( USE_XALAN )
         xerces_validator.cpp
     )
 elseif (USE_LIBXSLT)
-    set(LIB_INCLUDE_DIR ${LIBXSLT_INCLUDE_DIR} ${LIBEXSLT_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR})
-    set(LIB_LIBRARIES ${LIBXSLT_LIBRARIES} ${LIBEXSLT_LIBRARIES} ${LIBXML2_LIBRARIES})
+    set(LIB_INCLUDE_DIR ${LIBXSLT_INCLUDE_DIR} ${LIBXSLT_EXSLT_INCLUDE_DIR} ${LIBXML2_INCLUDE_DIR})
+    set(LIB_LIBRARIES ${LIBXSLT_LIBRARIES} ${LIBEXSLT_LIBRARIES} ${LIBXSLT_EXSLT_LIBRARIES} ${LIBXML2_LIBRARIES})
     set (SRCS
         xsdparser.cpp
         xslcache.cpp

+ 1 - 1
vcpkg

@@ -1 +1 @@
-Subproject commit 892d5a293a7911cd9dd47b52ae5bf44d88e52d2a
+Subproject commit 58a550920e8fa850570be3b4f1eb783fcf69307c

+ 6 - 13
vcpkg.json

@@ -3,21 +3,14 @@
     "name": "hpcc-platform",
     "version": "8.6.0",
     "dependencies": [
-        {
-            "name": "icu",
-            "platform": "windows"
-        },
-        {
-            "name": "zlib",
-            "platform": "windows | osx"
-        },
-        {
-            "name": "openssl",
-            "platform": "windows | osx"
-        },
+        "icu",
+        "zlib",
+        "openssl",
+        "libxml2",
         {
             "name": "libxslt",
-            "platform": "windows"
+            "default-features": false,
+            "features": []
         },
         {
             "name": "winflexbison",