Browse Source

concurrencpp: support some platform

star9029 1 year ago
parent
commit
aee8b54a33
1 changed files with 5 additions and 3 deletions
  1. 5 3
      packages/c/concurrencpp/xmake.lua

+ 5 - 3
packages/c/concurrencpp/xmake.lua

@@ -21,12 +21,14 @@ package("concurrencpp")
 
     on_load(function (package)
         package:add("includedirs", "include/concurrencpp-" .. package:version_str())
+        if package:is_plat("windows") and package:config("shared") then
+            package:add("defines", "CRCPP_IMPORT_API")
+        end
     end)
 
-    on_install("macosx", "windows", function (package)
-        assert(package:has_tool("cxx", "clang", "cl"), "compiler not supported!")
+    on_install(function (package)
         local configs = {}
-        table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
+        table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
         table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
         import("package.tools.cmake").install(package, configs)
     end)