<commit_before>cmake_minimum_required(VERSION 3.7.1)
project(nany-bootstrap)

include(CMakeParseArguments)

# for information related to nany, see settings.txt


include("cmake/messages.cmake")

nmessage("nany c++/bootstrap")
nmessage("")
nmessage("cmake ${CMAKE_VERSION} in '${CMAKE_SYSTEM}' ${CMAKE_SYSTEM_PROCESSOR}")
nmessage("  from '${CMAKE_COMMAND}', '${CMAKE_ROOT}'")
nmessage("current listdir: ${CMAKE_CURRENT_LIST_DIR}")
nmessage("")

if ("${CMAKE_BUILD_TYPE}" STREQUAL "" OR (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "release" AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "debug"))
	# release by default
	set(CMAKE_BUILD_TYPE "debug")
endif()
nmessage("configuration: ${CMAKE_BUILD_TYPE}")

#set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(CMAKE_DISABLE_SOURCE_CHANGES  ON)
set(CMAKE_MACOSX_RPATH 1)

include("cmake/utils.cmake")
include("cmake/build-settings.cmake")



#
# Architecture
#
include(CheckSymbolExists)
if(WIN32)
	check_symbol_exists("_M_AMD64" "" RTC_ARCH_X64)
	if(NOT RTC_ARCH_X64)
		check_symbol_exists("_M_IX86" "" RTC_ARCH_X86)
	endif(NOT RTC_ARCH_X64)
	# add check for arm here
	# see http://msdn.microsoft.com/en-us/library/b0084kay.aspx
else(WIN32)
	check_symbol_exists("__i386__" "" RTC_ARCH_X86)
	check_symbol_exists("__x86_64__" "" RTC_ARCH_X64)
	check_symbol_exists("__arm__" "" RTC_ARCH_ARM)
endif(WIN32)


#
# Underlying platform
#
set(nany_os_debian 0)
if (NOT WIN32)
	set(nany_os_windows 0)
	if (EXISTS "/etc/debian_version")
		set(nany_os_debian 1)
		system(nany_arch dpkg --print-architecture)
	endif()
else()
	set(nany_os_windows 1)
endif()


#
# -- Facilities for YCM - (vim/YouCompleteMe)
#
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
set(nany_compilation_database_folder "${CMAKE_CURRENT_BINARY_DIR}")
configure_file("cmake/you-complete-me.vim.template.cmake" ".ycm_extra_conf.py")


#
# -- Yuni - (aka libyuni)
#
configure_file("cmake/yuni-profilebuild-template.cmake" "ext/yuni/src/ProfileBuild.cmake")

if (NOT EXISTS "ext/yuni/src/CMakeLists.txt")
	nerror("The extenal library 'yuni' is not present (submodule)")
	message(FATAL_ERROR "aborting")
endif()
add_subdirectory("ext/yuni/src")
include_directories("ext/yuni/src")

set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")


if (MSVC)
	# DynCALL does not like SAFESEH on Windows x86
	set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
endif()


#
# -- dyncall - (Generic Dynamic FFI package / http://www.dyncall.org/)<commit_msg>cmake: fix folder existence check when outside of the source directory<commit_after>cmake_minimum_required(VERSION 3.7.1)
project(nany-bootstrap)

include(CMakeParseArguments)

# for information related to nany, see settings.txt


include("cmake/messages.cmake")

nmessage("nany c++/bootstrap")
nmessage("")
nmessage("cmake ${CMAKE_VERSION} in '${CMAKE_SYSTEM}' ${CMAKE_SYSTEM_PROCESSOR}")
nmessage("  from '${CMAKE_COMMAND}', '${CMAKE_ROOT}'")
nmessage("current listdir: ${CMAKE_CURRENT_LIST_DIR}")
nmessage("")

if ("${CMAKE_BUILD_TYPE}" STREQUAL "" OR (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "release" AND NOT "${CMAKE_BUILD_TYPE}" STREQUAL "debug"))
	# release by default
	set(CMAKE_BUILD_TYPE "debug")
endif()
nmessage("configuration: ${CMAKE_BUILD_TYPE}")

#set(CMAKE_DISABLE_IN_SOURCE_BUILD ON)
set(CMAKE_DISABLE_SOURCE_CHANGES  ON)
set(CMAKE_MACOSX_RPATH 1)

include("cmake/utils.cmake")
include("cmake/build-settings.cmake")



#
# Architecture
#
include(CheckSymbolExists)
if(WIN32)
	check_symbol_exists("_M_AMD64" "" RTC_ARCH_X64)
	if(NOT RTC_ARCH_X64)
		check_symbol_exists("_M_IX86" "" RTC_ARCH_X86)
	endif(NOT RTC_ARCH_X64)
	# add check for arm here
	# see http://msdn.microsoft.com/en-us/library/b0084kay.aspx
else(WIN32)
	check_symbol_exists("__i386__" "" RTC_ARCH_X86)
	check_symbol_exists("__x86_64__" "" RTC_ARCH_X64)
	check_symbol_exists("__arm__" "" RTC_ARCH_ARM)
endif(WIN32)


#
# Underlying platform
#
set(nany_os_debian 0)
if (NOT WIN32)
	set(nany_os_windows 0)
	if (EXISTS "/etc/debian_version")
		set(nany_os_debian 1)
		system(nany_arch dpkg --print-architecture)
	endif()
else()
	set(nany_os_windows 1)
endif()


#
# -- Facilities for YCM - (vim/YouCompleteMe)
#
set(CMAKE_EXPORT_COMPILE_COMMANDS 1)
set(nany_compilation_database_folder "${CMAKE_CURRENT_BINARY_DIR}")
configure_file("cmake/you-complete-me.vim.template.cmake" ".ycm_extra_conf.py")


#
# -- Yuni - (aka libyuni)
#
configure_file("cmake/yuni-profilebuild-template.cmake" "ext/yuni/src/ProfileBuild.cmake")

if (NOT EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/ext/yuni/src/CMakeLists.txt")
	nerror("The extenal library 'yuni' is not present (submodule)")
	message(FATAL_ERROR "aborting")
endif()
add_subdirectory("ext/yuni/src")
include_directories("ext/yuni/src")

set(EXECUTABLE_OUTPUT_PATH "${CMAKE_CURRENT_BINARY_DIR}")


if (MSVC)
	# DynCALL does not like SAFESEH on Windows x86
	set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
endif()


#
# -- dyncall - (Generic Dynamic FFI package / http://www.dyncall.org/)
{'fraction_non_alphanumeric': 0.1397459165154265, 'fraction_numerical': 0.018552127445049405, 'mean_word_length': 6.948717948717949, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, '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': '1324997', 'n_tokens_mistral': 2089, 'n_tokens_neox': 1937, 'n_words': 327}