if (CMAKE_HOST_WIN32)
    message(STATUS "Using GCC for Windows (MinGW)")
    set(CMAKE_ASM_COMPILER "gcc.exe")
    set(CMAKE_C_COMPILER "gcc.exe")
    set(CMAKE_CXX_COMPILER "g++.exe")
    set(CMAKE_C_FLAGS_INIT "-mno-ms-bitfields")
else ()
    message(STATUS "Using GCC")
    set(CMAKE_ASM_COMPILER "gcc")
    set(CMAKE_C_COMPILER "gcc")
    set(CMAKE_CXX_COMPILER "g++")
endif ()

set(data_flags "-ffunction-sections -fdata-sections -fno-strict-aliasing -fno-builtin --short-enums -m32")
set(warning_flags "-Wall -Wextra -Werror=implicit-function-declaration -Wno-format -Wno-unused-parameter -Wno-missing-field-initializers -Wno-unused-function")

set(CMAKE_C_FLAGS_INIT "${data_flags} ${warning_flags} ${CMAKE_C_FLAGS_INIT}")
set(CMAKE_C_FLAGS_DEBUG_INIT "-O0 -g")
set(CMAKE_EXE_LINKER_FLAGS_INIT "")

set(CMAKE_C_STANDARD 99)
set(CMAKE_CXX_STANDARD 17)
