<commit_before>OPTION(BUILD_SYSV_BB
  "SysV API for Blackboards" ON)
OPTION(BUILD_POSIX_BB
  "Posix API for Blackboards" OFF)

# FIXME: temporary hack for Rtems
IF(BUILD_RTEMS)
	SET(BUILD_POSIX_BB ON)
	SET(BUILD_SYSV_BB OFF)
ENDIF(BUILD_RTEMS)

IF(BUILD_POSIX_BB)
	SET(POSIX_BB_SRC bb_core_posix.c)
	SET(POSIX_BB_INC bb_core_posix.h)
	ADD_DEFINITIONS(-DUSE_POSIX_BB)
ELSE(BUILD_POSIX_BB)
	SET(POSIX_BB_SRC "")
	SET(POSIX_BB_INC "")
ENDIF(BUILD_POSIX_BB)

IF(BUILD_SYSV_BB)
	SET(SYSV_BB_SRC bb_core_sysv.c)
	SET(SYSV_BB_INC bb_core_sysv.h)
ELSE(BUILD_SYSV_BB)
	SET(SYSV_BB_SRC "")
	SET(SYSV_BB_INC "")
ENDIF(BUILD_SYSV_BB)

SET(_SRC
  bb_alias
  bb_core bb_simple
  bb_sha1 bb_tools 
  ${SYSV_BB_SRC}
  ${POSIX_BB_SRC})

SET(LIB_VARNAME_SARRAY_SRC bb_varname_sarray.c)

IF(ZLIB_FOUND)
SET(LIB_VARNAME_ZIP_SRC ${_SRC} bb_varname_zip.c)
ENDIF(ZLIB_FOUND)

# FIXME: this includes sys/ipc.h directly, needs cleanup
IF(NOT BUILD_RTEMS)
  SET(_SRC ${_SRC} bb_utils.c)
ENDIF(NOT BUILD_RTEMS)

#
# bb_core_k kernel device API on works on linux
#
IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
  SET(_SRC
    ${_SRC}
    bb_core_k.c)
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux")

SET(BB_INCLUDE_FILES
  bb_core.h
  bb_simple.h
  bb_alias.h
  bb_tools.h
  bb_utils.h
  bb_sha1.h
  ${SYSV_BB_INC}
  ${POSIX_BB_INC})

IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
  SET(BB_INCLUDE_FILES 
    ${BB_INCLUDE_FILES}
    bb_core_k.h)
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux")

TSP_XINCLUDE(${BB_INCLUDE_FILES})

INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/util/libbb)<commit_msg>sys/ipc.h issue resolved: include bb_utils.c in libbb.a under rtems too<commit_after>OPTION(BUILD_SYSV_BB
  "SysV API for Blackboards" ON)
OPTION(BUILD_POSIX_BB
  "Posix API for Blackboards" OFF)

# FIXME: temporary hack for Rtems
IF(BUILD_RTEMS)
	SET(BUILD_POSIX_BB ON)
	SET(BUILD_SYSV_BB OFF)
ENDIF(BUILD_RTEMS)

IF(BUILD_POSIX_BB)
	SET(POSIX_BB_SRC bb_core_posix.c)
	SET(POSIX_BB_INC bb_core_posix.h)
	ADD_DEFINITIONS(-DUSE_POSIX_BB)
ELSE(BUILD_POSIX_BB)
	SET(POSIX_BB_SRC "")
	SET(POSIX_BB_INC "")
ENDIF(BUILD_POSIX_BB)

IF(BUILD_SYSV_BB)
	SET(SYSV_BB_SRC bb_core_sysv.c)
	SET(SYSV_BB_INC bb_core_sysv.h)
ELSE(BUILD_SYSV_BB)
	SET(SYSV_BB_SRC "")
	SET(SYSV_BB_INC "")
ENDIF(BUILD_SYSV_BB)

SET(_SRC
  bb_alias
  bb_core bb_simple
  bb_sha1 bb_tools 
  bb_utils
  ${SYSV_BB_SRC}
  ${POSIX_BB_SRC})

SET(LIB_VARNAME_SARRAY_SRC bb_varname_sarray.c)

IF(ZLIB_FOUND)
SET(LIB_VARNAME_ZIP_SRC ${_SRC} bb_varname_zip.c)
ENDIF(ZLIB_FOUND)

#
# bb_core_k kernel device API on works on linux
#
IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
  SET(_SRC
    ${_SRC}
    bb_core_k.c)
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux")

SET(BB_INCLUDE_FILES
  bb_core.h
  bb_simple.h
  bb_alias.h
  bb_tools.h
  bb_utils.h
  bb_sha1.h
  ${SYSV_BB_INC}
  ${POSIX_BB_INC})

IF (CMAKE_SYSTEM_NAME MATCHES "Linux")
  SET(BB_INCLUDE_FILES 
    ${BB_INCLUDE_FILES}
    bb_core_k.h)
ENDIF (CMAKE_SYSTEM_NAME MATCHES "Linux")

TSP_XINCLUDE(${BB_INCLUDE_FILES})

INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/util/libbb)
{'fraction_non_alphanumeric': 0.10122394971882236, 'fraction_numerical': 0.0013231888852133643, 'mean_word_length': 6.0, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2464000', 'n_tokens_mistral': 1572, 'n_tokens_neox': 1411, 'n_words': 219}