|
|
|
@ -34,15 +34,15 @@ package("mnn") |
|
|
|
|
package:add("shflags", "-L" .. mnn_lib_dir .. " -lmnn") |
|
|
|
|
else |
|
|
|
|
if package:is_plat("linux", "android", "cross") then |
|
|
|
|
package:add("shflags", " -Wl,--whole-archive " .. mnn_lib_dir .. "/libmnn.a -Wl,--no-whole-archive") |
|
|
|
|
package:add("ldflags", " -Wl,--whole-archive " .. mnn_lib_dir .. "/libmnn.a -Wl,--no-whole-archive") |
|
|
|
|
package:add("shflags", " -Wl,--whole-archive " .. mnn_lib_dir .. "/libMNN.a -Wl,--no-whole-archive") |
|
|
|
|
package:add("ldflags", " -Wl,--whole-archive " .. mnn_lib_dir .. "/libMNN.a -Wl,--no-whole-archive") |
|
|
|
|
elseif package:is_plat("macosx") then |
|
|
|
|
package:add("ldflags", "-Wl,-force_load " .. mnn_lib_dir .. "/libmnn.a") |
|
|
|
|
package:add("shflags", "-Wl,-force_load " .. mnn_lib_dir .. "/libmnn.a") |
|
|
|
|
package:add("ldflags", "-Wl,-force_load " .. mnn_lib_dir .. "/libMNN.a") |
|
|
|
|
package:add("shflags", "-Wl,-force_load " .. mnn_lib_dir .. "/libMNN.a") |
|
|
|
|
elseif package:is_plat("windows") then |
|
|
|
|
package:add("linkdirs", mnn_lib_dir) |
|
|
|
|
package:add("shflags", "/WHOLEARCHIVE:mnn") |
|
|
|
|
package:add("ldflags", "/WHOLEARCHIVE:mnn") |
|
|
|
|
package:add("shflags", "/WHOLEARCHIVE:MNN") |
|
|
|
|
package:add("ldflags", "/WHOLEARCHIVE:MNN") |
|
|
|
|
end |
|
|
|
|
end |
|
|
|
|
|
|
|
|
@ -65,10 +65,10 @@ package("mnn") |
|
|
|
|
|
|
|
|
|
on_install("windows", "linux", "macosx", "android", function (package) |
|
|
|
|
local configs = {"-DMNN_BUILD_TEST=OFF", |
|
|
|
|
"-DMNN_BUILD_DEMO=OFF", |
|
|
|
|
"-DMNN_SUPPORT_TFLITE_QUAN=ON", |
|
|
|
|
"-DMNN_PORTABLE_BUILD=OFF", |
|
|
|
|
"-DMNN_SEP_BUILD=OFF"} |
|
|
|
|
"-DMNN_BUILD_DEMO=OFF", |
|
|
|
|
"-DMNN_SUPPORT_TFLITE_QUAN=ON", |
|
|
|
|
"-DMNN_PORTABLE_BUILD=OFF", |
|
|
|
|
"-DMNN_SEP_BUILD=OFF"} |
|
|
|
|
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) |
|
|
|
|
table.insert(configs, "-DMNN_BUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) |
|
|
|
|
table.insert(configs, "-DMNN_USE_SYSTEM_LIB=" .. (package:config("use_system_lib") and "ON" or "OFF")) |
|
|
|
@ -85,6 +85,12 @@ package("mnn") |
|
|
|
|
end |
|
|
|
|
if package:is_plat("windows") then |
|
|
|
|
table.insert(configs, "-DMNN_WIN_RUNTIME_MT=" .. (package:config("vs_runtime") and "ON" or "OFF")) |
|
|
|
|
io.replace("CMakeLists.txt", |
|
|
|
|
'SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /Zi")', |
|
|
|
|
'SET(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE}")', {plain = true}) |
|
|
|
|
io.replace("CMakeLists.txt", |
|
|
|
|
'SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Zi")', |
|
|
|
|
'SET(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE}")', {plain = true}) |
|
|
|
|
end |
|
|
|
|
if package:is_plat("android") then |
|
|
|
|
table.insert(configs, "-DMNN_USE_SSE=OFF") |
|
|
|
|