<commit_before># libjsonnet

# Remember to update Bazel and Makefile builds when updating this list! 
set(LIBJSONNET_HEADERS
    ast.h
    desugarer.h
    formatter.h
    lexer.h
    ../include/libjsonnet.h
    parser.h
    pass.h
    state.h
    static_analysis.h
    static_error.h
    std.jsonnet.h
    string_utils.h
    unicode.h
    vm.h)

set(LIBJSONNET_SOURCE
    desugarer.cpp
    formatter.cpp
    lexer.cpp
    libjsonnet.cpp
    parser.cpp
    pass.cpp
    static_analysis.cpp
    string_utils.cpp
    vm.cpp)

add_library(libjsonnet SHARED ${LIBJSONNET_HEADERS} ${LIBJSONNET_SOURCE})
add_dependencies(libjsonnet md5 stdlib)
target_link_libraries(libjsonnet md5)

# CMake prepends CMAKE_SHARED_LIBRARY_PREFIX to shared libraries, so without
# this step the output would be |liblibjsonnet|.
set_target_properties(libjsonnet PROPERTIES OUTPUT_NAME jsonnet)
install(TARGETS libjsonnet DESTINATION lib)

# Static library for jsonnet command-line tool.
add_library(libjsonnet_static STATIC ${LIBJSONNET_SOURCE})
add_dependencies(libjsonnet_static md5)
target_link_libraries(libjsonnet_static md5)
set_target_properties(libjsonnet_static PROPERTIES OUTPUT_NAME jsonnet)

# Tests

function(add_test_executable test_name)
    if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/${test_name}.cpp)
        set(TEST_EXT cpp)
    else()
        set(TEST_EXT c)
    endif()
    add_executable(${test_name} ${test_name}.${TEST_EXT})

    add_dependencies(${test_name} libjsonnet_static gtest_main)
    target_link_libraries(
        ${test_name} gtest gtest_main libjsonnet_static)<commit_msg>Add proper dependency on stdlib<commit_after># libjsonnet

# Remember to update Bazel and Makefile builds when updating this list! 
set(LIBJSONNET_HEADERS
    ast.h
    desugarer.h
    formatter.h
    lexer.h
    ../include/libjsonnet.h
    parser.h
    pass.h
    state.h
    static_analysis.h
    static_error.h
    string_utils.h
    unicode.h
    vm.h)

set(LIBJSONNET_SOURCE
    desugarer.cpp
    formatter.cpp
    lexer.cpp
    libjsonnet.cpp
    parser.cpp
    pass.cpp
    static_analysis.cpp
    string_utils.cpp
    vm.cpp)

add_library(libjsonnet SHARED ${LIBJSONNET_HEADERS} ${LIBJSONNET_SOURCE})
add_dependencies(libjsonnet md5 stdlib)
target_link_libraries(libjsonnet md5)

# CMake prepends CMAKE_SHARED_LIBRARY_PREFIX to shared libraries, so without
# this step the output would be |liblibjsonnet|.
set_target_properties(libjsonnet PROPERTIES OUTPUT_NAME jsonnet)
install(TARGETS libjsonnet DESTINATION lib)

# Static library for jsonnet command-line tool.
add_library(libjsonnet_static STATIC ${LIBJSONNET_SOURCE})
add_dependencies(libjsonnet_static md5 stdlib)
target_link_libraries(libjsonnet_static md5)
set_target_properties(libjsonnet_static PROPERTIES OUTPUT_NAME jsonnet)

# Tests

function(add_test_executable test_name)
    if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/${test_name}.cpp)
        set(TEST_EXT cpp)
    else()
        set(TEST_EXT c)
    endif()
    add_executable(${test_name} ${test_name}.${TEST_EXT})

    add_dependencies(${test_name} libjsonnet_static gtest_main)
    target_link_libraries(
        ${test_name} gtest gtest_main libjsonnet_static)
{'fraction_non_alphanumeric': 0.07344096232985121, 'fraction_numerical': 0.0025324469768914213, 'mean_word_length': 4.346869712351946, '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': '7348409', 'n_tokens_mistral': 1114, 'n_tokens_neox': 1080, 'n_words': 221}