Browse Source

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
simple
Jacob Alexander 11 years ago
parent
commit
fc7998d605

+ 12
- 0
CMakeLists.txt 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
#

+ 9
- 0
Debug/full/setup.cmake View File

@@ -33,3 +33,12 @@ add_definitions(
-I${HEAD_DIR}/Debug/print
)


###
# Compiler Family Compatibility
#
set( DebugModuleCompatibility
arm
avr
)


+ 9
- 0
Debug/led/setup.cmake 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
)


+ 9
- 0
Debug/off/setup.cmake View File

@@ -17,3 +17,12 @@
# Module Specific Options
#


###
# Compiler Family Compatibility
#
set( DebugModuleCompatibility
arm
avr
)


+ 2
- 6
Debug/print/print.h 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

+ 9
- 0
Debug/print/setup.cmake 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
)


+ 19
- 0
Macro/basic/setup.cmake 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
)


+ 9
- 0
Macro/buffer/setup.cmake View File

@@ -20,3 +20,12 @@ set( MACRO_SRCS
# Module Specific Options
#


###
# Compiler Family Compatibility
#
set( MacroModuleCompatibility
arm
avr
)


+ 8
- 0
Scan/BETKB/setup.cmake View File

@@ -46,3 +46,11 @@ add_definitions(
#-DKEYINDEX_MASK=betkb_DefaultMap
)


###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)


+ 8
- 0
Scan/BudKeypad/setup.cmake View File

@@ -33,3 +33,11 @@ add_definitions(
-DKEYINDEX_MASK=budkeypad_DefaultMap
)


###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)


+ 8
- 0
Scan/EpsonQX-10/setup.cmake View File

@@ -46,3 +46,11 @@ add_definitions(
#-DKEYINDEX_MASK=epsonqx10_DefaultMap
)


###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)


+ 8
- 0
Scan/FACOM6684/setup.cmake View File

@@ -46,3 +46,11 @@ add_definitions(
#-DKEYINDEX_MASK=facom6684_DefaultMap
)


###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)


+ 8
- 0
Scan/HP150/setup.cmake View File

@@ -46,3 +46,11 @@ add_definitions(
#-DKEYINDEX_MASK=hp150_DefaultMap
)


###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)


+ 8
- 0
Scan/HeathZenith/setup.cmake View File

@@ -33,3 +33,11 @@ add_definitions(
#-DKEYINDEX_MASK=heathzenith_ColemakMap
)


###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)


+ 8
- 0
Scan/IBMConvertible/setup.cmake View File

@@ -33,3 +33,11 @@ add_definitions(
-DKEYINDEX_MASK=ibmconv_ColemakMap
)


###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)


+ 8
- 0
Scan/Kaypro1/setup.cmake View File

@@ -28,3 +28,11 @@ add_definitions(
-DKEYINDEX_MASK=kaypro1_DefaultMap
)


###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)


+ 9
- 0
Scan/MBC-55X/setup.cmake View File

@@ -46,3 +46,12 @@ add_definitions(
-DKEYINDEX_MASK=facom6684_DefaultMap
)


###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
arm
avr
)


+ 8
- 0
Scan/MicroSwitch8304/setup.cmake View File

@@ -46,3 +46,11 @@ add_definitions(
#-DKEYINDEX_MASK=microswitch8304_DefaultMap
)


###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)


+ 8
- 0
Scan/SKM67001/setup.cmake View File

@@ -33,3 +33,11 @@ add_definitions(
-DKEYINDEX_MASK=skm67001_ColemakMap
)


###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)


+ 8
- 0
Scan/SonyNEWS/setup.cmake View File

@@ -46,3 +46,11 @@ add_definitions(
-DKEYINDEX_MASK=sonynews_DefaultMap
)


###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)


+ 8
- 0
Scan/SonyOA-S3400/setup.cmake View File

@@ -45,3 +45,11 @@ add_definitions(
#-DKEYINDEX_MASK=sonyoas3400_DefaultMap
)


###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)


+ 8
- 0
Scan/Tandy1000/setup.cmake View File

@@ -28,3 +28,11 @@ add_definitions(
#-DKEYINDEX_MASK=tandy1000_DefaultMap
)


###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)


+ 8
- 0
Scan/UnivacF3W9/setup.cmake View File

@@ -44,3 +44,11 @@ add_definitions(
#-DKEYINDEX_MASK=univacf3w9_DefaultMap
)


###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)


+ 8
- 0
Scan/matrix/setup.cmake View File

@@ -34,3 +34,11 @@ add_definitions(
#-DKEYINDEX_MASK=
)


###
# Compiler Family Compatibility
#
set( ScanModuleCompatibility
avr
)


+ 8
- 0
USB/pjrc/setup.cmake View File

@@ -39,3 +39,11 @@ endif ( ${COMPILER_FAMILY} MATCHES "avr" )
# Module Specific Options
#

###
# Compiler Family Compatibility
#
set( USBModuleCompatibility
arm
avr
)


+ 19
- 0
setup.cmake 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