function(search_linker_script vendor mcu linker_scripts_directory linker_script)
    if (${vendor} STREQUAL "STM32")
        if (linker_scripts_directory)
            message(STATUS "Searching linker script under: ${linker_scripts_directory}")
        else()
            message(FATAL_ERROR "Directory with linker scripts for STM32 must be provided!")
        endif()
        string(TOLOWER "${mcu}" mcu)
        set (linker_script_path "${linker_scripts_directory}/stm32/${mcu}.ld")
        if (EXISTS "${linker_script_path}")
            message(STATUS "Found linker script: ${linker_script_path}")
            set(${linker_script} ${linker_script_path} PARENT_SCOPE)
        else ()
            message(FATAL_ERROR "Linker script file not exists: ${linker_script}")
        endif()
    endif()
endfunction()