<commit_before>cmake_minimum_required(VERSION 3.2)
project(JMA)
set(CMAKE_CXX_STANDARD 14)

# Version Information
set(JMA_VERSION_MAJOR 0)
set(JMA_VERSION_MINOR 1)
set(JMA_VERSION_PATCH 0)
set(JMA_VERSION_EXTRA 0)
set(JMA_VERSION "${GLFW_VERSION_MAJOR}.${GLFW_VERSION_MINOR}")
set(JMA_VERSION_FULL "${GLFW_VERSION}.${GLFW_VERSION_PATCH}${GLFW_VERSION_EXTRA}")
 
# Option Flags
if(MSVC)
	option(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC runtime library DLL" ON)
endif()

# GLFW Library
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "Build the GLFW example programs")
set(GLFW_BUILD_TESTS OFF CACHE BOOL "Build the GLFW test programs")
set(GLFW_BUILD_DOCS OFF CACHE BOOL "Build the GLFW documentation")
set(GLFW_INSTALL OFF CACHE BOOL "Generate installation target")
add_subdirectory(External/GLFW)
include_directories(External/GLFW/include)

# MSVC Configuration
if(MSVC)
	add_definitions(-D_CRT_SECURE_NO_WARNINGS)
	if (NOT USE_MSVC_RUNTIME_LIBRARY_DLL)
		foreach (flag CMAKE_C_FLAGS
				CMAKE_C_FLAGS_DEBUG
				CMAKE_C_FLAGS_RELEASE
				CMAKE_C_FLAGS_MINSIZEREL
				CMAKE_C_FLAGS_RELWITHDEBINFO)
			if (${flag} MATCHES "/MD")
				string(REGEX REPLACE "/MD" "/MT" ${flag} "${${flag}}")
			endif()
			if (${flag} MATCHES "/MDd")
				string(REGEX REPLACE "/MDd" "/MTd" ${flag} "${${flag}}")
			endif()
		endforeach()
	endif()

endif()

# MINGW/GCC Configuration
if(MINGW)
	include(CheckCCompilerFlag)
    set(CMAKE_REQUIRED_FLAGS "-Wl,--nxcompat")
    check_c_compiler_flag("" _JMA_HAS_DEP)
    if (_JMA_HAS_DEP)
        set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--nxcompat ${CMAKE_SHARED_LINKER_FLAGS}")
    endif()
    set(CMAKE_REQUIRED_FLAGS "-Wl,--dynamicbase")
    check_c_compiler_flag("" _JMA_HAS_ASLR)
    if (_JMA_HAS_ASLR)
        set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--dynamicbase ${CMAKE_SHARED_LINKER_FLAGS}")
    endif()
    set(CMAKE_REQUIRED_FLAGS "-Wl,--high-entropy-va")
    check_c_compiler_flag("" _JMA_HAS_64ASLR)
    if (_JMA_HAS_64ASLR)
        set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--high-entropy-va ${CMAKE_SHARED_LINKER_FLAGS}")
    endif()
endif()

# Configure JMA-Version Header
configure_file (
	"${PROJECT_SOURCE_DIR}/JMA-Version.h.in"
	"${PROJECT_BINARY_DIR}/JMA-Version.h"
)
include_directories("${PROJECT_BINARY_DIR}")

# JMA-Client
add_executable(JMA-Client
		Client/JMA-Client.rc
		Client/Main.cpp)
target_link_libraries(JMA-Client glfw ${GLFW_LIBRARIES})
if(UNIX)
	set_target_properties(JMA-Client PROPERTIES
			POSITION_INDEPENDENT_CODE ON)
endif()
if(MSVC)
	set_target_properties(JMA-Client PROPERTIES
			LINK_FLAGS "/ENTRY:mainCRTStartup")
endif()<commit_msg>Remove UNIX check for POSITION_INDEPENDENT_CODE<commit_after>cmake_minimum_required(VERSION 3.2)
project(JMA)
set(CMAKE_CXX_STANDARD 14)

# Version Information
set(JMA_VERSION_MAJOR 0)
set(JMA_VERSION_MINOR 1)
set(JMA_VERSION_PATCH 0)
set(JMA_VERSION_EXTRA 0)
set(JMA_VERSION "${GLFW_VERSION_MAJOR}.${GLFW_VERSION_MINOR}")
set(JMA_VERSION_FULL "${GLFW_VERSION}.${GLFW_VERSION_PATCH}${GLFW_VERSION_EXTRA}")
 
# Option Flags
if(MSVC)
	option(USE_MSVC_RUNTIME_LIBRARY_DLL "Use MSVC runtime library DLL" ON)
endif()

# GLFW Library
set(GLFW_BUILD_EXAMPLES OFF CACHE BOOL "Build the GLFW example programs")
set(GLFW_BUILD_TESTS OFF CACHE BOOL "Build the GLFW test programs")
set(GLFW_BUILD_DOCS OFF CACHE BOOL "Build the GLFW documentation")
set(GLFW_INSTALL OFF CACHE BOOL "Generate installation target")
add_subdirectory(External/GLFW)
include_directories(External/GLFW/include)

# MSVC Configuration
if(MSVC)
	add_definitions(-D_CRT_SECURE_NO_WARNINGS)
	if (NOT USE_MSVC_RUNTIME_LIBRARY_DLL)
		foreach (flag CMAKE_C_FLAGS
				CMAKE_C_FLAGS_DEBUG
				CMAKE_C_FLAGS_RELEASE
				CMAKE_C_FLAGS_MINSIZEREL
				CMAKE_C_FLAGS_RELWITHDEBINFO)
			if (${flag} MATCHES "/MD")
				string(REGEX REPLACE "/MD" "/MT" ${flag} "${${flag}}")
			endif()
			if (${flag} MATCHES "/MDd")
				string(REGEX REPLACE "/MDd" "/MTd" ${flag} "${${flag}}")
			endif()
		endforeach()
	endif()

endif()

# MINGW/GCC Configuration
if(MINGW)
	include(CheckCCompilerFlag)
    set(CMAKE_REQUIRED_FLAGS "-Wl,--nxcompat")
    check_c_compiler_flag("" _JMA_HAS_DEP)
    if (_JMA_HAS_DEP)
        set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--nxcompat ${CMAKE_SHARED_LINKER_FLAGS}")
    endif()
    set(CMAKE_REQUIRED_FLAGS "-Wl,--dynamicbase")
    check_c_compiler_flag("" _JMA_HAS_ASLR)
    if (_JMA_HAS_ASLR)
        set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--dynamicbase ${CMAKE_SHARED_LINKER_FLAGS}")
    endif()
    set(CMAKE_REQUIRED_FLAGS "-Wl,--high-entropy-va")
    check_c_compiler_flag("" _JMA_HAS_64ASLR)
    if (_JMA_HAS_64ASLR)
        set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--high-entropy-va ${CMAKE_SHARED_LINKER_FLAGS}")
    endif()
endif()

# Configure JMA-Version Header
configure_file (
	"${PROJECT_SOURCE_DIR}/JMA-Version.h.in"
	"${PROJECT_BINARY_DIR}/JMA-Version.h"
)
include_directories("${PROJECT_BINARY_DIR}")

# JMA-Client
add_executable(JMA-Client
		Client/JMA-Client.rc
		Client/Main.cpp)
target_link_libraries(JMA-Client glfw ${GLFW_LIBRARIES})
set_target_properties(JMA-Client PROPERTIES
		POSITION_INDEPENDENT_CODE ON)
if(MSVC)
	set_target_properties(JMA-Client PROPERTIES
			LINK_FLAGS "/ENTRY:mainCRTStartup")
endif()
{'fraction_non_alphanumeric': 0.11771539206195547, 'fraction_numerical': 0.004646660212971926, 'mean_word_length': 5.97165991902834, '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': '5408852', 'n_tokens_mistral': 2218, 'n_tokens_neox': 2045, 'n_words': 335}