xmake.lua 1.6 KB

1234567891011121314151617181920212223242526272829
  1. package("fast-cdr")
  2. set_homepage("https://www.eprosima.com")
  3. set_description("eProsima FastCDR library provides two serialization mechanisms. One is the standard CDR serialization mechanism, while the other is a faster implementation of it.")
  4. set_license("Apache-2.0")
  5. add_urls("https://github.com/eProsima/Fast-CDR/archive/refs/tags/$(version).tar.gz",
  6. "https://github.com/eProsima/Fast-CDR.git")
  7. add_versions("v2.1.3", "9a992cf20d8df727df1cd389cc36039c92bbe86762b2c17a479f4f59a499b1ea")
  8. add_versions("v1.1.0", "5c4b2ad5493abd30b9475b14856641a8944c98077a36bd0760c1d83c65216e67")
  9. add_deps("cmake")
  10. on_install("windows", "linux", "macosx", "bsd", "msys", "android", "iphoneos", "cross", "wasm", function (package)
  11. local configs = {}
  12. table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:is_debug() and "Debug" or "Release"))
  13. table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
  14. io.replace("include/fastcdr/eProsima_auto_link.h", " #pragma \\\n comment(lib, EPROSIMA_LIB_PREFIX EPROSIMA_STRINGIZE(EPROSIMA_LIB_NAME) EPROSIMA_LIB_DEBUG_TAG \"-\" EPROSIMA_STRINGIZE(FASTCDR_VERSION_MAJOR) \".\" EPROSIMA_STRINGIZE(FASTCDR_VERSION_MINOR) \".lib\")", "", {plain = true})
  15. import("package.tools.cmake").install(package, configs)
  16. end)
  17. on_test(function (package)
  18. assert(package:check_cxxsnippets({test = [[
  19. #include <fastcdr/FastBuffer.h>
  20. void test() {
  21. auto buffer = eprosima::fastcdr::FastBuffer();
  22. }
  23. ]]}, {configs = {languages = "c++11"}}))
  24. end)