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:
parent
c8b4baf652
commit
fc7998d605
@ -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
|
||||
#
|
||||
|
@ -33,3 +33,12 @@ add_definitions(
|
||||
-I${HEAD_DIR}/Debug/print
|
||||
)
|
||||
|
||||
|
||||
###
|
||||
# Compiler Family Compatibility
|
||||
#
|
||||
set( DebugModuleCompatibility
|
||||
arm
|
||||
avr
|
||||
)
|
||||
|
||||
|
@ -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
|
||||
)
|
||||
|
||||
|
@ -17,3 +17,12 @@
|
||||
# Module Specific Options
|
||||
#
|
||||
|
||||
|
||||
###
|
||||
# Compiler Family Compatibility
|
||||
#
|
||||
set( DebugModuleCompatibility
|
||||
arm
|
||||
avr
|
||||
)
|
||||
|
||||
|
@ -50,11 +50,7 @@
|
||||
*/
|
||||
|
||||
// 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 dPrintStrs(...) usb_debug_putstrs(__VA_ARGS__, "\0\0\0") // Convenience Variadic Macro
|
||||
#define dPrintStrNL(c) dPrintStrs (c, NL) // Appends New Line Macro
|
||||
|
@ -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
|
||||
)
|
||||
|
||||
|
@ -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
|
||||
)
|
||||
|
||||
|
@ -20,3 +20,12 @@ set( MACRO_SRCS
|
||||
# Module Specific Options
|
||||
#
|
||||
|
||||
|
||||
###
|
||||
# Compiler Family Compatibility
|
||||
#
|
||||
set( MacroModuleCompatibility
|
||||
arm
|
||||
avr
|
||||
)
|
||||
|
||||
|
@ -46,3 +46,11 @@ add_definitions(
|
||||
#-DKEYINDEX_MASK=betkb_DefaultMap
|
||||
)
|
||||
|
||||
|
||||
###
|
||||
# Compiler Family Compatibility
|
||||
#
|
||||
set( ScanModuleCompatibility
|
||||
avr
|
||||
)
|
||||
|
||||
|
@ -33,3 +33,11 @@ add_definitions(
|
||||
-DKEYINDEX_MASK=budkeypad_DefaultMap
|
||||
)
|
||||
|
||||
|
||||
###
|
||||
# Compiler Family Compatibility
|
||||
#
|
||||
set( ScanModuleCompatibility
|
||||
avr
|
||||
)
|
||||
|
||||
|
@ -46,3 +46,11 @@ add_definitions(
|
||||
#-DKEYINDEX_MASK=epsonqx10_DefaultMap
|
||||
)
|
||||
|
||||
|
||||
###
|
||||
# Compiler Family Compatibility
|
||||
#
|
||||
set( ScanModuleCompatibility
|
||||
avr
|
||||
)
|
||||
|
||||
|
@ -46,3 +46,11 @@ add_definitions(
|
||||
#-DKEYINDEX_MASK=facom6684_DefaultMap
|
||||
)
|
||||
|
||||
|
||||
###
|
||||
# Compiler Family Compatibility
|
||||
#
|
||||
set( ScanModuleCompatibility
|
||||
avr
|
||||
)
|
||||
|
||||
|
@ -46,3 +46,11 @@ add_definitions(
|
||||
#-DKEYINDEX_MASK=hp150_DefaultMap
|
||||
)
|
||||
|
||||
|
||||
###
|
||||
# Compiler Family Compatibility
|
||||
#
|
||||
set( ScanModuleCompatibility
|
||||
avr
|
||||
)
|
||||
|
||||
|
@ -33,3 +33,11 @@ add_definitions(
|
||||
#-DKEYINDEX_MASK=heathzenith_ColemakMap
|
||||
)
|
||||
|
||||
|
||||
###
|
||||
# Compiler Family Compatibility
|
||||
#
|
||||
set( ScanModuleCompatibility
|
||||
avr
|
||||
)
|
||||
|
||||
|
@ -33,3 +33,11 @@ add_definitions(
|
||||
-DKEYINDEX_MASK=ibmconv_ColemakMap
|
||||
)
|
||||
|
||||
|
||||
###
|
||||
# Compiler Family Compatibility
|
||||
#
|
||||
set( ScanModuleCompatibility
|
||||
avr
|
||||
)
|
||||
|
||||
|
@ -28,3 +28,11 @@ add_definitions(
|
||||
-DKEYINDEX_MASK=kaypro1_DefaultMap
|
||||
)
|
||||
|
||||
|
||||
###
|
||||
# Compiler Family Compatibility
|
||||
#
|
||||
set( ScanModuleCompatibility
|
||||
avr
|
||||
)
|
||||
|
||||
|
@ -46,3 +46,12 @@ add_definitions(
|
||||
-DKEYINDEX_MASK=facom6684_DefaultMap
|
||||
)
|
||||
|
||||
|
||||
###
|
||||
# Compiler Family Compatibility
|
||||
#
|
||||
set( ScanModuleCompatibility
|
||||
arm
|
||||
avr
|
||||
)
|
||||
|
||||
|
@ -46,3 +46,11 @@ add_definitions(
|
||||
#-DKEYINDEX_MASK=microswitch8304_DefaultMap
|
||||
)
|
||||
|
||||
|
||||
###
|
||||
# Compiler Family Compatibility
|
||||
#
|
||||
set( ScanModuleCompatibility
|
||||
avr
|
||||
)
|
||||
|
||||
|
@ -33,3 +33,11 @@ add_definitions(
|
||||
-DKEYINDEX_MASK=skm67001_ColemakMap
|
||||
)
|
||||
|
||||
|
||||
###
|
||||
# Compiler Family Compatibility
|
||||
#
|
||||
set( ScanModuleCompatibility
|
||||
avr
|
||||
)
|
||||
|
||||
|
@ -46,3 +46,11 @@ add_definitions(
|
||||
-DKEYINDEX_MASK=sonynews_DefaultMap
|
||||
)
|
||||
|
||||
|
||||
###
|
||||
# Compiler Family Compatibility
|
||||
#
|
||||
set( ScanModuleCompatibility
|
||||
avr
|
||||
)
|
||||
|
||||
|
@ -45,3 +45,11 @@ add_definitions(
|
||||
#-DKEYINDEX_MASK=sonyoas3400_DefaultMap
|
||||
)
|
||||
|
||||
|
||||
###
|
||||
# Compiler Family Compatibility
|
||||
#
|
||||
set( ScanModuleCompatibility
|
||||
avr
|
||||
)
|
||||
|
||||
|
@ -28,3 +28,11 @@ add_definitions(
|
||||
#-DKEYINDEX_MASK=tandy1000_DefaultMap
|
||||
)
|
||||
|
||||
|
||||
###
|
||||
# Compiler Family Compatibility
|
||||
#
|
||||
set( ScanModuleCompatibility
|
||||
avr
|
||||
)
|
||||
|
||||
|
@ -44,3 +44,11 @@ add_definitions(
|
||||
#-DKEYINDEX_MASK=univacf3w9_DefaultMap
|
||||
)
|
||||
|
||||
|
||||
###
|
||||
# Compiler Family Compatibility
|
||||
#
|
||||
set( ScanModuleCompatibility
|
||||
avr
|
||||
)
|
||||
|
||||
|
@ -34,3 +34,11 @@ add_definitions(
|
||||
#-DKEYINDEX_MASK=
|
||||
)
|
||||
|
||||
|
||||
###
|
||||
# Compiler Family Compatibility
|
||||
#
|
||||
set( ScanModuleCompatibility
|
||||
avr
|
||||
)
|
||||
|
||||
|
@ -39,3 +39,11 @@ endif ( ${COMPILER_FAMILY} MATCHES "avr" )
|
||||
# Module Specific Options
|
||||
#
|
||||
|
||||
###
|
||||
# Compiler Family Compatibility
|
||||
#
|
||||
set( USBModuleCompatibility
|
||||
arm
|
||||
avr
|
||||
)
|
||||
|
||||
|
19
setup.cmake
19
setup.cmake
@ -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
|
||||
|
Reference in New Issue
Block a user