function(xcmSetCompileFlags)
	if(CMAKE_CXX_COMPILER_ID MATCHES GNU)
		set(F_WARN "-pedantic -Wall -Wextra -Wcast-align -Wcast-qual")
		set(F_WARN "${F_WARN} -Wctor-dtor-privacy -Wlogical-op")
		set(F_WARN "${F_WARN} -Wformat=2 -Winit-self -Wlogical-op")
		set(F_WARN "${F_WARN} -Wmissing-include-dirs -Wnoexcept")
		set(F_WARN "${F_WARN} -Wold-style-cast -Wshadow")
		set(F_WARN "${F_WARN} -Woverloaded-virtual -Wredundant-decls")
		set(F_WARN "${F_WARN} -Wsign-conversion -Wsign-promo -Wundef")
		set(F_WARN "${F_WARN} -Wstrict-null-sentinel -Wswitch-default")
		set(F_WARN "${F_WARN} -Wdisabled-optimization")
		set(F_WARN "${F_WARN} -Wstrict-overflow=5 -Wswitch-default")

		set(F_DBG "${F_WARN} -std=c++1y -g -O0 -fsanitize=address")
		set(F_DBG "${F_DBG} -fstack-protector-strong")
		set(F_DBG "${F_DBG} -fsanitize=undefined")

		set(F_REL "${F_WARN} -std=c++1y -O2 -fomit-frame-pointer")
		set(F_REL "${F_REL} -fstack-protector-strong")
	elseif(CMAKE_CXX_COMPILER_ID MATCHES Clang)
		set(F_WARN "-pedantic -Wall -Wextra -Wcast-align -Wcast-qual")
		set(F_WARN "${F_WARN} -Wdisabled-optimization -Wformat=2")
		set(F_WARN "${F_WARN} -Winit-self -Wstrict-overflow=5")
		set(F_WARN "${F_WARN} -Wmissing-include-dirs -Wold-style-cast")
		set(F_WARN "${F_WARN} -Wshadow -Wswitch-default")
		set(F_WARN "${F_WARN} -Woverloaded-virtual -Wredundant-decls")
		set(F_WARN "${F_WARN} -Wsign-conversion -Wsign-promo -Wundef")
		set(F_WARN "${F_WARN} -Wint-to-void-pointer-cast")
		set(F_WARN "${F_WARN} -Wctor-dtor-privacy")

		set(F_DBG "${F_WARN} -std=c++1y -g -O0 -fsanitize=address")
		set(F_DBG "${F_DBG} -fsanitize=undefined")

		set(F_REL "${F_WARN} -std=c++1y -O2 -fomit-frame-pointer")
		set(F_REL "${F_REL} -fstack-protector-strong")
	else()
		set(F_DBG "")
		set(F_REL "")
	endif()

	set(CMAKE_CXX_FLAGS_RELEASE "${F_REL}" PARENT_SCOPE)
	set(CMAKE_CXX_FLAGS_DEBUG "${F_DBG}" PARENT_SCOPE)
endfunction()
