From 8af28e46be0fd5f79ceb8e0b4576f592170aae50 Mon Sep 17 00:00:00 2001 From: Chris Marsh Date: Wed, 29 Nov 2017 09:50:22 -0800 Subject: [PATCH] Disable code formatting on CI builds. --- CMakeLists.txt | 5 ----- build.py | 3 +++ src/CMakeLists.txt | 4 +++- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 21249ee..0b94137 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -25,11 +25,6 @@ if (CLANG_FORMAT_CMD) DEPENDS ${ALL_SOURCE_FILES} ) -else(CLANG_FORMAT_CMD) - add_custom_target( - clangformat - COMMENT "no clang format" - ) endif(CLANG_FORMAT_CMD) # thirdparty stuff diff --git a/build.py b/build.py index 477e761..922cb1f 100755 --- a/build.py +++ b/build.py @@ -79,6 +79,9 @@ def build_lib(build_name, generator, options): ] if generator: initial_cmake.extend(['-G', generator]) + if IS_BUILD_MACHINE: + # disable formatting on CI builds + initial_cmake.append('-DCLANG_FORMAT_SUFFIX=none') for key in options: val = 'ON' if options[key] else 'OFF' initial_cmake.append('-D%s=%s' % (key, val)) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 9b85fb4..f183f26 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -106,7 +106,9 @@ if (${BUILD_SHARED_LIBS}) target_compile_definitions(discord-rpc PRIVATE -DDISCORD_BUILDING_SDK) endif(${BUILD_SHARED_LIBS}) -add_dependencies(discord-rpc clangformat) +if (CLANG_FORMAT_CMD) + add_dependencies(discord-rpc clangformat) +endif(CLANG_FORMAT_CMD) # install