xmake.lua 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. set_project("proto_demo")
  2. set_xmakever("2.6.0")
  3. set_version("0.0.1", {build = "%Y%m%d%H%M"})
  4. add_rules("mode.debug", "mode.release")
  5. includes("3rdparty/GmSSL")
  6. target("proto_demo")
  7. set_kind("shared")
  8. set_languages("c11", "c++17")
  9. if is_host("windows") then
  10. add_files("./*.cpp")
  11. else
  12. add_files("./*.cpp|dllmain.cpp")
  13. end
  14. add_defines("FMT_HEADER_ONLY=1")
  15. add_includedirs(
  16. "./",
  17. "../deps/cmndev/include",
  18. "../deps/cmnsdk.proto/include",
  19. "../deps/cppapp.toollib/include",
  20. "../deps/ncpp.external.bizkit/include",
  21. "../deps/MemeString/include",
  22. "../deps/filesystem/include",
  23. "./3rdparty/spdlog-1.13.0/include",
  24. "./3rdparty/fmt-10.2.1/include",
  25. "./3rdparty/json-3.11.2/include"
  26. )
  27. add_deps("gmssl")
  28. add_syslinks("pthread", "dl", "rt")
  29. add_rpathdirs("$ORIGIN")
  30. add_rpathdirs("$ORIGIN/../lib")
  31. if is_host("linux") then
  32. add_cxxflags("-fPIC", "-fexceptions")
  33. add_ldflags ("-fPIC", "-fexceptions")
  34. end
  35. target_end()