FUNCTION(SET_CLANG_BOOST_COMPILER_FLAGS)
    STRING(REGEX MATCH "^([0-9]+).([0-9]+).[0-9]+$" CLANG_VERSION ${CMAKE_CXX_COMPILER_VERSION})
    SET(VERSION_POSTFIX "${CMAKE_MATCH_1}${CMAKE_MATCH_2}")
    SET(Boost_COMPILER "-clang${VERSION_POSTFIX}" PARENT_SCOPE)
ENDFUNCTION()

FUNCTION(ADD_SANITIZERS_TO_BUILD)
    SET(SANITIZER_FLAGS "-fsanitize=address,undefined")
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${SANITIZER_FLAGS}" PARENT_SCOPE)
ENDFUNCTION()

FUNCTION(SET_WARNING_LEVEL)
	IF(MSVC)
		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4" PARENT_SCOPE)
	ELSEIF (CMAKE_CXX_COMPILER_ID STREQUAL "GNU" OR CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
		SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pedantic" PARENT_SCOPE)
	ENDIF(MSVC)
ENDFUNCTION()

FUNCTION(ENABLE_MULTIPROCESSOR_BUILD)
    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /MP" PARENT_SCOPE)
ENDFUNCTION()

FUNCTION(DISABLE_COMPILER_EXTENSIONS)
    IF(MSVC)
	    SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /Za")
	ENDIF(MSVC)
ENDFUNCTION()