mirror of
https://github.com/osiweb/unified_retro_keyboard.git
synced 2024-10-07 17:55:07 +00:00
e9c38e3c51
- CMake build process handles dependencies much more effectively - Cleaner separation of test and binary builds - permit co-existing test and multiple architecture builds - add support for AVR from cmake-avr: https://github.com/mkleemann/cmake-avr - new build process avoids creating files in the src directory
72 lines
1.4 KiB
CMake
72 lines
1.4 KiB
CMake
|
|
set (KEYMAP "production")
|
|
|
|
message("C compiler: ${CMAKE_C_COMPILER}")
|
|
|
|
temporary_config_file(${ASDF_SRC_DIR}/Arch/asdf_arch_${ARCH}.h ${CMAKE_CURRENT_BINARY_DIR}/asdf_arch.h)
|
|
temporary_config_file(${ASDF_SRC_DIR}/Arch/asdf_arch_${ARCH}.c ${CMAKE_CURRENT_BINARY_DIR}/asdf_arch.c)
|
|
temporary_config_file(${ASDF_SRC_DIR}/Keymaps/asdf_all_keymap_defs_${KEYMAP}.h ${CMAKE_CURRENT_BINARY_DIR}/asdf_keymap_defs.h)
|
|
|
|
|
|
list(APPEND C_FLAGS
|
|
-std=c99
|
|
-Wall
|
|
-funsigned-char
|
|
-funsigned-bitfields
|
|
-ffunction-sections
|
|
-fdata-sections
|
|
-fpack-struct
|
|
-fshort-enums
|
|
-O2
|
|
-Wall
|
|
-Wextra
|
|
-Wpointer-arith
|
|
-Wcast-align
|
|
-Wwrite-strings
|
|
-Wswitch-default
|
|
-Wunreachable-code
|
|
-Winit-self
|
|
-Wmissing-field-initializers
|
|
-Wno-unknown-pragmas
|
|
-Wstrict-prototypes
|
|
-Wundef
|
|
-Wold-style-definition
|
|
)
|
|
|
|
list (APPEND SOURCES
|
|
asdf.c
|
|
${CMAKE_CURRENT_BINARY_DIR}/asdf_arch.c
|
|
asdf_buffer.c
|
|
asdf_hook.c
|
|
asdf_keymaps.c
|
|
asdf_modifiers.c
|
|
asdf_physical.c
|
|
asdf_repeat.c
|
|
asdf_virtual.c
|
|
main.c
|
|
)
|
|
|
|
# add the executable
|
|
if (COMMAND custom_add_executable)
|
|
custom_add_executable(${ASDF_TARGET_NAME}
|
|
${SOURCES}
|
|
)
|
|
else()
|
|
add_executable(${ASDF_TARGET_NAME})
|
|
endif()
|
|
|
|
target_include_directories(${ASDF_EXECUTABLE_TARGET_NAME}
|
|
PRIVATE
|
|
${CMAKE_CURRENT_BINARY_DIR}
|
|
${CMAKE_CURRENT_SOURCE_DIR}
|
|
)
|
|
|
|
target_compile_options(${ASDF_EXECUTABLE_TARGET_NAME}
|
|
PRIVATE
|
|
${CFLAGS}
|
|
)
|
|
|
|
|
|
|
|
|