Build.cmake 4.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. function(build_boxing_module build_static_flag build_shared_flag module_name module_name_core source_files)
  2. if (${build_static_flag})
  3. add_library("${${module_name}}" STATIC ${${source_files}})
  4. set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
  5. endif ()
  6. if (${build_shared_flag})
  7. add_library("${${module_name}}" SHARED ${${source_files}})
  8. target_link_libraries("${${module_name}}" ${module_name_core})
  9. set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
  10. endif ()
  11. endfunction()
  12. function(build_core_module build_static_flag build_shared_flag build_jni_flag module_name source_files jni_source_files)
  13. if (${build_static_flag})
  14. add_library("${${module_name}}" STATIC ${${source_files}})
  15. set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
  16. endif ()
  17. if (${build_shared_flag})
  18. if (${build_jni_flag})
  19. message("${${module_name}}: building with JNI...")
  20. add_library("${${module_name}}" SHARED ${${source_files}} ${${jni_source_files}})
  21. set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
  22. else ()
  23. add_library("${${module_name}}" SHARED ${${source_files}})
  24. set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
  25. endif ()
  26. endif ()
  27. endfunction()
  28. function(build_encoding_module build_static_flag build_shared_flag module_name module_name_core source_files)
  29. if (${build_static_flag})
  30. add_library("${${module_name}}" STATIC ${${source_files}})
  31. set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
  32. endif ()
  33. if (${build_shared_flag})
  34. add_library("${${module_name}}" SHARED ${${source_files}})
  35. target_link_libraries("${${module_name}}" ${module_name_core})
  36. set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
  37. endif ()
  38. endfunction()
  39. function(build_event_module build_static_flag build_shared_flag module_name module_name_core source_files)
  40. if (${build_static_flag})
  41. add_library("${${module_name}}" STATIC ${${source_files}})
  42. set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
  43. endif ()
  44. if (${build_shared_flag})
  45. add_library("${${module_name}}" SHARED ${${source_files}})
  46. target_link_libraries("${${module_name}}" ${module_name_core})
  47. set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
  48. endif ()
  49. endfunction()
  50. function(build_io_module build_static_flag build_shared_flag module_name module_name_core source_files)
  51. if (${build_static_flag})
  52. add_library("${${module_name}}" STATIC ${${source_files}})
  53. set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
  54. endif ()
  55. if (${build_shared_flag})
  56. add_library("${${module_name}}" SHARED ${${source_files}})
  57. target_link_libraries("${${module_name}}" ${module_name_core})
  58. set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
  59. endif ()
  60. endfunction()
  61. function(build_time_module build_static_flag build_shared_flag build_jni_flag module_name module_name_core source_files source_files_linux source_files_windows source_files_jni)
  62. if (${build_static_flag})
  63. add_library("${${module_name}}" STATIC ${${source_files}} ${${source_files_linux}} ${${source_files_windows}})
  64. set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
  65. endif ()
  66. if (${build_shared_flag})
  67. if (${build_jni_flag})
  68. message("${${module_name}}: building with JNI...")
  69. add_library("${${module_name}}" SHARED ${${source_files}} ${${source_files_linux}} ${${source_files_windows}} ${${source_files_jni}})
  70. target_link_libraries("${${module_name}}" ${module_name_core})
  71. set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
  72. else ()
  73. add_library("${${module_name}}" SHARED ${${source_files}} ${${source_files_linux}} ${${source_files_windows}})
  74. target_link_libraries("${${module_name}}" ${module_name_core})
  75. set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d")
  76. endif ()
  77. endif ()
  78. endfunction()