aboutsummaryrefslogtreecommitdiffstats
path: root/CMakeLists.txt
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-06-03 00:31:29 +0200
committerClifford Wolf <clifford@clifford.at>2018-06-03 00:31:29 +0200
commit8b854a9e2867ef78bf7b38974c5819a47b3f03de (patch)
treec4eb554e1c40d78768ef52e24237d496cac49e26 /CMakeLists.txt
parent20d7cd019434a2a4213b5babc80b9c8c0e507211 (diff)
downloadnextpnr-8b854a9e2867ef78bf7b38974c5819a47b3f03de.tar.gz
nextpnr-8b854a9e2867ef78bf7b38974c5819a47b3f03de.tar.bz2
nextpnr-8b854a9e2867ef78bf7b38974c5819a47b3f03de.zip
Add "clangformat" make target and .clang-format (for now with std LLVM style)
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt11
1 files changed, 11 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index a2857d71..02919994 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -66,3 +66,14 @@ foreach (family ${FAMILIES})
target_link_libraries(${target} LINK_PUBLIC ${Boost_LIBRARIES} ${PYTHON_LIBRARIES})
endforeach (target)
endforeach (family)
+
+file(GLOB_RECURSE CLANGFORMAT_FILES *.cc *.h)
+string(REGEX REPLACE "[^;]*/ice40/chipdbs/chipdb-[^ ]*.cc" "" CLANGFORMAT_FILES "${CLANGFORMAT_FILES}")
+
+add_custom_target(
+ clangformat
+ COMMAND clang-format
+ -style=file
+ -i
+ ${CLANGFORMAT_FILES}
+)