|
@@ -29,21 +29,11 @@ package("fmt")
|
|
|
end
|
|
|
io.gsub("CMakeLists.txt", "MASTER_PROJECT AND CMAKE_GENERATOR MATCHES \"Visual Studio\"", "0")
|
|
|
local configs = {"-DFMT_TEST=OFF", "-DFMT_DOC=OFF", "-DFMT_FUZZ=OFF"}
|
|
|
- if package:is_plat("windows") then
|
|
|
- -- TODO we will remove it after xmake/2.5.1
|
|
|
- local vs_runtime = package:config("vs_runtime")
|
|
|
- if vs_runtime == "MT" then
|
|
|
- table.insert(configs, "-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded")
|
|
|
- elseif vs_runtime == "MTd" then
|
|
|
- table.insert(configs, "-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug")
|
|
|
- elseif vs_runtime == "MD" then
|
|
|
- table.insert(configs, "-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL")
|
|
|
- elseif vs_runtime == "MDd" then
|
|
|
- table.insert(configs, "-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebugDLL")
|
|
|
- end
|
|
|
- end
|
|
|
table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
|
|
|
table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
|
|
|
+ if package:config("pic") ~= false then
|
|
|
+ table.insert(configs, "-DCMAKE_POSITION_INDEPENDENT_CODE=ON")
|
|
|
+ end
|
|
|
import("package.tools.cmake").install(package, configs)
|
|
|
end)
|
|
|
|