diff --git a/CMakeLists.txt b/CMakeLists.txt index 6777092..01a3181 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 # diff --git a/Debug/full/setup.cmake b/Debug/full/setup.cmake index 0234059..a270941 100644 --- a/Debug/full/setup.cmake +++ b/Debug/full/setup.cmake @@ -33,3 +33,12 @@ add_definitions( -I${HEAD_DIR}/Debug/print ) + +### +# Compiler Family Compatibility +# +set( DebugModuleCompatibility + arm + avr +) + diff --git a/Debug/led/setup.cmake b/Debug/led/setup.cmake index bb55e5b..221089a 100644 --- a/Debug/led/setup.cmake +++ b/Debug/led/setup.cmake @@ -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 +) + diff --git a/Debug/off/setup.cmake b/Debug/off/setup.cmake index b49b9d7..56d213f 100644 --- a/Debug/off/setup.cmake +++ b/Debug/off/setup.cmake @@ -17,3 +17,12 @@ # Module Specific Options # + +### +# Compiler Family Compatibility +# +set( DebugModuleCompatibility + arm + avr +) + diff --git a/Debug/print/print.h b/Debug/print/print.h index fcfffd9..2383d87 100644 --- a/Debug/print/print.h +++ b/Debug/print/print.h @@ -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 diff --git a/Debug/print/setup.cmake b/Debug/print/setup.cmake index abd4b8d..8c27712 100644 --- a/Debug/print/setup.cmake +++ b/Debug/print/setup.cmake @@ -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 +) + diff --git a/Macro/basic/setup.cmake b/Macro/basic/setup.cmake index cf5d97b..84800a0 100644 --- a/Macro/basic/setup.cmake +++ b/Macro/basic/setup.cmake @@ -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 +) + diff --git a/Macro/buffer/setup.cmake b/Macro/buffer/setup.cmake index cf5d97b..1be12be 100644 --- a/Macro/buffer/setup.cmake +++ b/Macro/buffer/setup.cmake @@ -20,3 +20,12 @@ set( MACRO_SRCS # Module Specific Options # + +### +# Compiler Family Compatibility +# +set( MacroModuleCompatibility + arm + avr +) + diff --git a/Scan/BETKB/setup.cmake b/Scan/BETKB/setup.cmake index 20c0183..5c557f5 100644 --- a/Scan/BETKB/setup.cmake +++ b/Scan/BETKB/setup.cmake @@ -46,3 +46,11 @@ add_definitions( #-DKEYINDEX_MASK=betkb_DefaultMap ) + +### +# Compiler Family Compatibility +# +set( ScanModuleCompatibility + avr +) + diff --git a/Scan/BudKeypad/setup.cmake b/Scan/BudKeypad/setup.cmake index 25493f0..bf516c2 100644 --- a/Scan/BudKeypad/setup.cmake +++ b/Scan/BudKeypad/setup.cmake @@ -33,3 +33,11 @@ add_definitions( -DKEYINDEX_MASK=budkeypad_DefaultMap ) + +### +# Compiler Family Compatibility +# +set( ScanModuleCompatibility + avr +) + diff --git a/Scan/EpsonQX-10/setup.cmake b/Scan/EpsonQX-10/setup.cmake index a393da6..6f5867f 100644 --- a/Scan/EpsonQX-10/setup.cmake +++ b/Scan/EpsonQX-10/setup.cmake @@ -46,3 +46,11 @@ add_definitions( #-DKEYINDEX_MASK=epsonqx10_DefaultMap ) + +### +# Compiler Family Compatibility +# +set( ScanModuleCompatibility + avr +) + diff --git a/Scan/FACOM6684/setup.cmake b/Scan/FACOM6684/setup.cmake index a81c433..8c7bf95 100644 --- a/Scan/FACOM6684/setup.cmake +++ b/Scan/FACOM6684/setup.cmake @@ -46,3 +46,11 @@ add_definitions( #-DKEYINDEX_MASK=facom6684_DefaultMap ) + +### +# Compiler Family Compatibility +# +set( ScanModuleCompatibility + avr +) + diff --git a/Scan/HP150/setup.cmake b/Scan/HP150/setup.cmake index f9c203c..6cfcc40 100644 --- a/Scan/HP150/setup.cmake +++ b/Scan/HP150/setup.cmake @@ -46,3 +46,11 @@ add_definitions( #-DKEYINDEX_MASK=hp150_DefaultMap ) + +### +# Compiler Family Compatibility +# +set( ScanModuleCompatibility + avr +) + diff --git a/Scan/HeathZenith/setup.cmake b/Scan/HeathZenith/setup.cmake index e95e10a..f3953da 100644 --- a/Scan/HeathZenith/setup.cmake +++ b/Scan/HeathZenith/setup.cmake @@ -33,3 +33,11 @@ add_definitions( #-DKEYINDEX_MASK=heathzenith_ColemakMap ) + +### +# Compiler Family Compatibility +# +set( ScanModuleCompatibility + avr +) + diff --git a/Scan/IBMConvertible/setup.cmake b/Scan/IBMConvertible/setup.cmake index 71dc169..7acda06 100644 --- a/Scan/IBMConvertible/setup.cmake +++ b/Scan/IBMConvertible/setup.cmake @@ -33,3 +33,11 @@ add_definitions( -DKEYINDEX_MASK=ibmconv_ColemakMap ) + +### +# Compiler Family Compatibility +# +set( ScanModuleCompatibility + avr +) + diff --git a/Scan/Kaypro1/setup.cmake b/Scan/Kaypro1/setup.cmake index dd64651..70d7821 100644 --- a/Scan/Kaypro1/setup.cmake +++ b/Scan/Kaypro1/setup.cmake @@ -28,3 +28,11 @@ add_definitions( -DKEYINDEX_MASK=kaypro1_DefaultMap ) + +### +# Compiler Family Compatibility +# +set( ScanModuleCompatibility + avr +) + diff --git a/Scan/MBC-55X/setup.cmake b/Scan/MBC-55X/setup.cmake index c10e47e..32f484e 100644 --- a/Scan/MBC-55X/setup.cmake +++ b/Scan/MBC-55X/setup.cmake @@ -46,3 +46,12 @@ add_definitions( -DKEYINDEX_MASK=facom6684_DefaultMap ) + +### +# Compiler Family Compatibility +# +set( ScanModuleCompatibility + arm + avr +) + diff --git a/Scan/MicroSwitch8304/setup.cmake b/Scan/MicroSwitch8304/setup.cmake index 0978c98..199b9e5 100644 --- a/Scan/MicroSwitch8304/setup.cmake +++ b/Scan/MicroSwitch8304/setup.cmake @@ -46,3 +46,11 @@ add_definitions( #-DKEYINDEX_MASK=microswitch8304_DefaultMap ) + +### +# Compiler Family Compatibility +# +set( ScanModuleCompatibility + avr +) + diff --git a/Scan/SKM67001/setup.cmake b/Scan/SKM67001/setup.cmake index eefca04..2b71198 100644 --- a/Scan/SKM67001/setup.cmake +++ b/Scan/SKM67001/setup.cmake @@ -33,3 +33,11 @@ add_definitions( -DKEYINDEX_MASK=skm67001_ColemakMap ) + +### +# Compiler Family Compatibility +# +set( ScanModuleCompatibility + avr +) + diff --git a/Scan/SonyNEWS/setup.cmake b/Scan/SonyNEWS/setup.cmake index c5f6797..0d1c443 100644 --- a/Scan/SonyNEWS/setup.cmake +++ b/Scan/SonyNEWS/setup.cmake @@ -46,3 +46,11 @@ add_definitions( -DKEYINDEX_MASK=sonynews_DefaultMap ) + +### +# Compiler Family Compatibility +# +set( ScanModuleCompatibility + avr +) + diff --git a/Scan/SonyOA-S3400/setup.cmake b/Scan/SonyOA-S3400/setup.cmake index ac61c7d..616164a 100644 --- a/Scan/SonyOA-S3400/setup.cmake +++ b/Scan/SonyOA-S3400/setup.cmake @@ -45,3 +45,11 @@ add_definitions( #-DKEYINDEX_MASK=sonyoas3400_DefaultMap ) + +### +# Compiler Family Compatibility +# +set( ScanModuleCompatibility + avr +) + diff --git a/Scan/Tandy1000/setup.cmake b/Scan/Tandy1000/setup.cmake index 95f05e6..e725a5d 100644 --- a/Scan/Tandy1000/setup.cmake +++ b/Scan/Tandy1000/setup.cmake @@ -28,3 +28,11 @@ add_definitions( #-DKEYINDEX_MASK=tandy1000_DefaultMap ) + +### +# Compiler Family Compatibility +# +set( ScanModuleCompatibility + avr +) + diff --git a/Scan/UnivacF3W9/setup.cmake b/Scan/UnivacF3W9/setup.cmake index 9fe47fd..a18d0d4 100644 --- a/Scan/UnivacF3W9/setup.cmake +++ b/Scan/UnivacF3W9/setup.cmake @@ -44,3 +44,11 @@ add_definitions( #-DKEYINDEX_MASK=univacf3w9_DefaultMap ) + +### +# Compiler Family Compatibility +# +set( ScanModuleCompatibility + avr +) + diff --git a/Scan/matrix/setup.cmake b/Scan/matrix/setup.cmake index 38d6d1d..e4722b2 100644 --- a/Scan/matrix/setup.cmake +++ b/Scan/matrix/setup.cmake @@ -34,3 +34,11 @@ add_definitions( #-DKEYINDEX_MASK= ) + +### +# Compiler Family Compatibility +# +set( ScanModuleCompatibility + avr +) + diff --git a/USB/pjrc/setup.cmake b/USB/pjrc/setup.cmake index 171615e..b1be1d4 100644 --- a/USB/pjrc/setup.cmake +++ b/USB/pjrc/setup.cmake @@ -39,3 +39,11 @@ endif ( ${COMPILER_FAMILY} MATCHES "avr" ) # Module Specific Options # +### +# Compiler Family Compatibility +# +set( USBModuleCompatibility + arm + avr +) + diff --git a/setup.cmake b/setup.cmake index 90ea27a..90340bb 100644 --- a/setup.cmake +++ b/setup.cmake @@ -56,6 +56,25 @@ set( HEAD_DIR "${CMAKE_CURRENT_SOURCE_DIR}" ) +### +# Module Check Function +# + +#| Usage: +#| PathPrepend( ModulePath ) +#| 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