function(build_boxing_module build_static_flag build_shared_flag module_name module_name_core source_files) include(${CMAKE_CURRENT_LIST_DIR}/cmake/Security.cmake) if (${build_static_flag}) add_library("${${module_name}}" STATIC ${${source_files}}) enable_strict_warnings(module_name) set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d") target_compile_features("${${module_name}}" PUBLIC cxx_std_20) target_sources("${${module_name}}" PUBLIC FILE_SET boxing_modules TYPE CXX_MODULES FILES ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/boxing/Boolean.cppm) endif () if (${build_shared_flag}) add_library("${${module_name}}" SHARED ${${source_files}}) enable_strict_warnings(module_name) target_link_libraries("${${module_name}}" ${${module_name_core}}) set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d") target_compile_features("${${module_name}}" PUBLIC cxx_std_20) target_sources("${${module_name}}" PUBLIC FILE_SET boxing_modules TYPE CXX_MODULES FILES ${CMAKE_CURRENT_SOURCE_DIR}/source/ls-std/boxing/Boolean.cppm) endif () endfunction() function(build_core_module build_static_flag build_shared_flag build_jni_flag module_name source_files jni_source_files) include(${CMAKE_CURRENT_LIST_DIR}/cmake/Security.cmake) if (${build_static_flag}) add_library("${${module_name}}" STATIC ${${source_files}}) enable_strict_warnings(module_name) set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d") target_compile_features("${${module_name}}" PUBLIC cxx_std_20) endif () if (${build_shared_flag}) if (${build_jni_flag}) message("${${module_name}}: building with JNI...") add_library("${${module_name}}" SHARED ${${source_files}} ${${jni_source_files}}) enable_strict_warnings(module_name) set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d") target_compile_features("${${module_name}}" PUBLIC cxx_std_20) else () add_library("${${module_name}}" SHARED ${${source_files}}) enable_strict_warnings(module_name) set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d") target_compile_features("${${module_name}}" PUBLIC cxx_std_20) endif () endif () endfunction() function(build_encoding_module build_static_flag build_shared_flag module_name module_name_core source_files) include(${CMAKE_CURRENT_LIST_DIR}/cmake/Security.cmake) if (${build_static_flag}) add_library("${${module_name}}" STATIC ${${source_files}}) enable_strict_warnings(module_name) set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d") target_compile_features("${${module_name}}" PUBLIC cxx_std_20) endif () if (${build_shared_flag}) add_library("${${module_name}}" SHARED ${${source_files}}) enable_strict_warnings(module_name) target_link_libraries("${${module_name}}" ${${module_name_core}}) set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d") target_compile_features("${${module_name}}" PUBLIC cxx_std_20) endif () endfunction() function(build_event_module build_static_flag build_shared_flag module_name module_name_core source_files) include(${CMAKE_CURRENT_LIST_DIR}/cmake/Security.cmake) if (${build_static_flag}) add_library("${${module_name}}" STATIC ${${source_files}}) enable_strict_warnings(module_name) set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d") target_compile_features("${${module_name}}" PUBLIC cxx_std_20) endif () if (${build_shared_flag}) add_library("${${module_name}}" SHARED ${${source_files}}) enable_strict_warnings(module_name) target_link_libraries("${${module_name}}" ${${module_name_core}}) set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d") target_compile_features("${${module_name}}" PUBLIC cxx_std_20) endif () endfunction() function(build_io_module build_static_flag build_shared_flag module_name module_name_core source_files) include(${CMAKE_CURRENT_LIST_DIR}/cmake/Security.cmake) if (${build_static_flag}) add_library("${${module_name}}" STATIC ${${source_files}}) enable_strict_warnings(module_name) set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d") target_compile_features("${${module_name}}" PUBLIC cxx_std_20) endif () if (${build_shared_flag}) add_library("${${module_name}}" SHARED ${${source_files}}) enable_strict_warnings(module_name) target_link_libraries("${${module_name}}" ${${module_name_core}}) set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d") target_compile_features("${${module_name}}" PUBLIC cxx_std_20) endif () endfunction() 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) include(${CMAKE_CURRENT_LIST_DIR}/cmake/Security.cmake) if (${build_static_flag}) add_library("${${module_name}}" STATIC ${${source_files}} ${${source_files_linux}} ${${source_files_windows}}) enable_strict_warnings(module_name) set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d") target_compile_features("${${module_name}}" PUBLIC cxx_std_20) endif () if (${build_shared_flag}) if (${build_jni_flag}) message("${${module_name}}: building with JNI...") add_library("${${module_name}}" SHARED ${${source_files}} ${${source_files_linux}} ${${source_files_windows}} ${${source_files_jni}}) enable_strict_warnings(module_name) target_link_libraries("${${module_name}}" ${${module_name_core}}) set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d") target_compile_features("${${module_name}}" PUBLIC cxx_std_20) else () add_library("${${module_name}}" SHARED ${${source_files}} ${${source_files_linux}} ${${source_files_windows}}) enable_strict_warnings(module_name) target_link_libraries("${${module_name}}" ${${module_name_core}}) set_target_properties("${${module_name}}" PROPERTIES DEBUG_POSTFIX "-d") target_compile_features("${${module_name}}" PUBLIC cxx_std_20) endif () endif () endfunction()