<commit_before># 
# Copyright (c) 2009, Asmodehn's Corp.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without 
# modification, are permitted provided that the following conditions are met:
# 
#     * Redistributions of source code must retain the above copyright notice, 
#	    this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above copyright
#		notice, this list of conditions and the following disclaimer in the 
#	    documentation and/or other materials provided with the distribution.
#     * Neither the name of the Asmodehn's Corp. nor the names of its 
#	    contributors may be used to endorse or promote products derived
#	    from this software without specific prior written permission.
# 
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
#

#
# Compiler Specific rules
# All modifications for Flags should be here
# These macros exists to use more pedantic rules to build software. Thus improving the quality of working code
#

#debug
message ( STATUS "== Loading WkCompilerSetup.cmake ... ")

if ( CMAKE_BACKWARDS_COMPATIBILITY LESS 2.6 )
	message ( FATAL_ERROR " CMAKE MINIMUM BACKWARD COMPATIBILITY REQUIRED : 2.6 !" )
endif( CMAKE_BACKWARDS_COMPATIBILITY LESS 2.6 )

# Macros to redefine default options for build type

# Usage : WkSetCFlags( "-new -flags" )
macro(WkSetCFlags)
	SET(${PROJECT_NAME}_C_FLAGS "${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C Compiler." )
	MARK_AS_ADVANCED(FORCE ${PROJECT_NAME}_C_FLAGS )
endmacro(WkSetCFlags )

# Usage : WkAddCFlags( "-new -flags" )
macro(WkAddCFlags)
	IF ( ${PROJECT_NAME}_C_FLAGS )
		STRING(FIND ${${PROJECT_NAME}_C_FLAGS} ${ARGN} already_stored)
		IF(${already_stored} LESS 0)
			SET(${PROJECT_NAME}_C_FLAGS "${${PROJECT_NAME}_C_FLAGS} ${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C Compiler." FORCE)
		ENDIF()
	ELSE ( ${PROJECT_NAME}_C_FLAGS )
		SET(${PROJECT_NAME}_C_FLAGS "${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C Compiler." FORCE)
	ENDIF ( ${PROJECT_NAME}_C_FLAGS )
endmacro(WkAddCFlags)		

# Usage : WkAddCDefinitions( [Debug|Release] [newdef1] [newdef2] )
macro(WkAddCDefinitions Build)
	IF ( ${PROJECT_NAME}_C_DEFINITIONS_DEBUG AND ${Build} STREQUAL Debug )
		foreach(newdef ${ARGN})
			#message(STATUS "LIST(FIND ${${PROJECT_NAME}_C_DEFINITIONS_DEBUG} ${newdef} already_stored)")
			LIST(FIND ${PROJECT_NAME}_C_DEFINITIONS_DEBUG ${newdef} already_stored)
			#message(STATUS ${already_stored})
			IF(${already_stored} LESS 0)
				LIST(APPEND ${PROJECT_NAME}_C_DEFINITIONS_DEBUG "${newdef}")
			ENDIF()
		endforeach()
	ELSEIF ( ${PROJECT_NAME}_C_DEFINITIONS_RELEASE AND ${Build} STREQUAL Release )
		foreach(newdef ${ARGN})
			LIST(FIND ${PROJECT_NAME}_C_DEFINITIONS_RELEASE ${newdef} already_stored)
			IF(${already_stored} LESS 0)
				LIST(APPEND ${PROJECT_NAME}_C_DEFINITIONS_RELEASE "${newdef}")
			ENDIF()
		endforeach()
	ELSE()
		IF( ${Build} STREQUAL Debug )
			LIST(APPEND ${PROJECT_NAME}_C_DEFINITIONS_DEBUG "${ARGN}")
		ELSEIF ( ${Build} STREQUAL Release)
			LIST(APPEND ${PROJECT_NAME}_C_DEFINITIONS_RELEASE "${ARGN}")
		ELSE()
			message(WARNING " ${Build} is not a valid build type.")
		ENDIF()
	ENDIF ()
endmacro(WkAddCDefinitions Build)

# Usage : WkRmDefaultCFlags( "FLAG_TO_MODIFY -new -flags" )
macro(WkRmFlags FLAG)
	IF ( ${FLAG} )
		#explode string as list
		set(CURRENT_C_ARGS ${${FLAG}})
		separate_arguments(CURRENT_C_ARGS)
		# remove items from list
		LIST(REMOVE_ITEM CURRENT_C_ARGS ${ARGN})
		
		#rewrite all arguments as string
		set(NEW_FLAGS "")
		foreach(f ${CURRENT_C_ARGS})
			set(NEW_FLAGS "${NEW_FLAGS}${f} " )
		endforeach(f)
		set(${FLAG} ${NEW_FLAGS} CACHE STRING "" FORCE)
	ELSE ( ${FLAG} )
		message(${FLAG} " not set!")
	ENDIF ( ${FLAG} )
		
endmacro(WkRmFlags)	

# Usage : WkSetCXXFlags( "-new -flags" )
macro(WkSetCXXFlags)
	SET(${PROJECT_NAME}_CXX_FLAGS "${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C++ Compiler.")
	MARK_AS_ADVANCED(FORCE ${PROJECT_NAME}_CXX_FLAGS )
endmacro(WkSetCXXFlags)

# Usage : WkAddCXXFlags( "-new -flags" )
macro(WkAddCXXFlags)
	IF ( ${PROJECT_NAME}_CXX_FLAGS )
		STRING(FIND ${${PROJECT_NAME}_CXX_FLAGS} ${ARGN} already_stored)
		IF( ${already_stored} LESS 0)
			SET(${PROJECT_NAME}_CXX_FLAGS "${${PROJECT_NAME}_CXX_FLAGS} ${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C++ Compiler." FORCE)
		ENDIF()
	ELSE( ${PROJECT_NAME}_CXX_FLAGS )
		SET(${PROJECT_NAME}_CXX_FLAGS "${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C++ Compiler." FORCE)
	ENDIF ( ${PROJECT_NAME}_CXX_FLAGS )
endmacro(WkAddCXXFlags)

# Usage : WkAddCXXDefinitions( [Debug|Release] [newdef1] [newdef2] )
macro(WkAddCXXDefinitions Build)
	IF ( ${PROJECT_NAME}_CXX_DEFINITIONS_DEBUG AND ${Build} STREQUAL Debug )
		foreach( newdef ${ARGN} )
			LIST(FIND ${PROJECT_NAME}_CXX_DEFINITIONS_DEBUG ${newdef} already_stored)
			IF( ${already_stored} LESS 0)
				LIST( APPEND ${PROJECT_NAME}_CXX_DEFINITIONS_DEBUG "${newdef}")
			ENDIF()
		endforeach()
	ELSEIF (${PROJECT_NAME}_CXX_DEFINITIONS_RELEASE AND ${Build} STREQUAL Release )
		foreach ( newdef ${ARGN} )
			LIST(FIND ${PROJECT_NAME}_CXX_DEFINITIONS_RELEASE ${newdef} already_stored)
			IF( ${already_stored} LESS 0)
				LIST(APPEND ${PROJECT_NAME}_CXX_DEFINITIONS_RELEASE "${newdef}")
			ENDIF()
		endforeach()
	ELSE()<commit_msg>add macro to change CMAKE CXX Debug flag.<commit_after># 
# Copyright (c) 2009, Asmodehn's Corp.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without 
# modification, are permitted provided that the following conditions are met:
# 
#     * Redistributions of source code must retain the above copyright notice, 
#	    this list of conditions and the following disclaimer.
#     * Redistributions in binary form must reproduce the above copyright
#		notice, this list of conditions and the following disclaimer in the 
#	    documentation and/or other materials provided with the distribution.
#     * Neither the name of the Asmodehn's Corp. nor the names of its 
#	    contributors may be used to endorse or promote products derived
#	    from this software without specific prior written permission.
# 
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
# THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
# PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
# BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 
# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
# SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
# THE POSSIBILITY OF SUCH DAMAGE.
#

#
# Compiler Specific rules
# All modifications for Flags should be here
# These macros exists to use more pedantic rules to build software. Thus improving the quality of working code
#

#debug
message ( STATUS "== Loading WkCompilerSetup.cmake ... ")

if ( CMAKE_BACKWARDS_COMPATIBILITY LESS 2.6 )
	message ( FATAL_ERROR " CMAKE MINIMUM BACKWARD COMPATIBILITY REQUIRED : 2.6 !" )
endif( CMAKE_BACKWARDS_COMPATIBILITY LESS 2.6 )

# Macros to redefine default options for build type

# Usage : WkSetCFlags( "-new -flags" )
macro(WkSetCFlags)
	SET(${PROJECT_NAME}_C_FLAGS "${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C Compiler." )
	MARK_AS_ADVANCED(FORCE ${PROJECT_NAME}_C_FLAGS )
endmacro(WkSetCFlags )

# Usage : WkAddCFlags( "-new -flags" )
macro(WkAddCFlags)
	IF ( ${PROJECT_NAME}_C_FLAGS )
		STRING(FIND ${${PROJECT_NAME}_C_FLAGS} ${ARGN} already_stored)
		IF(${already_stored} LESS 0)
			SET(${PROJECT_NAME}_C_FLAGS "${${PROJECT_NAME}_C_FLAGS} ${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C Compiler." FORCE)
		ENDIF()
	ELSE ( ${PROJECT_NAME}_C_FLAGS )
		SET(${PROJECT_NAME}_C_FLAGS "${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C Compiler." FORCE)
	ENDIF ( ${PROJECT_NAME}_C_FLAGS )
endmacro(WkAddCFlags)		

# Usage : WkAddCDefinitions( [Debug|Release] [newdef1] [newdef2] )
macro(WkAddCDefinitions Build)
	IF ( ${PROJECT_NAME}_C_DEFINITIONS_DEBUG AND ${Build} STREQUAL Debug )
		foreach(newdef ${ARGN})
			#message(STATUS "LIST(FIND ${${PROJECT_NAME}_C_DEFINITIONS_DEBUG} ${newdef} already_stored)")
			LIST(FIND ${PROJECT_NAME}_C_DEFINITIONS_DEBUG ${newdef} already_stored)
			#message(STATUS ${already_stored})
			IF(${already_stored} LESS 0)
				LIST(APPEND ${PROJECT_NAME}_C_DEFINITIONS_DEBUG "${newdef}")
			ENDIF()
		endforeach()
	ELSEIF ( ${PROJECT_NAME}_C_DEFINITIONS_RELEASE AND ${Build} STREQUAL Release )
		foreach(newdef ${ARGN})
			LIST(FIND ${PROJECT_NAME}_C_DEFINITIONS_RELEASE ${newdef} already_stored)
			IF(${already_stored} LESS 0)
				LIST(APPEND ${PROJECT_NAME}_C_DEFINITIONS_RELEASE "${newdef}")
			ENDIF()
		endforeach()
	ELSE()
		IF( ${Build} STREQUAL Debug )
			LIST(APPEND ${PROJECT_NAME}_C_DEFINITIONS_DEBUG "${ARGN}")
		ELSEIF ( ${Build} STREQUAL Release)
			LIST(APPEND ${PROJECT_NAME}_C_DEFINITIONS_RELEASE "${ARGN}")
		ELSE()
			message(WARNING " ${Build} is not a valid build type.")
		ENDIF()
	ENDIF ()
endmacro(WkAddCDefinitions Build)

# Usage : WkRmDefaultCFlags( "FLAG_TO_MODIFY -new -flags" )
macro(WkRmFlags FLAG)
	IF ( ${FLAG} )
		#explode string as list
		set(CURRENT_C_ARGS ${${FLAG}})
		separate_arguments(CURRENT_C_ARGS)
		# remove items from list
		LIST(REMOVE_ITEM CURRENT_C_ARGS ${ARGN})
		
		#rewrite all arguments as string
		set(NEW_FLAGS "")
		foreach(f ${CURRENT_C_ARGS})
			set(NEW_FLAGS "${NEW_FLAGS}${f} " )
		endforeach(f)
		set(${FLAG} ${NEW_FLAGS} CACHE STRING "" FORCE)
	ELSE ( ${FLAG} )
		message(${FLAG} " not set!")
	ENDIF ( ${FLAG} )
		
endmacro(WkRmFlags)	

# Usage : WkSetCXXFlags( "-new -flags" )
macro(WkSetCXXFlags)
	SET(${PROJECT_NAME}_CXX_FLAGS "${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C++ Compiler.")
	MARK_AS_ADVANCED(FORCE ${PROJECT_NAME}_CXX_FLAGS )
endmacro(WkSetCXXFlags)

# Usage : WkAddCXXFlags( "-new -flags" )
macro(WkAddCXXFlags)
	IF ( ${PROJECT_NAME}_CXX_FLAGS )
		STRING(FIND ${${PROJECT_NAME}_CXX_FLAGS} ${ARGN} already_stored)
		IF( ${already_stored} LESS 0)
			SET(${PROJECT_NAME}_CXX_FLAGS "${${PROJECT_NAME}_CXX_FLAGS} ${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C++ Compiler." FORCE)
		ENDIF()
	ELSE( ${PROJECT_NAME}_CXX_FLAGS )
		SET(${PROJECT_NAME}_CXX_FLAGS "${ARGN}" CACHE STRING "${PROJECT_NAME} Flags for C++ Compiler." FORCE)
	ENDIF ( ${PROJECT_NAME}_CXX_FLAGS )
endmacro(WkAddCXXFlags)

macro(WkAddDefaultCXXFlagsDebug)
	STRING(FIND CMAKE_CXX_FLAGS_DEBUG ${ARGN} already_stored)
	IF( ${already_stored} LESS 0)
		SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${ARGN}" CACHE STRING "CMAKE Flags for C++ Compiler." FORCE)
	ENDIF()
endmacro(WkAddDefaultCXXFlagsDebug)

# Usage : WkAddCXXDefinitions( [Debug|Release] [newdef1] [newdef2] )
macro(WkAddCXXDefinitions Build)
	IF ( ${PROJECT_NAME}_CXX_DEFINITIONS_DEBUG AND ${Build} STREQUAL Debug )
		foreach( newdef ${ARGN} )
			LIST(FIND ${PROJECT_NAME}_CXX_DEFINITIONS_DEBUG ${newdef} already_stored)
			IF( ${already_stored} LESS 0)
				LIST( APPEND ${PROJECT_NAME}_CXX_DEFINITIONS_DEBUG "${newdef}")
			ENDIF()
		endforeach()
	ELSEIF (${PROJECT_NAME}_CXX_DEFINITIONS_RELEASE AND ${Build} STREQUAL Release )
		foreach ( newdef ${ARGN} )
			LIST(FIND ${PROJECT_NAME}_CXX_DEFINITIONS_RELEASE ${newdef} already_stored)
			IF( ${already_stored} LESS 0)
				LIST(APPEND ${PROJECT_NAME}_CXX_DEFINITIONS_RELEASE "${newdef}")
			ENDIF()
		endforeach()
	ELSE()
{'fraction_non_alphanumeric': 0.1134020618556701, 'fraction_numerical': 0.0033021907216494845, 'mean_word_length': 5.473931178310741, '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': '1961910', 'n_tokens_mistral': 4754, 'n_tokens_neox': 4227, 'n_words': 1184}