Archived
1
0

Adding module compatibility check to CMake build scripts.

- All modules have a default avr compatibilty right now (since that is what they were developed on)
- As modules get tested and added, arm support has to be turned on in the respective setup.cmake file
This commit is contained in:
Jacob Alexander 2013-01-30 18:13:49 -05:00
parent c8b4baf652
commit fc7998d605
26 changed files with 234 additions and 6 deletions

View File

@ -76,6 +76,18 @@ set( SRCS
###
# Module Compatibility Check
#
#| Check for whether the set modules are compatible with the specified compiler family
ModuleCompatibility( ${ScanModulePath} ${ScanModuleCompatibility} )
ModuleCompatibility( ${MacroModulePath} ${MacroModuleCompatibility} )
ModuleCompatibility( ${USBModulePath} ${USBModuleCompatibility} )
ModuleCompatibility( ${DebugModulePath} ${DebugModuleCompatibility} )
###
# Build Targets
#

View File

@ -33,3 +33,12 @@ add_definitions(
-I${HEAD_DIR}/Debug/print
)
###
# Compiler Family Compatibility
#
set( DebugModuleCompatibility
arm
avr
)

View File

@ -32,3 +32,12 @@ add_file_dependencies( ../led/led.c ../led/led.h )
#
add_definitions( -I${HEAD_DIR}/Debug/off )
###
# Compiler Family Compatibility
#
set( DebugModuleCompatibility
arm
avr
)

View File

@ -17,3 +17,12 @@
# Module Specific Options
#
###
# Compiler Family Compatibility
#
set( DebugModuleCompatibility
arm
avr
)

View File

@ -50,12 +50,8 @@
*/
// Function Aliases
#if defined(_at90usb162_) || defined(_atmega32u4_) || defined(_at90usb646_) || defined(_at90usb1286_) // AVR
#define dPrint(c) usb_debug_putchar(c)
#elif defined(_mk20dx128_) // ARM
#define dPrint(c) usb_debug_putstr (c)
#endif
#define dPrintStr(c) usb_debug_putstr (c)
#define dPrint(c) usb_debug_putstr(c)
#define dPrintStr(c) usb_debug_putstr(c)
#define dPrintStrs(...) usb_debug_putstrs(__VA_ARGS__, "\0\0\0") // Convenience Variadic Macro
#define dPrintStrNL(c) dPrintStrs (c, NL) // Appends New Line Macro
#define dPrintStrsNL(...) usb_debug_putstrs(__VA_ARGS__, NL, "\0\0\0") // Appends New Line Macro

View File

@ -32,3 +32,12 @@ add_file_dependencies( ../led/print.c ../led/print.h )
#
add_definitions( -I${HEAD_DIR}/Debug/off )
###
# Compiler Family Compatibility
#
set( DebugModuleCompatibility
arm
avr
)

View File

@ -7,6 +7,17 @@
###
###
# Warning, module has known speed issues on non-matrix designs
# Has not been tested in a long time
#
message( AUTHOR_WARNING
"The 'basic' macro module was originally designed for matrix scanning designs,
it was found not to be scalable with NKRO keyboard converters.
It has also not been tested in a long time, use at your own risk."
)
###
# Module C files
#
@ -20,3 +31,11 @@ set( MACRO_SRCS
# Module Specific Options
#
###
# Compiler Family Compatibility
#
set( MacroModuleCompatibility
avr
)

View File

@ -20,3 +20,12 @@ set( MACRO_SRCS
# Module Specific Options
#
###
# Compiler Family Compatibility
#
set( MacroModuleCompatibility
arm
avr
)

View File

@ -46,3 +46,11 @@ add_definitions(
#-DKEYINDEX_MASK=betkb_DefaultMap
)
###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)

View File

@ -33,3 +33,11 @@ add_definitions(
-DKEYINDEX_MASK=budkeypad_DefaultMap
)
###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)

View File

@ -46,3 +46,11 @@ add_definitions(
#-DKEYINDEX_MASK=epsonqx10_DefaultMap
)
###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)

View File

@ -46,3 +46,11 @@ add_definitions(
#-DKEYINDEX_MASK=facom6684_DefaultMap
)
###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)

View File

@ -46,3 +46,11 @@ add_definitions(
#-DKEYINDEX_MASK=hp150_DefaultMap
)
###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)

View File

@ -33,3 +33,11 @@ add_definitions(
#-DKEYINDEX_MASK=heathzenith_ColemakMap
)
###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)

View File

@ -33,3 +33,11 @@ add_definitions(
-DKEYINDEX_MASK=ibmconv_ColemakMap
)
###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)

View File

@ -28,3 +28,11 @@ add_definitions(
-DKEYINDEX_MASK=kaypro1_DefaultMap
)
###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)

View File

@ -46,3 +46,12 @@ add_definitions(
-DKEYINDEX_MASK=facom6684_DefaultMap
)
###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
arm
avr
)

View File

@ -46,3 +46,11 @@ add_definitions(
#-DKEYINDEX_MASK=microswitch8304_DefaultMap
)
###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)

View File

@ -33,3 +33,11 @@ add_definitions(
-DKEYINDEX_MASK=skm67001_ColemakMap
)
###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)

View File

@ -46,3 +46,11 @@ add_definitions(
-DKEYINDEX_MASK=sonynews_DefaultMap
)
###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)

View File

@ -45,3 +45,11 @@ add_definitions(
#-DKEYINDEX_MASK=sonyoas3400_DefaultMap
)
###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)

View File

@ -28,3 +28,11 @@ add_definitions(
#-DKEYINDEX_MASK=tandy1000_DefaultMap
)
###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)

View File

@ -44,3 +44,11 @@ add_definitions(
#-DKEYINDEX_MASK=univacf3w9_DefaultMap
)
###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)

View File

@ -34,3 +34,11 @@ add_definitions(
#-DKEYINDEX_MASK=
)
###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)

View File

@ -39,3 +39,11 @@ endif ( ${COMPILER_FAMILY} MATCHES "avr" )
# Module Specific Options
#
###
# Compiler Family Compatibility
#
set( USBModuleCompatibility
arm
avr
)

View File

@ -56,6 +56,25 @@ set( HEAD_DIR "${CMAKE_CURRENT_SOURCE_DIR}" )
###
# Module Check Function
#
#| Usage:
#| PathPrepend( ModulePath <ListOfFamiliesSupported> )
#| Uses the ${COMPILER_FAMILY} variable
function( ModuleCompatibility ModulePath )
foreach( mod_var ${ARGN} )
if ( ${mod_var} STREQUAL ${COMPILER_FAMILY} )
# Module found, no need to scan further
return()
endif ( ${mod_var} STREQUAL ${COMPILER_FAMILY} )
endforeach( mod_var ${ARGN} )
message( FATAL_ERROR "${ModulePath} does not support the ${COMPILER_FAMILY} family..." )
endfunction( ModuleCompatibility ModulePath )
###
# Module Configuration