]>
Commit | Line | Data |
---|---|---|
7017ceb2 JR |
1 | --- oiio-2.3.12.0/src/cmake/compiler.cmake.orig 2022-02-05 17:02:29.480576995 +0100 |
2 | +++ oiio-2.3.12.0/src/cmake/compiler.cmake 2022-02-05 17:03:59.121664048 +0100 | |
3 | @@ -432,54 +432,6 @@ | |
32c56ab5 | 4 | |
7017ceb2 JR |
5 | |
6 | ########################################################################### | |
7 | -# clang-format options | |
8 | -# | |
9 | -# clang-format is a source code reformatter that is part of the LLVM tools. | |
10 | -# It can be used to check adherence to project code formatting rules and | |
11 | -# correct any deviations. If clang-format is found on the system, a | |
12 | -# "clang-format" build target will trigger a reformatting. | |
13 | -# | |
14 | -# Note: skip all of this checking, setup, and cmake-format target if this | |
15 | -# is being built as a subproject. | |
16 | -if (PROJECT_IS_TOP_LEVEL) | |
17 | - set (CLANG_FORMAT_EXE_HINT "" CACHE PATH "clang-format executable's directory (will search if not specified") | |
18 | - set (CLANG_FORMAT_INCLUDES "src/*.h" "src/*.cpp" | |
19 | - CACHE STRING "Glob patterns to include for clang-format") | |
20 | - set (CLANG_FORMAT_EXCLUDES "*pugixml*" "*SHA1*" "*/farmhash.cpp" | |
21 | - "src/dpx.imageio/libdpx/*" | |
22 | - "src/cineon.imageio/libcineon/*" | |
23 | - "src/dds.imageio/squish/*" | |
24 | - "src/gif.imageio/gif.h" | |
25 | - "src/hdr.imageio/rgbe.cpp" | |
26 | - "src/libutil/stb_sprintf.h" | |
27 | - CACHE STRING "Glob patterns to exclude for clang-format") | |
28 | - find_program (CLANG_FORMAT_EXE | |
29 | - NAMES clang-format bin/clang-format | |
30 | - HINTS ${CLANG_FORMAT_EXE_HINT} ENV CLANG_FORMAT_EXE_HINT | |
31 | - ENV LLVM_DIRECTORY | |
32 | - NO_DEFAULT_PATH | |
33 | - DOC "Path to clang-format executable") | |
34 | - find_program (CLANG_FORMAT_EXE NAMES clang-format bin/clang-format) | |
35 | - if (CLANG_FORMAT_EXE) | |
36 | - message (STATUS "clang-format found: ${CLANG_FORMAT_EXE}") | |
37 | - # Start with the list of files to include when formatting... | |
38 | - file (GLOB_RECURSE FILES_TO_FORMAT ${CLANG_FORMAT_INCLUDES}) | |
39 | - # ... then process any list of excludes we are given | |
40 | - foreach (_pat ${CLANG_FORMAT_EXCLUDES}) | |
41 | - file (GLOB_RECURSE _excl ${_pat}) | |
42 | - list (REMOVE_ITEM FILES_TO_FORMAT ${_excl}) | |
43 | - endforeach () | |
44 | - #message (STATUS "clang-format file list: ${FILES_TO_FORMAT}") | |
45 | - file (COPY ${CMAKE_CURRENT_SOURCE_DIR}/.clang-format | |
46 | - DESTINATION ${CMAKE_CURRENT_BINARY_DIR}) | |
47 | - add_custom_target (clang-format | |
48 | - COMMAND "${CLANG_FORMAT_EXE}" -i -style=file ${FILES_TO_FORMAT} ) | |
49 | - else () | |
50 | - message (STATUS "clang-format not found.") | |
51 | - endif () | |
32c56ab5 JR |
52 | -endif () |
53 | - | |
7017ceb2 JR |
54 | -########################################################################### |
55 | # Another way to sneak in custom compiler and DSO linking flags. | |
56 | # | |
57 | set (EXTRA_CPP_ARGS "" CACHE STRING "Extra C++ command line definitions") |