if(DEFINED BSP_FRAMEWORK_com.sysprogs.embedded.semihosting_and_profiler)
    if(NOT DEFINED BSP_CONFIGURATION_com.sysprogs.efp.semihosting.buffer_size)
        set(BSP_CONFIGURATION_com.sysprogs.efp.semihosting.buffer_size "4096")
        set(BSP_CONFIGURATION_com.sysprogs.efp.semihosting.buffer_size "${BSP_CONFIGURATION_com.sysprogs.efp.semihosting.buffer_size}" PARENT_SCOPE)
    endif()

    if(NOT DEFINED BSP_CONFIGURATION_com.sysprogs.efp.semihosting.stdio)
        set(BSP_CONFIGURATION_com.sysprogs.efp.semihosting.stdio "1")
        set(BSP_CONFIGURATION_com.sysprogs.efp.semihosting.stdio "${BSP_CONFIGURATION_com.sysprogs.efp.semihosting.stdio}" PARENT_SCOPE)
    endif()

    if(NOT DEFINED BSP_CONFIGURATION_com.sysprogs.efp.semihosting.blocking_mode)
        set(BSP_CONFIGURATION_com.sysprogs.efp.semihosting.blocking_mode "1")
        set(BSP_CONFIGURATION_com.sysprogs.efp.semihosting.blocking_mode "${BSP_CONFIGURATION_com.sysprogs.efp.semihosting.blocking_mode}" PARENT_SCOPE)
    endif()

    if(NOT DEFINED BSP_CONFIGURATION_com.sysprogs.efp.profiling.semihosting_driver)
        set(BSP_CONFIGURATION_com.sysprogs.efp.profiling.semihosting_driver "1")
        set(BSP_CONFIGURATION_com.sysprogs.efp.profiling.semihosting_driver "${BSP_CONFIGURATION_com.sysprogs.efp.profiling.semihosting_driver}" PARENT_SCOPE)
    endif()

    if(NOT DEFINED BSP_CONFIGURATION_com.sysprogs.efp.profiling.counter)
        set(BSP_CONFIGURATION_com.sysprogs.efp.profiling.counter "")
        set(BSP_CONFIGURATION_com.sysprogs.efp.profiling.counter "${BSP_CONFIGURATION_com.sysprogs.efp.profiling.counter}" PARENT_SCOPE)
    endif()

    if(NOT DEFINED BSP_CONFIGURATION_com.sysprogs.efp.profiling.address_validators)
        set(BSP_CONFIGURATION_com.sysprogs.efp.profiling.address_validators "")
        set(BSP_CONFIGURATION_com.sysprogs.efp.profiling.address_validators "${BSP_CONFIGURATION_com.sysprogs.efp.profiling.address_validators}" PARENT_SCOPE)
    endif()

    if(NOT DEFINED BSP_CONFIGURATION_com.sysprogs.efp.profiling.nosampling)
        set(BSP_CONFIGURATION_com.sysprogs.efp.profiling.nosampling "0")
        set(BSP_CONFIGURATION_com.sysprogs.efp.profiling.nosampling "${BSP_CONFIGURATION_com.sysprogs.efp.profiling.nosampling}" PARENT_SCOPE)
    endif()

    if(NOT DEFINED BSP_CONFIGURATION_com.sysprogs.efp.profiling.debugger_check)
        set(BSP_CONFIGURATION_com.sysprogs.efp.profiling.debugger_check "")
        set(BSP_CONFIGURATION_com.sysprogs.efp.profiling.debugger_check "${BSP_CONFIGURATION_com.sysprogs.efp.profiling.debugger_check}" PARENT_SCOPE)
    endif()

    if(NOT DEFINED BSP_CONFIGURATION_com.sysprogs.efp.profiling.rtos)
        set(BSP_CONFIGURATION_com.sysprogs.efp.profiling.rtos "USE_FREERTOS_IF_FOUND")
        set(BSP_CONFIGURATION_com.sysprogs.efp.profiling.rtos "${BSP_CONFIGURATION_com.sysprogs.efp.profiling.rtos}" PARENT_SCOPE)
    endif()

    if(NOT DEFINED BSP_CONFIGURATION_com.sysprogs.efp.profiling.hold_interrupts)
        set(BSP_CONFIGURATION_com.sysprogs.efp.profiling.hold_interrupts "")
        set(BSP_CONFIGURATION_com.sysprogs.efp.profiling.hold_interrupts "${BSP_CONFIGURATION_com.sysprogs.efp.profiling.hold_interrupts}" PARENT_SCOPE)
    endif()

    set(_sources
        "${CMAKE_CURRENT_LIST_DIR}/FastSemihosting.cpp"
        "${CMAKE_CURRENT_LIST_DIR}/InstrumentingProfiler.cpp"
        "${CMAKE_CURRENT_LIST_DIR}/TestResourceManager.cpp"
        "${CMAKE_CURRENT_LIST_DIR}/SysprogsProfiler.h"
        "${CMAKE_CURRENT_LIST_DIR}/SmallNumberCoder.h"
        "${CMAKE_CURRENT_LIST_DIR}/SysprogsProfilerInterface.h"
        "${CMAKE_CURRENT_LIST_DIR}/ProfilerFreeRTOSHooks.h"
        "${CMAKE_CURRENT_LIST_DIR}/CustomRealTimeWatches.h"
        "${CMAKE_CURRENT_LIST_DIR}/DebuggerChecker.h")
    if(NOT ("${BSP_CONFIGURATION_com.sysprogs.efp.profiling.nosampling}" STREQUAL "1"))
        set(_sources ${_sources} "${CMAKE_CURRENT_LIST_DIR}/SamplingProfiler.cpp")
    endif()


    if(((DEFINED BSP_FRAMEWORK_com.sysprogs.arm.stm32.hal) OR ("${BSP_MCU_FAMILY}" MATCHES "com.sysprogs.generated.keil.family.STM32.*") OR ("${BSP_CONFIGURATION_MBED__TARGET_STM}" STREQUAL "1")) AND (NOT ("${BSP_CONFIGURATION_com.sysprogs.efp.profiling.nosampling}" STREQUAL "1")))
        set(_sources ${_sources} "${CMAKE_CURRENT_LIST_DIR}/ProfilerDriver_STM32_HAL.cpp")
    endif()


    if(((DEFINED BSP_FRAMEWORK_com.sysprogs.arm.stm32.stdperiph) OR (DEFINED BSP_FRAMEWORK_com.sysprogs.arm.stm32.f0_stdperiph) OR (DEFINED BSP_FRAMEWORK_com.sysprogs.arm.stm32.f1_stdperiph) OR (DEFINED BSP_FRAMEWORK_com.sysprogs.arm.stm32.f2_stdperiph) OR (DEFINED BSP_FRAMEWORK_com.sysprogs.arm.stm32.f4_stdperiph) OR (DEFINED BSP_FRAMEWORK_com.sysprogs.arm.stm32.f7_stdperiph) OR (DEFINED BSP_FRAMEWORK_com.sysprogs.arm.stm32.l0_stdperiph) OR (DEFINED BSP_FRAMEWORK_com.sysprogs.arm.stm32.l1_stdperiph) OR (DEFINED BSP_FRAMEWORK_com.sysprogs.arm.stm32.l4_stdperiph)) AND (NOT ("${BSP_CONFIGURATION_com.sysprogs.efp.profiling.nosampling}" STREQUAL "1")))
        set(_sources ${_sources} "${CMAKE_CURRENT_LIST_DIR}/ProfilerDriver_STM32_StdPeriph.cpp")
    endif()


    if(("${BSP_ID}" STREQUAL "com.sysprogs.arm.freescale.kinetis_ksdk") AND (NOT ("${BSP_CONFIGURATION_com.sysprogs.efp.profiling.nosampling}" STREQUAL "1")))
        set(_sources ${_sources} "${CMAKE_CURRENT_LIST_DIR}/ProfilerDriver_Kinetis.cpp")
    endif()


    if("${BSP_CONFIGURATION_com.sysprogs.efp.profiling.rtos}" STREQUAL "USE_FREERTOS_IF_FOUND")
        set(_sources ${_sources} "${CMAKE_CURRENT_LIST_DIR}/ProfilerRTOS_FreeRTOS.c")
    endif()


    if("${BSP_CONFIGURATION_com.sysprogs.efp.profiling.rtos}" STREQUAL "USE_RTX")
        set(_sources ${_sources} "${CMAKE_CURRENT_LIST_DIR}/ProfilerRTOS_RTX.c")
    endif()


    if(("${BSP_ID}" STREQUAL "com.sysprogs.arm.nordic.nrf5x") AND (NOT ("${BSP_CONFIGURATION_com.sysprogs.efp.profiling.nosampling}" STREQUAL "1")))
        set(_sources ${_sources} "${CMAKE_CURRENT_LIST_DIR}/ProfilerDriver_Nrf5x.cpp")
    endif()


    if(("${BSP_MCU_FAMILY}" STREQUAL "RP2040"))
        set(_sources ${_sources} "${CMAKE_CURRENT_LIST_DIR}/ProfilerDriver_RP2040.cpp")
    endif()


    set(_includes "${CMAKE_CURRENT_LIST_DIR}")
    set(_defines
        "FAST_SEMIHOSTING_BUFFER_SIZE=${BSP_CONFIGURATION_com.sysprogs.efp.semihosting.buffer_size}"
        "FAST_SEMIHOSTING_BLOCKING_MODE=${BSP_CONFIGURATION_com.sysprogs.efp.semihosting.blocking_mode}"
        "FAST_SEMIHOSTING_STDIO_DRIVER=${BSP_CONFIGURATION_com.sysprogs.efp.semihosting.stdio}"
        "FAST_SEMIHOSTING_PROFILER_DRIVER=${BSP_CONFIGURATION_com.sysprogs.efp.profiling.semihosting_driver}"
        "PROFILER_${BSP_MCU_FAMILY}"
        "${BSP_CONFIGURATION_com.sysprogs.efp.profiling.counter}"
        "${BSP_CONFIGURATION_com.sysprogs.efp.profiling.debugger_check}"
        "${BSP_CONFIGURATION_com.sysprogs.efp.profiling.address_validators}"
        "${BSP_CONFIGURATION_com.sysprogs.efp.profiling.rtos}"
        "${BSP_CONFIGURATION_com.sysprogs.efp.profiling.hold_interrupts}")
    set(_forced_includes "${CMAKE_CURRENT_LIST_DIR}/ProfilerFreeRTOSHooks.h")
    set(_prebuilt_libraries)
    create_bsp_framework_library_from_vars(EFP "com.sysprogs.embedded.semihosting_and_profiler" EFP_Profiler "Fast Semihosting and Embedded Profiler" "Semihosting/Profiler")
    set(_framework_libraries ${_framework_libraries} "${_created_library}")
endif()

set(_core_includes "${_core_includes}" PARENT_SCOPE)
set(_core_defines "${_core_defines}" PARENT_SCOPE)
set(_core_forced_includes "${_core_forced_includes}" PARENT_SCOPE)
set(_framework_libraries "${_framework_libraries}" PARENT_SCOPE)
