@@ -41,24 +41,6 @@ function(teensy_set_dynamic_properties)
41
41
if (NOT DEFINED teensy_set_dynamic_properties_has_executed)
42
42
set (teensy_set_dynamic_properties_has_executed 1 CACHE INTERNAL "teensy_set_dynamic_properties_has_executed" )
43
43
message (STATUS "teensy_set_dynamic_properties()" )
44
-
45
- message (CHECK_START "identify root dependency path" )
46
- if (NOT DEFINED DEPSPATH)
47
- message (FATAL_ERROR "DEPSPATH is UNDEFINED" )
48
- else ()
49
- message (STATUS "DEPSPATH: ${DEPSPATH} " )
50
- endif ()
51
- message (CHECK_PASS "identified" )
52
-
53
-
54
-
55
- if (NOT DEFINED COREPATH)
56
- set (COREPATH "${DEPSPATH} /cores/teensy4/" )
57
- set (COREPATH ${COREPATH} CACHE INTERNAL "COREPATH" )
58
- message (STATUS "COREPATH: ${COREPATH} " )
59
- else ()
60
- message (STATUS "COREPATH: ${COREPATH} " )
61
- endif ()
62
44
63
45
if (NOT DEFINED CPU_CORE_SPEED)
64
46
message (FATAL_ERROR "CPU_CORE_SPEED is UNDEFINED" )
@@ -108,7 +90,7 @@ function(teensy_set_dynamic_properties)
108
90
elseif (TEENSY_VERSION EQUAL 41)
109
91
message (STATUS "building for teensy 4.1" )
110
92
set (CPU_DEFINE __IMXRT1062__)
111
- set (LINKER_FILE ${COREPATH} imxrt1062_t41.ld)
93
+ set (LINKER_FILE ${teensy_cores_SOURCE_DIR} /teensy4/ imxrt1062_t41.ld)
112
94
set (build_board TEENSY41)
113
95
set (build_flags_ld " -Wl,--gc-sections,--relax " )
114
96
set (build_core teensy4)
@@ -262,7 +244,9 @@ function(teensy_add_library TARGET)
262
244
endforeach (SOURCE_S ${SOURCES_S} )
263
245
264
246
add_library (${ELFTARGET} STATIC ${ARGN} ${TEENSY_SOURCES} ${TEENSY_LIB_CPP_SOURCES} ${TEENSY_LIB_C_SOURCES} ${TEENSY_LIB_S_SOURCES} )
265
- set_target_properties (${ELFTARGET} PROPERTIES INCLUDE_DIRECTORIES ${COREPATH} )
247
+ if (COREPATH)
248
+ set_target_properties (${ELFTARGET} PROPERTIES INCLUDE_DIRECTORIES ${COREPATH} )
249
+ endif ()
266
250
set_target_properties (${ELFTARGET} PROPERTIES LINK_FLAGS "${LINK_FLAGS} " )
267
251
268
252
add_custom_command (OUTPUT ${TARGET} .hex
@@ -366,14 +350,14 @@ macro(import_arduino_library_git LIB_NAME LIB_URL LIB_BRANCH LIB_PATH)
366
350
GIT_TAG ${LIB_BRANCH}
367
351
)
368
352
FetchContent_MakeAvailable(${LIB_NAME} )
369
- set (LIB_ROOT "${${LIB_NAME} _SOURCE_DIR}/${LIB_PATH} " )
353
+ string (TOLOWER ${LIB_NAME} LIB_NAME_LOWER)
354
+ set (LIB_ROOT "${${LIB_NAME_LOWER} _SOURCE_DIR}/${LIB_PATH} " )
370
355
371
- message (STATUS "import_arduino_library_git(${LIB_NAME} ${LIB_URL} ${LIB_BRANCH} ${LIB_ROOT} ${ARGN} )" )
372
356
# Check if we can find the library.
373
357
if (NOT EXISTS "${LIB_ROOT} " )
374
358
message (STATUS "Could not find the directory for library '${LIB_ROOT} ' -- ignoring (its possible that the library is not used for the target you are calling) !!!!!" )
375
359
else ()
376
360
import_arduino_library(${LIB_NAME} ${LIB_ROOT} ${ARGN} )
377
361
endif (NOT EXISTS "${LIB_ROOT} " )
378
362
379
- endmacro (import_arduino_library_git)
363
+ endmacro (import_arduino_library_git)
0 commit comments