|
|
|
@ -28,10 +28,14 @@ package("benchmark") |
|
|
|
|
|
|
|
|
|
if is_plat("linux") then |
|
|
|
|
add_syslinks("pthread") |
|
|
|
|
elseif is_plat("windows") then |
|
|
|
|
elseif is_plat("windows", "mingw") then |
|
|
|
|
add_syslinks("shlwapi") |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
if is_plat("mingw") then |
|
|
|
|
add_configs("shared", {description = "Build shared library.", default = true, type = "boolean", readonly = true}) |
|
|
|
|
end |
|
|
|
|
|
|
|
|
|
add_deps("cmake") |
|
|
|
|
add_links("benchmark_main", "benchmark") |
|
|
|
|
on_load("windows", function (package) |
|
|
|
@ -40,7 +44,7 @@ package("benchmark") |
|
|
|
|
end |
|
|
|
|
end) |
|
|
|
|
|
|
|
|
|
on_install("macosx", "linux", "windows", function (package) |
|
|
|
|
on_install("macosx", "linux", "windows", "mingw", function (package) |
|
|
|
|
local configs = {"-DBENCHMARK_ENABLE_TESTING=OFF", "-DBENCHMARK_INSTALL_DOCS=OFF"} |
|
|
|
|
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release")) |
|
|
|
|
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF")) |
|
|
|
@ -55,4 +59,4 @@ package("benchmark") |
|
|
|
|
BENCHMARK(BM_empty); |
|
|
|
|
BENCHMARK(BM_empty)->ThreadPerCpu(); |
|
|
|
|
]]}, {configs = {languages = "c++14"}, includes = "benchmark/benchmark.h"})) |
|
|
|
|
end) |
|
|
|
|
end) |