<commit_before>cmake_minimum_required(VERSION 2.8)

project(psychec)

# Directory setup.
set(PSYCHE_DIR ${PROJECT_SOURCE_DIR})
set(SOLVER_DIR ${PROJECT_SOURCE_DIR}/solver)

# Loading and rpath.
set(CMAKE_MACOSX_RPATH TRUE)
set(CMAKE_INSTALL_RPATH "\$ORIGIN;@executable_path;@loader_path")

# Build the frontend.
add_subdirectory(frontend)

# Build the stdlib plugin.
add_subdirectory(stdlib-support)

# Build the solver.
execute_process(COMMAND
                stack install --local-bin-path ${PSYCHE_DIR}
                WORKING_DIRECTORY ${SOLVER_DIR}
		RESULT_VARIABLE SOLVER_RV
		OUTPUT_VARIABLE SOLVER_OV
		ERROR_VARIABLE  SOLVER_EV
		OUTPUT_STRIP_TRAILING_WHITESPACE
		ERROR_STRIP_TRAILING_WHITESPACE)
message("-- Solver build: ${SOLVER_RV} ${SOLVER_OV} ${SOLVER_EV}")

set(PSYCHEC_CXX_FLAGS)
set(PSYCHEC_CXX_FLAGS "${PSYCHEC_CXX_FLAGS} -std=c++14 -g")
set(PSYCHEC_CXX_FLAGS "${PSYCHEC_CXX_FLAGS} -Wall -Wsign-compare -Wno-inconsistent-missing-override")
set(PSYCHEC_CXX_FLAGS "${PSYCHEC_CXX_FLAGS} -DCPLUSPLUS_WITHOUT_QT")

set(PSYCHEC_SOURCES
    ${PROJECT_SOURCE_DIR}/Main.cpp

    # Data structures
    ${PROJECT_SOURCE_DIR}/adt/Substitution.h
    ${PROJECT_SOURCE_DIR}/adt/Substitution.cpp
    ${PROJECT_SOURCE_DIR}/adt/VersionedMap.h

    # Constraint generator
    ${PROJECT_SOURCE_DIR}/generator/ConstraintGenerator.h
    ${PROJECT_SOURCE_DIR}/generator/ConstraintGenerator.cpp
    ${PROJECT_SOURCE_DIR}/generator/ConstraintWriter.h
    ${PROJECT_SOURCE_DIR}/generator/ConstraintWriter.cpp
    # ${PROJECT_SOURCE_DIR}/generator/ConstraintSyntax.h
    # ${PROJECT_SOURCE_DIR}/generator/CSyntax.h
    ${PROJECT_SOURCE_DIR}/generator/Debug.h
    ${PROJECT_SOURCE_DIR}/generator/Debug.cpp
    ${PROJECT_SOURCE_DIR}/generator/DomainLattice.h
    ${PROJECT_SOURCE_DIR}/generator/DomainLattice.cpp
    ${PROJECT_SOURCE_DIR}/generator/FreshVarSupply.h
    ${PROJECT_SOURCE_DIR}/generator/FreshVarSupply.cpp<commit_msg>Specify stdlib for clang<commit_after>cmake_minimum_required(VERSION 2.8)

project(psychec)

# Directory setup.
set(PSYCHE_DIR ${PROJECT_SOURCE_DIR})
set(SOLVER_DIR ${PROJECT_SOURCE_DIR}/solver)

# Loading and rpath.
set(CMAKE_MACOSX_RPATH TRUE)
set(CMAKE_INSTALL_RPATH "\$ORIGIN;@executable_path;@loader_path")

# Build the frontend.
add_subdirectory(frontend)

# Build the stdlib plugin.
add_subdirectory(stdlib-support)

# Build the solver.
execute_process(COMMAND
                stack install --local-bin-path ${PSYCHE_DIR}
                WORKING_DIRECTORY ${SOLVER_DIR}
		RESULT_VARIABLE SOLVER_RV
		OUTPUT_VARIABLE SOLVER_OV
		ERROR_VARIABLE  SOLVER_EV
		OUTPUT_STRIP_TRAILING_WHITESPACE
		ERROR_STRIP_TRAILING_WHITESPACE)
message("-- Solver build: ${SOLVER_RV} ${SOLVER_OV} ${SOLVER_EV}")

# C++ compiler flags.
set(PSYCHEC_CXX_FLAGS)
set(PSYCHEC_CXX_FLAGS "${PSYCHEC_CXX_FLAGS} -std=c++14 -g")
set(PSYCHEC_CXX_FLAGS "${PSYCHEC_CXX_FLAGS} -Wall \
                                            -Wsign-compare \
                                            -Wno-inconsistent-missing-override")
set(PSYCHEC_CXX_FLAGS "${PSYCHEC_CXX_FLAGS} -DCPLUSPLUS_WITHOUT_QT")

if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
   set(PSYCHEC_CXX_FLAGS "${PSYCHEC_CXX_FLAGS} -stdlib=libc++")
endif()

# Project sources.
set(PSYCHEC_SOURCES
    ${PROJECT_SOURCE_DIR}/Main.cpp

    # Data structures
    ${PROJECT_SOURCE_DIR}/adt/Substitution.h
    ${PROJECT_SOURCE_DIR}/adt/Substitution.cpp
    ${PROJECT_SOURCE_DIR}/adt/VersionedMap.h

    # Constraint generator
    ${PROJECT_SOURCE_DIR}/generator/ConstraintGenerator.h
    ${PROJECT_SOURCE_DIR}/generator/ConstraintGenerator.cpp
    ${PROJECT_SOURCE_DIR}/generator/ConstraintWriter.h
    ${PROJECT_SOURCE_DIR}/generator/ConstraintWriter.cpp
    # ${PROJECT_SOURCE_DIR}/generator/ConstraintSyntax.h
    # ${PROJECT_SOURCE_DIR}/generator/CSyntax.h
    ${PROJECT_SOURCE_DIR}/generator/Debug.h
    ${PROJECT_SOURCE_DIR}/generator/Debug.cpp
    ${PROJECT_SOURCE_DIR}/generator/DomainLattice.h
    ${PROJECT_SOURCE_DIR}/generator/DomainLattice.cpp
    ${PROJECT_SOURCE_DIR}/generator/FreshVarSupply.h
    ${PROJECT_SOURCE_DIR}/generator/FreshVarSupply.cpp
{'fraction_non_alphanumeric': 0.10829885616938428, 'fraction_numerical': 0.0019469457288878072, 'mean_word_length': 4.922190201729107, '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': 4, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1945466', 'n_tokens_mistral': 1570, 'n_tokens_neox': 1454, 'n_words': 181}