function(set_required_compiler_flags)
  set(PROJECT_FLAGS "")
  if(MINGW)
    set(PROJECT_FLAGS ${PROJECT_FLAGS} -m64)
  endif(MINGW)

  foreach(project_name IN LISTS ARGN)
    target_compile_options(${project_name} INTERFACE ${PROJECT_FLAGS})
  endforeach()
endfunction()

function(set_large_source_compiler_flags)
  set(SOURCE_FLAGS "")
  if(MINGW)
    if(CMAKE_BUILD_TYPE MATCHES Debug)
      set(SOURCE_FLAGS "-Og -Wa,-mbig-obj")
    else()
      set(SOURCE_FLAGS "-O3 -Wa,-mbig-obj")
    endif()
  endif(MINGW)

  if(SOURCE_FLAGS)
    foreach(source_file IN LISTS ARGN)
      set_source_files_properties(${source_file} PROPERTIES COMPILE_FLAGS ${SOURCE_FLAGS})
    endforeach()
  endif(SOURCE_FLAGS)
endfunction()
