Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Libretro
Citra2018
Commits
6d651691
Commit
6d651691
authored
Mar 10, 2018
by
James
Browse files
Add mechanism to disable Clang formatting
parent
b200c7f2
Changes
1
Hide whitespace changes
Inline
Side-by-side
CMakeLists.txt
View file @
6d651691
...
...
@@ -26,6 +26,8 @@ option(USE_DISCORD_PRESENCE "Enables Discord Rich Presence" OFF)
option
(
ENABLE_SCRIPTING
"Enables scripting support"
ON
)
option
(
DISABLE_CLANG_TARGET
"Disables the Clang format check"
ON
)
if
(
NOT EXISTS
${
CMAKE_SOURCE_DIR
}
/.git/hooks/pre-commit
)
message
(
STATUS
"Copying pre-commit hook"
)
file
(
COPY hooks/pre-commit
...
...
@@ -310,7 +312,7 @@ find_program(CLANG_FORMAT
clang-format
PATHS
${
CMAKE_BINARY_DIR
}
/externals
)
# if find_program doesn't find it, try to download from externals
if
(
NOT CLANG_FORMAT
)
if
(
NOT CLANG_FORMAT
AND NOT DISABLE_CLANG_TARGET
)
if
(
WIN32
)
message
(
STATUS
"Clang format not found! Downloading..."
)
set
(
CLANG_FORMAT
"
${
CMAKE_BINARY_DIR
}
/externals/clang-format
${
CLANG_FORMAT_POSTFIX
}
.exe"
)
...
...
@@ -328,7 +330,7 @@ if (NOT CLANG_FORMAT)
endif
()
endif
()
if
(
CLANG_FORMAT
)
if
(
CLANG_FORMAT
AND NOT DISABLE_CLANG_TARGET
)
set
(
SRCS
${
CMAKE_SOURCE_DIR
}
/src
)
set
(
CCOMMENT
"Running clang format against all the .h and .cpp files in src/"
)
if
(
WIN32
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment