Browse Source

update simdjson (#444)

Hoildkv 4 years ago
parent
commit
f663db8c6a
2 changed files with 16 additions and 6 deletions
  1. 3 1
      packages/s/simdjson/port/xmake.lua
  2. 13 5
      packages/s/simdjson/xmake.lua

+ 3 - 1
packages/s/simdjson/port/xmake.lua

@@ -22,7 +22,9 @@ option("logging")
 target("simdjson")   
 target("simdjson")   
     set_languages("c++17")
     set_languages("c++17")
     set_kind("$(kind)")
     set_kind("$(kind)")
+    if is_plat("windows") and is_kind("shared") then
+        add_defines("SIMDJSON_BUILDING_WINDOWS_DYNAMIC_LIBRARY")
+    end
     add_options("threads", "noexceptions", "logging")
     add_options("threads", "noexceptions", "logging")
     add_files("singleheader/simdjson.cpp")
     add_files("singleheader/simdjson.cpp")
     add_headerfiles("singleheader/simdjson.h")
     add_headerfiles("singleheader/simdjson.h")
-    

+ 13 - 5
packages/s/simdjson/xmake.lua

@@ -1,16 +1,23 @@
 package("simdjson")
 package("simdjson")
 
 
     set_homepage("https://simdjson.org")
     set_homepage("https://simdjson.org")
-    set_license("Apache 2.0")
     set_description("Ridiculously fast JSON parsing, UTF-8 validation and JSON minifying for popular 64 bit systems.")
     set_description("Ridiculously fast JSON parsing, UTF-8 validation and JSON minifying for popular 64 bit systems.")
+    set_license("Apache-2.0")
 
 
-    set_urls("https://github.com/simdjson/simdjson.git")
-    add_versions("0.8.2", "61c8cfa07deb7625bb0e6b80dbceb42edd4bf387")
+    add_urls("https://github.com/simdjson/simdjson/archive/refs/tags/$(version).tar.gz",
+             "https://github.com/simdjson/simdjson.git")
+    add_versions("v0.9.5", "db69582fc5e4ece8c0a6a64894efeef475fe22fe466bd67195422de11b08b4d2")
 
 
     add_configs("threads",      { description = "Enable threads.",     default = true,  type = "boolean"})
     add_configs("threads",      { description = "Enable threads.",     default = true,  type = "boolean"})
     add_configs("noexceptions", { description = "Disable exceptions.", default = false, type = "boolean"})
     add_configs("noexceptions", { description = "Disable exceptions.", default = false, type = "boolean"})
     add_configs("logging",      { description = "Enable logging.",     default = false, type = "boolean"})
     add_configs("logging",      { description = "Enable logging.",     default = false, type = "boolean"})
-    
+
+    on_load("windows|x64", function (package)
+        if package:config("shared") then
+            package:add("defines", "SIMDJSON_USING_WINDOWS_DYNAMIC_LIBRARY")
+        end
+    end)
+
     on_install("windows|x64", "mingw|x86_64", "macosx|x86_64", "linux|x86_64", "linux|arm64", "iphoneos|arm64", function(package)
     on_install("windows|x64", "mingw|x86_64", "macosx|x86_64", "linux|x86_64", "linux|arm64", "iphoneos|arm64", function(package)
         local configs = {}
         local configs = {}
         if package:config("shared") then
         if package:config("shared") then
@@ -26,8 +33,9 @@ package("simdjson")
 
 
     on_test(function(package)
     on_test(function(package)
         assert(package:check_cxxsnippets({ test = [[
         assert(package:check_cxxsnippets({ test = [[
+            void test() {
                 simdjson::dom::parser parser;
                 simdjson::dom::parser parser;
+            }
         ]]}, { configs = { languages = "c++17" }, includes = "simdjson.h" })
         ]]}, { configs = { languages = "c++17" }, includes = "simdjson.h" })
         , "Could not compile a test C++ snippet.")
         , "Could not compile a test C++ snippet.")
     end)
     end)
-