|
@@ -41,8 +41,6 @@ package("abseil")
|
|
add_frameworks("CoreFoundation")
|
|
add_frameworks("CoreFoundation")
|
|
end
|
|
end
|
|
|
|
|
|
- add_configs("cxx17", {description = "Use C++ 17 to compile Abseil", default = true, type = "boolean"})
|
|
|
|
-
|
|
|
|
on_load(function (package)
|
|
on_load(function (package)
|
|
if package:is_plat("windows") and package:config("shared") then
|
|
if package:is_plat("windows") and package:config("shared") then
|
|
package:add("defines", "ABSL_CONSUME_DLL")
|
|
package:add("defines", "ABSL_CONSUME_DLL")
|
|
@@ -51,20 +49,13 @@ package("abseil")
|
|
end)
|
|
end)
|
|
|
|
|
|
on_install("macosx", "linux", "windows", "mingw", "cross", function (package)
|
|
on_install("macosx", "linux", "windows", "mingw", "cross", function (package)
|
|
- local configs = {}
|
|
|
|
- if package:config("cxx17") then
|
|
|
|
- table.insert(configs, "-DCMAKE_CXX_STANDARD=17")
|
|
|
|
- end
|
|
|
|
|
|
+ local configs = {"-DCMAKE_CXX_STANDARD=17"}
|
|
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
|
|
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"))
|
|
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
|
|
import("package.tools.cmake").install(package, configs, {buildir = os.tmpfile() .. ".dir"})
|
|
import("package.tools.cmake").install(package, configs, {buildir = os.tmpfile() .. ".dir"})
|
|
end)
|
|
end)
|
|
|
|
|
|
on_test(function (package)
|
|
on_test(function (package)
|
|
- local configs = {}
|
|
|
|
- if package:config("cxx17") then
|
|
|
|
- configs.languages = "cxx17"
|
|
|
|
- end
|
|
|
|
assert(package:check_cxxsnippets({test = [[
|
|
assert(package:check_cxxsnippets({test = [[
|
|
#include <iostream>
|
|
#include <iostream>
|
|
#include <string>
|
|
#include <string>
|
|
@@ -78,5 +69,5 @@ package("abseil")
|
|
auto a = absl::SimpleAtoi("123", &result);
|
|
auto a = absl::SimpleAtoi("123", &result);
|
|
std::cout << "Joined string: " << s << "\\n";
|
|
std::cout << "Joined string: " << s << "\\n";
|
|
}
|
|
}
|
|
- ]]}, {configs = configs}))
|
|
|
|
|
|
+ ]]}, {configs = {languages = "cxx17"}}))
|
|
end)
|
|
end)
|