Moved library generation functions and driver generation function in to cmakeCore.cmake todo : give the project path trought run.sh the "../" can be confusing
parent
fce1f42f88
commit
5ef339c5bb
@ -1,34 +1 @@
|
||||
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}.${PL})
|
||||
message(" |-> Source File : ${DRIVERS_DIR}/${alias}/${alias}.${PL} = 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}.${PL})
|
||||
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()
|
||||
set(DRIVERS_LIST max7219 max31865)
|
||||
|
Loading…
Reference in new issue