Commit Graph

17 Commits

Author SHA1 Message Date
David Adam
db9bb96910 Drop CMake PCRE2 download/linking and allow statically-linked PCRE2 crate
pcre2-sys includes a vendored copy of PCRE2, which allows for
statically-linked PCRE2. Hook this up to the CMake build variable, and
remove the C++ integration for PCRE2.
2024-01-13 20:43:12 +08:00
Mahmoud Al-Qudsi
2c0bbb0f82 Revert "cmake: Use pcre2 tag directly"
This reverts commit 2cc4437567.

As pointed out to me, it is safer to use the SHA directly to ~guarantee
the remote resource hasn't changed.
2022-10-28 17:59:08 -05:00
Mahmoud Al-Qudsi
c45fac84ee cmake: Use shallow clone for pcre2
This should speed up the clones and reduce unnecessary usage of both
bandwidth and disk space.
2022-10-28 14:04:14 -05:00
Mahmoud Al-Qudsi
2cc4437567 cmake: Use pcre2 tag directly 2022-10-28 14:04:14 -05:00
Mahmoud Al-Qudsi
8b5cc0883a Use the official organization URL for PCRE2
PhilipHazel/pcre2.git redirects here *for now* but we shouldn't be using
anything other than the official GitHub repo.
2022-10-14 21:39:16 -05:00
ridiculousfish
deec78cdd3 cmake: Unset GIT_WORK_TREE and GIT_DIR before FetchContent_Populate
GIT_WORK_TREE is an environment variable which tells git where the
worktree is. It may be set by the user or by git itself, e.g. when
running `git rebase -i --exec ...`. If it is set, it overrides the
working directory, causing the `git checkout` from FetchContent_Populate
to fail. Clear this variable.

Do the same for GIT_DIR for the same reason.

A way to reproduce the failure that this commit fixes is:

    git rebase -i HEAD^^^ --exec 'ninja -C /path/to/build/dir fish'

prior to this commit, using the fetched PCRE2, this would fail in CMake.
2022-08-06 13:07:22 -07:00
Aaron Gyes
dbb4e05254 Revert "PCRE2.cmake: update minimum system PCRE2 version, use GIT_SHALLOW"
This was in response to a feature we were using that required a
very new PCRE2: that was backed out.

So this reverts commit e63af7d006.
2022-07-10 12:44:35 -07:00
Aaron Gyes
e63af7d006 PCRE2.cmake: update minimum system PCRE2 version, use GIT_SHALLOW
GIT_SHALLOW 1 here improves generation speed and _deps in the build
dir like is 6 or 7 MB less according to `du`.

Bump the minimum PCRE2 to 10.35 on account of we use
PCRE2_SUBSTITUTE_LITERAL.
2022-07-09 20:00:53 -07:00
ridiculousfish
5b1e106d87 cmake: Download and fetch PCRE2 rather than using vendored sources
This switches to using the CMake FetchContent path to dynamically download
and build PCRE2, allowing us to drop the vendored sources.

The FISH_USE_SYSTEM_PCRE2 CMake option is kept, but if false it now means
fetch-and-build PCRE2 rather than building vendored sources.

Note FetchContent was introduced in CMake 3.11. That is now a prerequisite
for building fish with FISH_USE_SYSTEM_PCRE2 disabled.
2022-07-02 18:46:58 -07:00
ridiculousfish
d6d0723e0d cmake: Disable -Wunused-macros for bundled PCRE2
This is a noisy warning when building PCRE2
2021-10-16 13:50:33 -07:00
ridiculousfish
b88b6ea504 Add CMake variable FISH_USE_SYSTEM_PCRE2
The CMake variable FISH_USE_SYSTEM_PCRE2 now controls whether fish uses
system PCRE2 or the bundled version. The default is to use the system
version, unless no such version is found, or unless it is a macOS build
with code signing. Note the default behavior has not changed.

Fixes #6952
2020-04-28 18:30:40 -07:00
ridiculousfish
f117addf7c Use lowercase CMake function names
This is a best practice to distinguish them from variables.
2020-03-14 16:11:35 -07:00
Aaron Gyes
cc5550c458 Move pcre2-10.34 to pcre2/ 2020-02-19 16:42:08 -08:00
ridiculousfish
952d9eecf7 Always use bundled PCRE on Mac
A code-signed fish cannot load a PCRE that is not codesigned, which can
easily come about through Homebrew.
2020-02-18 12:55:11 -07:00
Aaron Gyes
b418e36f22 Take an axe to vendored PCRE2 bits & update it to 10.34
This commit updates PCRE2 to 10.34, and we no longer include what's in their
tarball as-is. I've yanked out a lot of uneccessary stuff for the sake of the
size of our codebase.

original pcre2-10.34 dir: 11.5MB
pcre2 dir in this commit:  1.6MB

 * Remove documentation, makefiles, test suites, etc. LICENSE remains.
 * Disable building tests when configuring PCRE2
 * Yard out JIT support: delete src/jit, src/pcre2_jit_*.c, and code doing
   stuff to code->executable_jit that needs a jit header (it was already NULL
   because we've always built with JIT disabled).
 * Remove most .c and .h files not needed to compile: pcre2grep code,
   pcre2test code, dftables.c, pcre2_printint.c, pcre2_fuzzsupport.c ...
 * Remove FindBZip2, FindZLIB, FindReadline, FindEditline. These were used
   only by pcre2grep and made CMake's report misleading with regard to
   optional packages being used.
 * Remove configure.ac except for version number and date which CMake checks

Next time we update PCRE2, refer to this commit message as well as a diff
between pcre2-10.34.tar.gz and ./pcre2-10.34/. Or better yet, cease including
pcre2.
2020-02-18 08:16:15 -08:00
David Adam
b60a9d8c4a pcre2: move to PCRE2 10.32
Closes #5353.
2018-12-29 22:54:40 +08:00
David Adam
396faebc08 Move CMakeFiles to cmake
Makes in-tree (ie `cmake .`) builds work.
2017-11-17 16:21:55 +08:00