summaryrefslogtreecommitdiff
path: root/dev-python/fastsimdjson/files/fastsimdjson-0.8.0-unbundle.patch
blob: cd1ad24cdf8010898b327d0594cff0e892bef3e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
diff --git a/setup.py b/setup.py
index 5b96127..1accfc0 100644
--- a/setup.py
+++ b/setup.py
@@ -10,11 +10,11 @@ DEFINES = [("NDEBUG", None), ("SIMDJSON_ENABLE_NAN_INF", "1")]
 ext = Extension(
     "fastsimdjson",
     # src/fastsimdjson.cpp includes vendor/simdjson.cpp (a unity build).
-    sources=["src/fastsimdjson.cpp", "vendor/simdutf.cpp"],
-    depends=["vendor/simdjson.cpp", "vendor/simdjson.h", "vendor/simdutf.h",
-             "vendor/zmij.h", "vendor/zmij.cc"],
-    include_dirs=["vendor"],
+    sources=["src/fastsimdjson.cpp"],
+    depends=[],
+    include_dirs=[],
     language="c++",
+    libraries=["simdjson", "simdutf", "zmij"],
     define_macros=DEFINES,
 )
 
@@ -23,15 +23,8 @@ class BuildExt(build_ext):
     def build_extensions(self):
         msvc = self.compiler.compiler_type == "msvc"
         args = ["/std:c++17", "/O2", "/EHsc", "/utf-8"] if msvc else ["-std=c++17", "-O3"]
-        # zmij (float formatting) is compiled as C++14: some compilers reject
-        # its constant tables in C++17 mode.
-        zmij_args = ["/std:c++14", "/O2", "/EHsc"] if msvc else ["-std=c++14", "-O3"]
-        zmij = self.compiler.compile([os.path.join("vendor", "zmij.cc")],
-                                     output_dir=self.build_temp, include_dirs=["vendor"],
-                                     macros=[("NDEBUG", None)], extra_postargs=zmij_args)
         for e in self.extensions:
             e.extra_compile_args = args
-            e.extra_objects = list(zmij)
         super().build_extensions()
 
 
diff --git a/src/fastsimdjson.cpp b/src/fastsimdjson.cpp
index f7fcf2b..c273e26 100644
--- a/src/fastsimdjson.cpp
+++ b/src/fastsimdjson.cpp
@@ -30,10 +30,9 @@
 
 // simdjson.cpp is compiled here (a unity build) so that dumps can call its
 // float-to-decimal routine, dtoa_impl::dragonbox, directly.
-#include "simdjson.h"
-#include "simdjson.cpp"
-#include "simdutf.h"
-#include "zmij.h" // shortest float digits for dumps and dumpb (vendor/zmij.cc)
+#include <simdjson.h>
+#include <simdutf.h>
+#include <zmij.h> // shortest float digits for dumps and dumpb (vendor/zmij.cc)
 
 #ifdef _MSC_VER
 #include <intrin.h>