Skip to content

Commit 4c061a5

Browse files
authored
Disable format target when not building as the main project (#1231)
1 parent 37f1b8b commit 4c061a5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,14 @@ option(YAML_CPP_BUILD_CONTRIB "Enable yaml-cpp contrib in library" ON)
2525
option(YAML_CPP_BUILD_TOOLS "Enable parse tools" ON)
2626
option(YAML_BUILD_SHARED_LIBS "Build yaml-cpp shared library" ${BUILD_SHARED_LIBS})
2727
option(YAML_CPP_INSTALL "Enable generation of yaml-cpp install targets" ${YAML_CPP_MAIN_PROJECT})
28-
option(YAML_CPP_FORMAT_SOURCE "Format source" ON)
28+
option(YAML_CPP_FORMAT_SOURCE "Format source" ${YAML_CPP_MAIN_PROJECT})
2929
cmake_dependent_option(YAML_CPP_BUILD_TESTS
3030
"Enable yaml-cpp tests" OFF
3131
"BUILD_TESTING;YAML_CPP_MAIN_PROJECT" OFF)
3232
cmake_dependent_option(YAML_MSVC_SHARED_RT
3333
"MSVC: Build yaml-cpp with shared runtime libs (/MD)" ON
3434
"CMAKE_SYSTEM_NAME MATCHES Windows" OFF)
35-
35+
3636
if (YAML_CPP_FORMAT_SOURCE)
3737
find_program(YAML_CPP_CLANG_FORMAT_EXE NAMES clang-format)
3838
endif()

0 commit comments

Comments
 (0)