summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick McLean <chutzpah@gentoo.org>2023-04-27 14:57:09 -0700
committerPatrick McLean <chutzpah@gentoo.org>2023-04-27 15:01:26 -0700
commit8a0b80a318c74dd0765d2f0b630140863d8c2fd2 (patch)
tree80aeae884046b18bf37512a4d90769fdc8c78b84 /dev-libs/simdjson
parentgames-server/bedrock-server: add 1.19.81.01 (diff)
downloadgentoo-8a0b80a318c74dd0765d2f0b630140863d8c2fd2.tar.gz
gentoo-8a0b80a318c74dd0765d2f0b630140863d8c2fd2.tar.bz2
gentoo-8a0b80a318c74dd0765d2f0b630140863d8c2fd2.zip
dev-libs/simdjson: Add all-impls USE flag, and enable by default
By default upstream only compiles and enables the "optimial" implementation for the current system. This is nice for some cases, however for a distro package this is not ideal. Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
Diffstat (limited to 'dev-libs/simdjson')
-rw-r--r--dev-libs/simdjson/metadata.xml1
-rw-r--r--dev-libs/simdjson/simdjson-3.1.7-r1.ebuild (renamed from dev-libs/simdjson/simdjson-3.1.7.ebuild)33
2 files changed, 25 insertions, 9 deletions
diff --git a/dev-libs/simdjson/metadata.xml b/dev-libs/simdjson/metadata.xml
index 0bd99c992917..d541fa2ee4a1 100644
--- a/dev-libs/simdjson/metadata.xml
+++ b/dev-libs/simdjson/metadata.xml
@@ -7,5 +7,6 @@
</maintainer>
<use>
<flag name="tools">Build and install extra command line tools</flag>
+ <flag name="all-impls">Enable all implementations rather than only onem</flag>
</use>
</pkgmetadata>
diff --git a/dev-libs/simdjson/simdjson-3.1.7.ebuild b/dev-libs/simdjson/simdjson-3.1.7-r1.ebuild
index 433f9a71935e..7900f6af3b7b 100644
--- a/dev-libs/simdjson/simdjson-3.1.7.ebuild
+++ b/dev-libs/simdjson/simdjson-3.1.7-r1.ebuild
@@ -19,7 +19,7 @@ SRC_URI="
LICENSE="Apache-2.0 Boost-1.0 BSD MIT"
SLOT="0/15"
KEYWORDS="~amd64 ~arm ~arm64 ~ppc64 ~x86"
-IUSE="test tools"
+IUSE="+all-impls test tools"
BDEPEND="
sys-apps/file
@@ -63,23 +63,38 @@ src_prepare() {
src_configure() {
local mycmakeargs=(
- -DSIMDJSON_ENABLE_THREADS=ON
+ -DSIMDJSON_ENABLE_THREADS:BOOL=ON
)
use test && mycmakeargs+=(
- -DSIMDJSON_TESTS=ON
+ -DSIMDJSON_TESTS:BOOL=ON
)
if use tools; then
mycmakeargs+=(
- -DSIMDJSON_DEVELOPER_MODE=ON
- -DSIMDJSON_ALLOW_DOWNLOADS=OFF
- -DSIMDJSON_GOOGLE_BENCHMARKS=OFF
- -DSIMDJSON_COMPETITION=OFF
- -DSIMDJSON_TOOLS=ON
+ -DSIMDJSON_DEVELOPER_MODE:BOOL=ON
+ -DSIMDJSON_ALLOW_DOWNLOADS:BOOL=OFF
+ -DSIMDJSON_GOOGLE_BENCHMARKS:BOOL=OFF
+ -DSIMDJSON_COMPETITION:BOOL=OFF
+ -DSIMDJSON_TOOLS:BOOL=ON
)
elif ! use test; then
mycmakeargs+=(
- -DSIMDJSON_DEVELOPER_MODE=OFF
+ -DSIMDJSON_DEVELOPER_MODELBOOL=OFF
+ )
+ fi
+
+ if use all-impls; then
+ local -a impls=("fallback")
+ if use amd64 || use x86; then
+ impls+=("westmere" "haswell" "icelake")
+ elif use arm64; then
+ impls+=("arm64")
+ elif use ppc64; then
+ impls+=("ppc64")
+ fi
+
+ mycmakeargs+=(
+ -DSIMDJSON_IMPLEMENTATION:STRING=$(printf '%s;' "${impls[@]}")
)
fi