fish-shell/cmake/PCRE2.cmake
Peter Ammon 4e79ec5f0e
CMake: Restore static PCRE2 builds
The recent update to the rust-pcre2 crate lost the property where a static
PCRE2 build could be enabled with a Cargo feature. This means that static
PCRE2 builds can no longer be forced.

Switch to setting the "PCRE2_SYS_STATIC" variable again, which is how the
official rust-pcre2 crate expects to work.
2024-09-29 19:42:48 -07:00

10 lines
345 B
CMake

set(FISH_USE_SYSTEM_PCRE2 ON CACHE BOOL
"Try to use PCRE2 from the system, instead of the pcre2-sys version")
if(FISH_USE_SYSTEM_PCRE2)
message(STATUS "Trying to use PCRE2 from the system")
set(FISH_PCRE2_BUILDFLAG "")
else()
message(STATUS "Forcing static build of PCRE2")
set(ENV{PCRE2_SYS_STATIC} "1")
endif(FISH_USE_SYSTEM_PCRE2)