Skip to content

Commit

Permalink
build: use vectorscan only for AppleSilicon builds
Browse files Browse the repository at this point in the history
  • Loading branch information
variar committed Nov 24, 2024
1 parent 59071f1 commit 7545d59
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 37 deletions.
38 changes: 12 additions & 26 deletions .github/workflows/ci-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,17 @@ jobs:
# container: variar/klogg_oracle7
# cmake_opts: -DKLOGG_USE_SENTRY=OFF -DKLOGG_USE_LTO=OFF -DKLOGG_USE_HYPERSCAN=OFF

# - os: oraclelinux
# os_version: 8
# arch: x64
# check_command: yum install -y --setopt tsflags=test /usr/local/klogg*.rpm
# cpack_gen: RPM
# artifacts_id: oracle
# package_suffix: rpm
# check_container: oraclelinux:8
# container_root: docker/oracle8
# container: variar/klogg_oracle8
# cmake_opts: -DCMAKE_BUILD_WITH_INSTALL_RPATH=on
- os: oraclelinux
os_version: 8
arch: x64
check_command: yum install -y --setopt tsflags=test /usr/local/klogg*.rpm
cpack_gen: RPM
artifacts_id: oracle
package_suffix: rpm
check_container: oraclelinux:8
container_root: docker/oracle8
container: variar/klogg_oracle8
cmake_opts: -DCMAKE_BUILD_WITH_INSTALL_RPATH=on

- os: ubuntu_focal
os_version: 20.04
Expand Down Expand Up @@ -163,7 +163,7 @@ jobs:
qt_modules: qt5compat
arch: arm64
artifacts_id: macos-arm-qt6
cmake_opts: -DKLOGG_OSX_DEPLOYMENT_TARGET=14.0 -DKLOGG_GENERIC_CPU=OFF
cmake_opts: -DKLOGG_OSX_DEPLOYMENT_TARGET=14.0

runs-on: ${{ matrix.config.os }}-${{ matrix.config.os_version }}
steps:
Expand Down Expand Up @@ -250,20 +250,6 @@ jobs:
echo "SSL_DIR=${{ github.workspace }}\openssl-1.1\${{ matrix.config.arch }}\bin" >> $GITHUB_ENV
echo "SSL_ARCH=${{ matrix.config.ssl_arch }}" >> $GITHUB_ENV
- name: Add pkg-config
shell: sh
run: |
choco install pkgconfiglite
- name: Add ragel
shell: sh
run: |
mkdir -p ./3rdparty/ragel
curl --progress-bar --location --output ./3rdparty/ragel/ragel.zip https://github.com/PolarGoose/Ragel-for-Windows/releases/download/ragel-6.10/Ragel.zip
cd ./3rdparty/ragel
7z x ragel.zip
echo "RAGEL_ROOT=${{ github.workspace }}\3rdparty\ragel" >> $GITHUB_ENV
- uses: ./.github/actions/agent-setup
- uses: ./.github/actions/klogg-version
- uses: ./.github/actions/prepare-workspace-env
Expand Down
5 changes: 3 additions & 2 deletions 3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,9 @@ cpmaddpackage(
YES
)

if(KLOGG_USE_VECTORSCAN)
if(KLOGG_USE_HYPERSCAN)

elseif(KLOGG_USE_VECTORSCAN)
cpmaddpackage(
NAME
vectorscan
Expand Down Expand Up @@ -67,7 +69,6 @@ if(KLOGG_USE_VECTORSCAN)
${vectorscan_SOURCE_DIR}/src
${vectorscan_BINARY_DIR}
)

endif()

cpmaddpackage(
Expand Down
14 changes: 11 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,20 @@ endif()

if(WIN32)
if(KLOGG_ARCH EQUAL 64)
option(KLOGG_USE_VECTORSCAN "Use Hyperscan" ON)
option(KLOGG_USE_HYPERSCAN "Use Hyperscan" ON)
option(KLOGG_USE_VECTORSCAN "Use Vectorscan" OFF)
else()
option(KLOGG_USE_VECTORSCAN "Use Hyperscan" OFF)
option(KLOGG_USE_HYPERSCAN "Use Hyperscan" OFF)
option(KLOGG_USE_VECTORSCAN "Use Vectorscan" OFF)
endif()
else()
option(KLOGG_USE_VECTORSCAN "Use Hyperscan" ON)
if(CMAKE_HOST_SYSTEM_PROCESSOR MATCHES "arm64")
option(KLOGG_USE_HYPERSCAN "Use Hyperscan" OFF)
option(KLOGG_USE_VECTORSCAN "Use Vectorscan" ON)
else()
option(KLOGG_USE_HYPERSCAN "Use Hyperscan" ON)
option(KLOGG_USE_VECTORSCAN "Use Vectorscan" OFF)
endif()
endif()

set(BUILD_VERSION
Expand Down
6 changes: 1 addition & 5 deletions docker/oracle8/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,9 @@ RUN yum update -y && \
yum install -y ragel make wget python38 rpm-build git \
qt5-qtbase-devel qt5-linguist qt5-qttranslations \
openssl-devel boost-devel zlib-devel libcurl-devel \
elfutils-devel && \
gcc gcc-c++ elfutils-devel && \
yum clean all

RUN dnf install gcc-toolset-12

RUN wget https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2-linux-x86_64.sh && \
chmod 755 cmake-3.20.2-linux-x86_64.sh && \
./cmake-3.20.2-linux-x86_64.sh --prefix=/opt/ --exclude-subdir --skip-license && \
Expand All @@ -19,7 +17,5 @@ RUN wget https://github.com/Kitware/CMake/releases/download/v3.20.2/cmake-3.20.2
RUN wget https://github.com/ninja-build/ninja/releases/download/v1.10.2/ninja-linux.zip && \
unzip ninja-linux.zip && chmod 755 ninja && mv ninja /opt/bin && rm ninja-linux.zip

RUN echo "source /opt/rh/devtoolset-12/enable" >> ~/.bashrc

ENV PATH=/opt/bin:$PATH

5 changes: 4 additions & 1 deletion src/regex/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ target_link_libraries(
exprtk
)

if(KLOGG_USE_VECTORSCAN)
if(KLOGG_USE_HYPERSCAN)
target_link_libraries(klogg_regex PUBLIC klogg_hyperscan)
target_compile_definitions(klogg_regex PUBLIC KLOGG_HAS_HS)
elseif(KLOGG_USE_VECTORSCAN)
target_link_libraries(klogg_regex PUBLIC klogg_vectorscan)
target_compile_definitions(klogg_regex PUBLIC KLOGG_HAS_HS)
endif()
Expand Down

0 comments on commit 7545d59

Please sign in to comment.