foreach(CONFIG DEBUG RELWITHDEBINFO)
    if("${CMAKE_EXE_LINKER_FLAGS_${CONFIG}}" MATCHES "/INCREMENTAL:NO")
        string(REGEX REPLACE "/INCREMENTAL([^:]|$)" ""
                CMAKE_EXE_LINKER_FLAGS_${CONFIG}
                "${CMAKE_EXE_LINKER_FLAGS_${CONFIG}}")
    endif()
    if("${CMAKE_SHARED_LINKER_FLAGS_${CONFIG}}" MATCHES "/INCREMENTAL:NO")
        string(REGEX REPLACE "/INCREMENTAL([^:]|$)" ""
                CMAKE_SHARED_LINKER_FLAGS_${CONFIG}
                "${CMAKE_SHARED_LINKER_FLAGS_${CONFIG}}")
    endif()
endforeach()

add_library(BigfootCompileAndLinkFlags INTERFACE)

target_compile_options(BigfootCompileAndLinkFlags INTERFACE
        $<$<CXX_COMPILER_ID:MSVC>:/W4 /WX>
        $<$<CXX_COMPILER_ID:Clang,GNU>:-Wall -Wextra -Wpedantic -Werror>
        $<$<AND:$<BOOL:${COVERAGE}>,$<CXX_COMPILER_ID:Clang>>:-fprofile-instr-generate -fcoverage-mapping>
)

target_link_options(BigfootCompileAndLinkFlags INTERFACE
        $<$<AND:$<BOOL:${COVERAGE}>,$<CXX_COMPILER_ID:Clang>>:-fprofile-instr-generate>
)

target_compile_definitions(BigfootCompileAndLinkFlags INTERFACE
    $<$<PLATFORM_ID:Windows>:NOMINMAX>
    $<$<PLATFORM_ID:Windows>:WIN32_LEAN_AND_MEAN>
    $<$<PLATFORM_ID:Windows>:BIGFOOT_WINDOWS>
    $<$<PLATFORM_ID:Linux>:BIGFOOT_LINUX>
    $<$<CONFIG:Release>:BIGFOOT_OPTIMIZED>
    $<$<CONFIG:Debug,RelWithDebInfo>:BIGFOOT_NOT_OPTIMIZED>)