added CMake source in XMake
This commit is contained in:
parent
f2b20118e0
commit
1f76815be0
22
code/XMake/CMake.lua
Normal file
22
code/XMake/CMake.lua
Normal file
@ -0,0 +1,22 @@
|
||||
add_rules("mode.debug", "mode.release")
|
||||
|
||||
package("foo")
|
||||
add_deps("cmake")
|
||||
set_sourcedir(path.join(os.scriptdir(), "foo"))
|
||||
on_install(function (package)
|
||||
local configs = {}
|
||||
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"))
|
||||
import("package.tools.cmake").install(package, configs)
|
||||
end)
|
||||
on_test(function (package)
|
||||
assert(package:has_cfuncs("add", {includes = "foo.h"}))
|
||||
end)
|
||||
package_end()
|
||||
|
||||
add_requires("foo")
|
||||
|
||||
target("demo")
|
||||
set_kind("binary")
|
||||
add_files("src/main.c")
|
||||
add_packages("foo")
|
Loading…
Reference in New Issue
Block a user