You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
1.5 KiB
35 lines
1.5 KiB
function(addDriver alias _currentDriver)
|
|
if(EXISTS ${DRIVERS_DIR}/${alias} ) # Checks if the desired peripheral is implemented for the desired CSL.
|
|
message(" --> Driver directory : ${DRIVERS_DIR}/${alias} = FOUND")
|
|
if(EXISTS ${DRIVERS_DIR}/${alias}/${alias}.c)
|
|
message(" |-> Source File : ${DRIVERS_DIR}/${alias}/${alias}.c = FOUND")
|
|
if(EXISTS ${DRIVERS_DIR}/${alias}/${alias}.h)
|
|
|
|
message(" |-> Header File : ${DRIVERS_DIR}/${alias}/${alias}.h = FOUND")
|
|
|
|
#add_subdirectory(${DRIVERS_DIR}/${alias})
|
|
|
|
add_library(${alias}_submodule ${DRIVERS_DIR}/${alias}/${alias}.c)
|
|
target_compile_options(${alias}_submodule PRIVATE ${C_FLAGS})
|
|
target_compile_definitions(${alias}_submodule PRIVATE ${C_DEFS})
|
|
target_include_directories(${alias}_submodule PUBLIC ${PERIFERALS_DIR} ${CSL_INCLUDES})
|
|
add_library(sub::${alias} ALIAS ${alias}_submodule)
|
|
set(${_currentPripheral} sub::${alias} PARENT_SCOPE)
|
|
|
|
else ()
|
|
message("${BoldRed}")
|
|
message(FATAL_ERROR "\nThe Included ${alias} Driver's Header file was NOT found ### COMPILATION ABORTED ###\n")
|
|
message("${ColourReset}")
|
|
endif()
|
|
else ()
|
|
message("${BoldRed}")
|
|
message(FATAL_ERROR "\nThe Included ${alias} Driver's Source file was NOT found ### COMPILATION ABORTED ###\n")
|
|
message("${ColourReset}")
|
|
endif()
|
|
else ()
|
|
message("${BoldRed}")
|
|
message(FATAL_ERROR "\nThe Included ${alias} Driver was NOT found ### COMPILATION ABORTED ###\n")
|
|
message("${ColourReset}")
|
|
endif()
|
|
endfunction()
|