mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 06:38:20 +00:00
Switch all of the conan configuration to vcpkg
This commit is contained in:
parent
9da9d0d7a8
commit
674816a01d
8 changed files with 33 additions and 29 deletions
3
.gitmodules
vendored
3
.gitmodules
vendored
|
@ -73,3 +73,6 @@
|
||||||
[submodule "auxil/zeekjs"]
|
[submodule "auxil/zeekjs"]
|
||||||
path = auxil/zeekjs
|
path = auxil/zeekjs
|
||||||
url = https://github.com/corelight/zeekjs.git
|
url = https://github.com/corelight/zeekjs.git
|
||||||
|
[submodule "auxil/vcpkg"]
|
||||||
|
path = auxil/vcpkg
|
||||||
|
url = https://github.com/microsoft/vcpkg
|
||||||
|
|
|
@ -5,6 +5,17 @@ cmake_minimum_required(VERSION 3.15.0 FATAL_ERROR)
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
# Enable usage of CMAKE_MSVC_RUNTIME_LIBRARY variable
|
# Enable usage of CMAKE_MSVC_RUNTIME_LIBRARY variable
|
||||||
cmake_policy(SET CMP0091 NEW)
|
cmake_policy(SET CMP0091 NEW)
|
||||||
|
|
||||||
|
# I tried to just use CMAKE_SOURCE_DIR and CMAKE_CURRENT_SOURCE_DIR
|
||||||
|
# but it's not setting the path correctly and so the toolchain
|
||||||
|
# variable doesn't get passed down to submodules like libkqueue
|
||||||
|
# correctly. Instead get the absolute path to the vcpkg.cmake file
|
||||||
|
# and use that.
|
||||||
|
get_filename_component(_toolchain ./auxil/vcpkg/scripts/buildsystems/vcpkg.cmake ABSOLUTE)
|
||||||
|
|
||||||
|
# This needs to happen before the project() call below so that it
|
||||||
|
# doesn't need to be manually passed on the command line.
|
||||||
|
set(CMAKE_TOOLCHAIN_FILE ${_toolchain} CACHE STRING "Vcpkg toolchain file")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
project(Zeek C CXX)
|
project(Zeek C CXX)
|
||||||
|
@ -119,33 +130,23 @@ if (MSVC)
|
||||||
set(OPENSSL_USE_STATIC_LIBS true)
|
set(OPENSSL_USE_STATIC_LIBS true)
|
||||||
set(OPENSSL_MSVC_STATIC_RT true)
|
set(OPENSSL_MSVC_STATIC_RT true)
|
||||||
|
|
||||||
if (ZEEK_STANDALONE)
|
# Set PCAP_ROOT_DIR to point at the installation from vcpkg. A later call
|
||||||
include(${CMAKE_SOURCE_DIR}/cmake/conan.cmake)
|
# to FindPCAP.cmake will fill in the rest of the necessary variables.
|
||||||
conan_cmake_autodetect(settings)
|
|
||||||
# Install packages from conanfile
|
|
||||||
conan_cmake_install(PATH_OR_REFERENCE ${CMAKE_SOURCE_DIR}/ci/windows/conanfile_windows.txt
|
|
||||||
BUILD missing SETTINGS ${settings})
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
# Set LibPCAP to point to libpcap binaries.
|
|
||||||
if (NOT PCAP_ROOT_DIR)
|
if (NOT PCAP_ROOT_DIR)
|
||||||
find_package(libpcap)
|
set(PCAP_ROOT_DIR "${VCPKG_INSTALLED_DIR}")
|
||||||
set(PCAP_ROOT_DIR "${libpcap_LIB_DIRS}/../")
|
|
||||||
set(PCAP_INCLUDE_DIR ${libpcap_INCLUDES})
|
|
||||||
set(PCAP_LIBRARY ${libpcap_LIBS})
|
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
set(LIBPCAP_PCAP_COMPILE_NOPCAP_HAS_ERROR_PARAMETER false)
|
set(LIBPCAP_PCAP_COMPILE_NOPCAP_HAS_ERROR_PARAMETER false)
|
||||||
|
|
||||||
# Set ZLib to point at the right variable.
|
# Find zlib installed by vcpkg.
|
||||||
find_package(ZLIB)
|
find_package(ZLIB)
|
||||||
set(ZLIB_LIBRARY ${ZLIB_LIBRARIES})
|
set(ZLIB_LIBRARY ZLIB::ZLIB)
|
||||||
|
|
||||||
# Set CAres
|
# Find c-ares installed by vcpkg.
|
||||||
find_package(c-ares)
|
find_package(c-ares)
|
||||||
set(HAVE_CARES true) # Disable FindCAres cmake file
|
set(HAVE_CARES true) # Disable FindCAres cmake file
|
||||||
include_directories(BEFORE ${c-ares_INCLUDE_DIRS})
|
include_directories(BEFORE ${c-ares_INCLUDE_DIRS})
|
||||||
set(zeekdeps ${zeekdeps} ${c-ares_LIBRARIES})
|
set(zeekdeps ${zeekdeps} c-ares::cares)
|
||||||
add_definitions(-DCARES_STATICLIB)
|
add_definitions(-DCARES_STATICLIB)
|
||||||
|
|
||||||
add_subdirectory(auxil/libunistd)
|
add_subdirectory(auxil/libunistd)
|
||||||
|
|
1
auxil/vcpkg
Submodule
1
auxil/vcpkg
Submodule
|
@ -0,0 +1 @@
|
||||||
|
Subproject commit 38d1652f152d36481f2f4e8a85c0f1e14f3769f7
|
|
@ -16,8 +16,6 @@ RUN [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePoin
|
||||||
# Install prerequisites
|
# Install prerequisites
|
||||||
RUN choco install -y --no-progress visualstudio2019buildtools --version=16.11.11.0
|
RUN choco install -y --no-progress visualstudio2019buildtools --version=16.11.11.0
|
||||||
RUN choco install -y --no-progress visualstudio2019-workload-vctools --version=1.0.0 --package-parameters '--add Microsoft.VisualStudio.Component.VC.ATLMFC'
|
RUN choco install -y --no-progress visualstudio2019-workload-vctools --version=1.0.0 --package-parameters '--add Microsoft.VisualStudio.Component.VC.ATLMFC'
|
||||||
# Pin conan to 1.58.0 until conan.cmake is updated to support 2.0
|
|
||||||
RUN choco install -y --no-progress conan --version=1.58.0
|
|
||||||
RUN choco install -y --no-progress sed
|
RUN choco install -y --no-progress sed
|
||||||
RUN choco install -y --no-progress winflexbison3
|
RUN choco install -y --no-progress winflexbison3
|
||||||
RUN choco install -y --no-progress msysgit
|
RUN choco install -y --no-progress msysgit
|
||||||
|
|
|
@ -7,5 +7,5 @@ call "c:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\VC\Auxiliar
|
||||||
mkdir build
|
mkdir build
|
||||||
cd build
|
cd build
|
||||||
|
|
||||||
cmake.exe .. -DCMAKE_BUILD_TYPE=release -DENABLE_ZEEK_UNIT_TESTS=yes -G Ninja
|
cmake.exe .. -DCMAKE_BUILD_TYPE=release -DVCPKG_TARGET_TRIPLET="x64-windows-static" -DENABLE_ZEEK_UNIT_TESTS=yes -G Ninja
|
||||||
cmake.exe --build .
|
cmake.exe --build .
|
||||||
|
|
|
@ -1,8 +0,0 @@
|
||||||
[requires]
|
|
||||||
zlib/1.2.11
|
|
||||||
libpcap/1.10.1
|
|
||||||
c-ares/1.21.0
|
|
||||||
|
|
||||||
[generators]
|
|
||||||
cmake_find_package
|
|
||||||
cmake
|
|
2
cmake
2
cmake
|
@ -1 +1 @@
|
||||||
Subproject commit 01fcb683005e3c3a71ae867aa983b772a77e32d1
|
Subproject commit 217865f599234029ae8eaecc5ee025fe0658688e
|
9
vcpkg.json
Normal file
9
vcpkg.json
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
{
|
||||||
|
"name": "main",
|
||||||
|
"version-string": "latest",
|
||||||
|
"dependencies": [
|
||||||
|
"c-ares",
|
||||||
|
"libpcap",
|
||||||
|
"zlib"
|
||||||
|
]
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue