<commit_before># required CapnProto
set(CAPNPROTO_PATH ${SRC_BACKENDS}/SynchroTraceGen)
execute_process(
	COMMAND git submodule update --init ${CAPNPROTO_PATH}/capnproto
	WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})

include(ExternalProject)
ExternalProject_Add(capnproto
	PREFIX capnproto
# -- Download step ------------
# -- Update step --------------
# -- Configure step -----------
	SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/capnproto/c++
	CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${THIRD_PARTY}/capnproto
	-DBUILD_TOOLS=OFF
	-DBUILD_TESTING=OFF
# -- Build step ---------------
# -- Install step -------------
	)
include_directories(${THIRD_PARTY}/capnproto/include)

# SynchroTraceGen Backend
set(SOURCES
	EventHandlers.cpp
	ThreadContext.cpp
	TextLogger.cpp
	CapnLogger.cpp
	STEvent.cpp
	STEventTraceCompressed.capnp.c++
	STEventTraceUncompressed.capnp.c++
	${THIRD_PARTY}/zlib/contrib/iostream3/zfstream.cc)
add_library(STGenCore STATIC ${SOURCES})

# Link CapnProto w/ SynchroTraceGen
set(KJ_LIB ${THIRD_PARTY}/capnproto/lib64/libkj.a)
set(CAPNP_LIB ${THIRD_PARTY}/capnproto/lib64/libcapnp.a)
set(STGEN_LIB ${CMAKE_CURRENT_BINARY_DIR}/libSTGen.a)
set(STGEN_LIB ${STGEN_LIB} PARENT_SCOPE) 
add_custom_target(STGen ALL
	COMMAND ar -x $<TARGET_FILE:STGenCore>
	COMMAND ar -x ${KJ_LIB}
	COMMAND ar -x ${CAPNP_LIB}
	COMMAND ar -qc ${STGEN_LIB} *.o)
add_dependencies(STGenCore capnproto)
add_dependencies(STGen STGenCore)<commit_msg>Fix lib dir in STGen build<commit_after># required CapnProto
include(GNUInstallDirs)
set(CAPNPROTO_PATH ${SRC_BACKENDS}/SynchroTraceGen)
execute_process(
	COMMAND git submodule update --init ${CAPNPROTO_PATH}/capnproto
	WORKING_DIRECTORY ${CMAKE_SOURCE_DIR})

include(ExternalProject)
ExternalProject_Add(capnproto
	PREFIX capnproto
# -- Download step ------------
# -- Update step --------------
# -- Configure step -----------
	SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/capnproto/c++
	CMAKE_ARGS -DCMAKE_INSTALL_PREFIX:PATH=${THIRD_PARTY}/capnproto
	-DBUILD_TOOLS=OFF
	-DBUILD_TESTING=OFF
# -- Build step ---------------
# -- Install step -------------
	)
include_directories(${THIRD_PARTY}/capnproto/include)

# SynchroTraceGen Backend
set(SOURCES
	EventHandlers.cpp
	ThreadContext.cpp
	TextLogger.cpp
	CapnLogger.cpp
	STEvent.cpp
	STEventTraceCompressed.capnp.c++
	STEventTraceUncompressed.capnp.c++
	${THIRD_PARTY}/zlib/contrib/iostream3/zfstream.cc)
add_library(STGenCore STATIC ${SOURCES})

# Link CapnProto w/ SynchroTraceGen
set(KJ_LIB ${THIRD_PARTY}/capnproto/${CMAKE_INSTALL_LIBDIR}/libkj.a)
set(CAPNP_LIB ${THIRD_PARTY}/capnproto/${CMAKE_INSTALL_LIBDIR}/libcapnp.a)
set(STGEN_LIB ${CMAKE_CURRENT_BINARY_DIR}/libSTGen.a)
set(STGEN_LIB ${STGEN_LIB} PARENT_SCOPE) 
add_custom_target(STGen ALL
	COMMAND ar -x $<TARGET_FILE:STGenCore>
	COMMAND ar -x ${KJ_LIB}
	COMMAND ar -x ${CAPNP_LIB}
	COMMAND ar -qc ${STGEN_LIB} *.o)
add_dependencies(STGenCore capnproto)
add_dependencies(STGen STGenCore)
{'fraction_non_alphanumeric': 0.15063334474495035, 'fraction_numerical': 0.0020540910647038686, 'mean_word_length': 4.926977687626775, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3389988', 'n_tokens_mistral': 1130, 'n_tokens_neox': 1077, 'n_words': 175}