]> git.donarmstrong.com Git - kiibohd-controller.git/commitdiff
Adding module compatibility check to CMake build scripts.
authorJacob Alexander <triplehaata@gmail.com>
Wed, 30 Jan 2013 23:13:49 +0000 (18:13 -0500)
committerJacob Alexander <triplehaata@gmail.com>
Wed, 30 Jan 2013 23:13:49 +0000 (18:13 -0500)
- 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

26 files changed:
CMakeLists.txt
Debug/full/setup.cmake
Debug/led/setup.cmake
Debug/off/setup.cmake
Debug/print/print.h
Debug/print/setup.cmake
Macro/basic/setup.cmake
Macro/buffer/setup.cmake
Scan/BETKB/setup.cmake
Scan/BudKeypad/setup.cmake
Scan/EpsonQX-10/setup.cmake
Scan/FACOM6684/setup.cmake
Scan/HP150/setup.cmake
Scan/HeathZenith/setup.cmake
Scan/IBMConvertible/setup.cmake
Scan/Kaypro1/setup.cmake
Scan/MBC-55X/setup.cmake
Scan/MicroSwitch8304/setup.cmake
Scan/SKM67001/setup.cmake
Scan/SonyNEWS/setup.cmake
Scan/SonyOA-S3400/setup.cmake
Scan/Tandy1000/setup.cmake
Scan/UnivacF3W9/setup.cmake
Scan/matrix/setup.cmake
USB/pjrc/setup.cmake
setup.cmake

index 6777092e6090f55fc158007990e3c6b613154cb7..01a31813e473086d88407c244fdb72782dafe85e 100644 (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
 #
index 023405964eeb177112e07bae9e9e7fd53ec4f51a..a270941b837c92160d520df295b5c96edcd32bc4 100644 (file)
@@ -33,3 +33,12 @@ add_definitions(
        -I${HEAD_DIR}/Debug/print
 )
 
+
+###
+# Compiler Family Compatibility
+#
+set( DebugModuleCompatibility
+       arm
+       avr
+)
+
index bb55e5bc97b2c41259fd46ae00c68a3ab8a90472..221089a6534bfb19e7b76ff97fe646c9628ac26d 100644 (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
+)
+
index b49b9d79fcdbd0b4e223121f0550650e721d6693..56d213fd19bed6860e8053cf0e89ef997d5c02cc 100644 (file)
 # Module Specific Options
 #
 
+
+###
+# Compiler Family Compatibility
+#
+set( DebugModuleCompatibility
+       arm
+       avr
+)
+
index fcfffd9970c8975bd3d4d87a91d595efcccd4312..2383d87da129a677e561907a042d26d32553d908 100644 (file)
  */
 
 // 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
index abd4b8d75865b7154aacadd2998afcfc1343f9de..8c27712cfa10cca9cc3b1fff66ed983d60c25616 100644 (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
+)
+
index cf5d97b0ad0140a6643aa02789ce27ae5fa77d63..84800a0159e0210b6ebec5b1c07fb571be9b37e0 100644 (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
+)
+
index cf5d97b0ad0140a6643aa02789ce27ae5fa77d63..1be12be788e6a956c91f8b437a64d25eaf755d86 100644 (file)
@@ -20,3 +20,12 @@ set( MACRO_SRCS
 # Module Specific Options
 #
 
+
+###
+# Compiler Family Compatibility
+#
+set( MacroModuleCompatibility
+       arm
+       avr
+)
+
index 20c0183f089ac4b7c7f263467353406f5ae18a4e..5c557f5dc6300362059259518b7f7fba8aa65a11 100644 (file)
@@ -46,3 +46,11 @@ add_definitions(
        #-DKEYINDEX_MASK=betkb_DefaultMap
 )
 
+
+###
+# Compiler Family Compatibility
+#
+set( ScanModuleCompatibility
+       avr
+)
+
index 25493f0f2ec54023aa5e83a89ba13c1f6aec2213..bf516c260829975cab88318e18f3c878c6e1b6ba 100644 (file)
@@ -33,3 +33,11 @@ add_definitions(
        -DKEYINDEX_MASK=budkeypad_DefaultMap
 )
 
+
+###
+# Compiler Family Compatibility
+#
+set( ScanModuleCompatibility
+       avr
+)
+
index a393da6576473d2d070ae18b8ce73e68b73a97ba..6f5867f933007bb4c44a4eb7fa1c8cfee363831a 100644 (file)
@@ -46,3 +46,11 @@ add_definitions(
        #-DKEYINDEX_MASK=epsonqx10_DefaultMap
 )
 
+
+###
+# Compiler Family Compatibility
+#
+set( ScanModuleCompatibility
+       avr
+)
+
index a81c43331e91fb98720f7e5b03a82ed54ec2affe..8c7bf950febefe934a302eb9680b367908a21ada 100644 (file)
@@ -46,3 +46,11 @@ add_definitions(
        #-DKEYINDEX_MASK=facom6684_DefaultMap
 )
 
+
+###
+# Compiler Family Compatibility
+#
+set( ScanModuleCompatibility
+       avr
+)
+
index f9c203cd487880b1ef47b739d3de46b79dd6206b..6cfcc40248780575c52adafe11591867bb2dde82 100644 (file)
@@ -46,3 +46,11 @@ add_definitions(
        #-DKEYINDEX_MASK=hp150_DefaultMap
 )
 
+
+###
+# Compiler Family Compatibility
+#
+set( ScanModuleCompatibility
+       avr
+)
+
index e95e10acfd457e5f4117aacb2d03dd1b6d0a084f..f3953da86f7e225d653adab69a3c78dee4c87404 100644 (file)
@@ -33,3 +33,11 @@ add_definitions(
        #-DKEYINDEX_MASK=heathzenith_ColemakMap
 )
 
+
+###
+# Compiler Family Compatibility
+#
+set( ScanModuleCompatibility
+       avr
+)
+
index 71dc1698299dfbc4bf55bb934ede5590a2927538..7acda06603c82cc5f0aa237d10a898b787949c46 100644 (file)
@@ -33,3 +33,11 @@ add_definitions(
        -DKEYINDEX_MASK=ibmconv_ColemakMap
 )
 
+
+###
+# Compiler Family Compatibility
+#
+set( ScanModuleCompatibility
+       avr
+)
+
index dd646519a21be59c6e1881a0cae7167b08813195..70d7821128a3a2aa58c73487f31620f8721a6955 100644 (file)
@@ -28,3 +28,11 @@ add_definitions(
        -DKEYINDEX_MASK=kaypro1_DefaultMap
 )
 
+
+###
+# Compiler Family Compatibility
+#
+set( ScanModuleCompatibility
+       avr
+)
+
index c10e47e852107e1d2c3db7bdb9a795aabd5db01d..32f484e5b682ebfcb102174243dbd8938534aa35 100644 (file)
@@ -46,3 +46,12 @@ add_definitions(
        -DKEYINDEX_MASK=facom6684_DefaultMap
 )
 
+
+###
+# Compiler Family Compatibility
+#
+set( ScanModuleCompatibility
+       arm
+       avr
+)
+
index 0978c98c2d9b4a24fcba1f0d6acd4a007f780099..199b9e59cc50f12fbdb4feb052a8edc5f1b98fb9 100644 (file)
@@ -46,3 +46,11 @@ add_definitions(
        #-DKEYINDEX_MASK=microswitch8304_DefaultMap
 )
 
+
+###
+# Compiler Family Compatibility
+#
+set( ScanModuleCompatibility
+       avr
+)
+
index eefca04913ac1a0aef50ee0ecfe84116c3db2649..2b71198acbf0306c0ca4b16ac8da29b6bd8f4b9b 100644 (file)
@@ -33,3 +33,11 @@ add_definitions(
        -DKEYINDEX_MASK=skm67001_ColemakMap
 )
 
+
+###
+# Compiler Family Compatibility
+#
+set( ScanModuleCompatibility
+       avr
+)
+
index c5f67971962d63b0c071eaacef85c8e9b1d0069d..0d1c443d706e8925c3f3455a27ffe157d4d7120e 100644 (file)
@@ -46,3 +46,11 @@ add_definitions(
        -DKEYINDEX_MASK=sonynews_DefaultMap
 )
 
+
+###
+# Compiler Family Compatibility
+#
+set( ScanModuleCompatibility
+       avr
+)
+
index ac61c7d7d7e13d75b1f6df67744d6548d11631b4..616164ac17cba1242f1147a18b7bb0ab5f472fd9 100644 (file)
@@ -45,3 +45,11 @@ add_definitions(
        #-DKEYINDEX_MASK=sonyoas3400_DefaultMap
 )
 
+
+###
+# Compiler Family Compatibility
+#
+set( ScanModuleCompatibility
+       avr
+)
+
index 95f05e62cd831c744425b84af27d7e8929f99a56..e725a5d64b1a480ea58936f0923de92f5004e2d2 100644 (file)
@@ -28,3 +28,11 @@ add_definitions(
        #-DKEYINDEX_MASK=tandy1000_DefaultMap
 )
 
+
+###
+# Compiler Family Compatibility
+#
+set( ScanModuleCompatibility
+       avr
+)
+
index 9fe47fdd8b60014dcb583dfcd30b164719eea239..a18d0d4c703ab0f8d4717ed63811b5e60792c34a 100644 (file)
@@ -44,3 +44,11 @@ add_definitions(
        #-DKEYINDEX_MASK=univacf3w9_DefaultMap
 )
 
+
+###
+# Compiler Family Compatibility
+#
+set( ScanModuleCompatibility
+       avr
+)
+
index 38d6d1db1ef2467dda35f9cfafe65b96a739a0cb..e4722b244ffe0812f8afe635b1c670bd672d15bf 100644 (file)
@@ -34,3 +34,11 @@ add_definitions(
        #-DKEYINDEX_MASK=
 )
 
+
+###
+# Compiler Family Compatibility
+#
+set( ScanModuleCompatibility
+       avr
+)
+
index 171615e28cd0db89da9df56a1682de8113b5406b..b1be1d48f78ea11486a0940d07a4776794c6b767 100644 (file)
@@ -39,3 +39,11 @@ endif ( ${COMPILER_FAMILY} MATCHES "avr" )
 # Module Specific Options
 #
 
+###
+# Compiler Family Compatibility
+#
+set( USBModuleCompatibility
+       arm
+       avr
+)
+
index 90ea27a02df73f94a5a0d2f98d9081f9c598cf23..90340bb500b0bf5c8220658389ec6a4e973056ea 100644 (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