<commit_before>cmake_minimum_required (VERSION 2.8)
project (logging)

option(OPTION_BUILD_SHARED "Build shared lib" OFF)

find_package (Threads)

### this pigsquill is how the runtime library is set
#foreach(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
#   if(${flag_var} MATCHES "/MD")
#      string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
#   endif(${flag_var} MATCHES "/MD")
#endforeach(flag_var)

if(OPTION_BUILD_SHARED)
	message("Build: shared")
	add_definitions ("-DTRACE_DLL")
else(OPTION_BUILD_SHARED)
	message("Build: static")
	add_definitions ("-DTRACE_STATIC")
endif(OPTION_BUILD_SHARED)

add_definitions ("-DTRACE_CONFIG_INCLUDE=\"${CMAKE_CURRENT_SOURCE_DIR}/config.h\"")
add_definitions ("-DTRACE_LEVELS_INCLUDE=\"${CMAKE_CURRENT_SOURCE_DIR}/levels.h\"")
add_definitions ("-DTRACE_CONTEXTS_INCLUDE=\"${CMAKE_CURRENT_SOURCE_DIR}/contexts.h\"")
add_definitions ("-DTRACE_ENABLED")

include_directories ("../DbgToolkit/")
include_directories ("../DbgToolkit/include")

set(TRACE_FILES
		../DbgToolkit/trace_client/trace.cpp
		../DbgToolkit/trace_client/encoder.cpp
		../DbgToolkit/trace_client/decoder.cpp
		../DbgToolkit/trace_client/socket_win.cpp
)

file (GLOB files "../DbgToolkit/trace_proto/asn.1/*.c") # these files are generated by asn1c from trace_proto.asn1
include_directories(../DbgToolkit/trace_proto/asn.1)
add_definitions ("-DASSUMESTDTYPES") # asn1: use types from cstdint
add_definitions ("-DUSE_CXX_ALLOCATOR") # asn1: use custom c++ allocator for encoder / decoder

add_definitions ("-D_CRT_SECURE_NO_WARNINGS") # msvc shut up pls

message("dbg: ${CMAKE_CXX_FLAGS_DEBUG}")
if(MSVC)
	foreach(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
		 if(${flag_var} MATCHES "/Zi")
				string(REGEX REPLACE "/Zi" "/Z7" ${flag_var} "${${flag_var}}")
		 endif(${flag_var} MATCHES "/Zi")
	endforeach(flag_var)
endif()
### end of pigsquill
message("dbg: ${CMAKE_CXX_FLAGS_DEBUG}")


if(OPTION_BUILD_SHARED)
	add_library (logging SHARED ${TRACE_FILES} ${files})
else(OPTION_BUILD_SHARED)
	add_library (logging STATIC ${TRACE_FILES} ${files})
endif(OPTION_BUILD_SHARED)


set_source_files_properties(${files} PROPERTIES LANGUAGE CXX)

install (TARGETS logging LIBRARY DESTINATION lib  ARCHIVE DESTINATION lib RUNTIME DESTINATION bin)
<commit_msg>* log: install pdb on debug cfg<commit_after>cmake_minimum_required (VERSION 2.8)
project (logging)

option(OPTION_BUILD_SHARED "Build shared lib" OFF)

find_package (Threads)

### this pigsquill is how the runtime library is set
#foreach(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
#   if(${flag_var} MATCHES "/MD")
#      string(REGEX REPLACE "/MD" "/MT" ${flag_var} "${${flag_var}}")
#   endif(${flag_var} MATCHES "/MD")
#endforeach(flag_var)

if(OPTION_BUILD_SHARED)
	message("Build: shared")
	add_definitions ("-DTRACE_DLL")
else(OPTION_BUILD_SHARED)
	message("Build: static")
	add_definitions ("-DTRACE_STATIC")
endif(OPTION_BUILD_SHARED)

add_definitions ("-DTRACE_CONFIG_INCLUDE=\"${CMAKE_CURRENT_SOURCE_DIR}/config.h\"")
add_definitions ("-DTRACE_LEVELS_INCLUDE=\"${CMAKE_CURRENT_SOURCE_DIR}/levels.h\"")
add_definitions ("-DTRACE_CONTEXTS_INCLUDE=\"${CMAKE_CURRENT_SOURCE_DIR}/contexts.h\"")
add_definitions ("-DTRACE_ENABLED")

include_directories ("../DbgToolkit/")
include_directories ("../DbgToolkit/include")

set(TRACE_FILES
		../DbgToolkit/trace_client/trace.cpp
		../DbgToolkit/trace_client/encoder.cpp
		../DbgToolkit/trace_client/decoder.cpp
		../DbgToolkit/trace_client/socket_win.cpp
)

file (GLOB files "../DbgToolkit/trace_proto/asn.1/*.c") # these files are generated by asn1c from trace_proto.asn1
include_directories(../DbgToolkit/trace_proto/asn.1)
add_definitions ("-DASSUMESTDTYPES") # asn1: use types from cstdint
add_definitions ("-DUSE_CXX_ALLOCATOR") # asn1: use custom c++ allocator for encoder / decoder

add_definitions ("-D_CRT_SECURE_NO_WARNINGS") # msvc shut up pls

message("dbg: ${CMAKE_CXX_FLAGS_DEBUG}")
if(MSVC)
	foreach(flag_var CMAKE_CXX_FLAGS CMAKE_CXX_FLAGS_DEBUG CMAKE_CXX_FLAGS_RELEASE CMAKE_CXX_FLAGS_MINSIZEREL CMAKE_CXX_FLAGS_RELWITHDEBINFO)
		 if(${flag_var} MATCHES "/Zi")
				string(REGEX REPLACE "/Zi" "/Z7" ${flag_var} "${${flag_var}}")
		 endif(${flag_var} MATCHES "/Zi")
	endforeach(flag_var)
endif()
### end of pigsquill
message("dbg: ${CMAKE_CXX_FLAGS_DEBUG}")


if(OPTION_BUILD_SHARED)
	add_library (logging SHARED ${TRACE_FILES} ${files})
else(OPTION_BUILD_SHARED)
	add_library (logging STATIC ${TRACE_FILES} ${files})
endif(OPTION_BUILD_SHARED)

set_source_files_properties(${files} PROPERTIES LANGUAGE CXX)

install (TARGETS logging LIBRARY DESTINATION lib  ARCHIVE DESTINATION lib RUNTIME DESTINATION bin)

if(MSVC)
	install(FILES ${PROJECT_BINARY_DIR}/Debug/logging.pdb
		DESTINATION bin
		CONFIGURATIONS Debug
		)
endif(MSVC)

{'fraction_non_alphanumeric': 0.12855721393034825, 'fraction_numerical': 0.003582089552238806, 'mean_word_length': 7.003184713375796, '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': '645725', 'n_tokens_mistral': 2032, 'n_tokens_neox': 1897, 'n_words': 336}