Mercurial > louis > kiibohd-controller
comparison Lib/CMake/build.cmake @ 428:b5746c43904e
Fixing clang compilation and supporting clang-tidy
- clang.c includes necessary functions to make clang compiler work (tested on teensy 3.1)
- Added support code to generate a compile_commands.json for clang-tidy
* Updates the symlink whenever cmake or make is called (Unix OSs only)
author | Jacob Alexander <haata@kiibohd.com> |
---|---|
date | Fri, 04 Mar 2016 00:23:48 -0800 |
parents | 39f84a603350 |
children | 1a2fb67b0237 |
comparison
equal
deleted
inserted
replaced
427:f17857f4ca14 | 428:b5746c43904e |
---|---|
133 else() | 133 else() |
134 configure_file( LoadFile/load.teensy load NEWLINE_STYLE UNIX ) | 134 configure_file( LoadFile/load.teensy load NEWLINE_STYLE UNIX ) |
135 endif() | 135 endif() |
136 endif() | 136 endif() |
137 | 137 |
138 | |
139 | |
140 ### | |
141 # Compiler Command Generation | |
142 # | |
143 | |
144 #| Generate list of compiler commands for clang-tidy usage | |
145 set( CMAKE_EXPORT_COMPILE_COMMANDS ON ) | |
146 | |
147 #| Make sure symlink exists (for convenience) | |
148 if ( UNIX ) | |
149 # Make sure symlink is created immediately | |
150 execute_process ( COMMAND ln -sfn ${CMAKE_BINARY_DIR}/compile_commands.json ${CMAKE_SOURCE_DIR}/. ) | |
151 | |
152 # Also update before each build | |
153 add_custom_command( TARGET ${TARGET_ELF} POST_BUILD | |
154 COMMAND ln -sfn ${CMAKE_BINARY_DIR}/compile_commands.json ${CMAKE_SOURCE_DIR}/. | |
155 ) | |
156 endif () | |
157 |