-
I added CMake FreeRTOS-Kernel library into my xmake project. How I add CMake library into xmake: package("freertos")
add_deps("cmake")
set_sourcedir(path.join(os.scriptdir(), "third_party/FreeRTOS-Kernel"))
on_install(function (package)
local configs = {
"-DCMAKE_TRY_COMPILE_TARGET_TYPE=STATIC_LIBRARY",
"-DCMAKE_SYSTEM_NAME=Generic",
"-DCMAKE_SYSTEM_PROCESSOR=arm",
"-DCMAKE_C_FLAGS=" .. table.concat(compile_flags, " "),
"-DFREERTOS_PORT=GCC_ARM_CM4F",
"-DFREERTOS_CONFIG_FILE_DIRECTORY=" .. path.absolute(os.projectdir())
}
import("package.tools.cmake").install(package, configs)
end)
package_end() Then how I try to use it: add_requires("freertos")
target("stm32f4.elf")
add_packages("freertos")
add_files(
"main.cpp"
) As a result, I get In my old CMake project I successfully linked binary with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
install .a libfiles to package/installdir/lib |
Beta Was this translation helpful? Give feedback.
install .a libfiles to package/installdir/lib