File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ include(FeatureSummary)
3333################ OPTIONS ##################
3434# Optional build settings for libopenshot
3535OPTION (USE_SYSTEM_JSONCPP "Use system installed JsonCpp" OFF )
36- option (ENABLE_IWYU "Enable 'Include What You Use' scanner" OFF )
36+ option (ENABLE_IWYU "Enable 'Include What You Use' scanner (CMake 3.3+) " OFF )
3737
3838################ WINDOWS ##################
3939# Set some compiler options for Windows
@@ -165,15 +165,20 @@ endif(USE_SYSTEM_JSONCPP)
165165#set(PROFILER "/usr/lib/libprofiler.so.0.3.2")
166166#set(PROFILER "/usr/lib/libtcmalloc.so.4")
167167
168+ if (CMAKE_VERSION VERSION_LESS 3.3)
169+ # IWYU wasn't supported internally in 3.2
170+ set (ENABLE_IWYU FALSE )
171+ endif ()
172+
168173if (ENABLE_IWYU)
169174 find_program (IWYU_PATH NAMES "iwyu"
170175 DOC "include-what-you-use source code scanner executable" )
171176 if (IWYU_PATH)
172177 if (IWYU_OPTS)
173178 separate_arguments (IWYU_OPTS)
174- list (APPEND _iwyu_cmd ${IWYU_PATH} "-Xiwyu" ${IWYU_OPTS} )
179+ list (APPEND _iwyu_opts "-Xiwyu" ${IWYU_OPTS} )
175180 endif ()
176- set (CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${_iwyu_cmd } )
181+ set (CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${IWYU_PATH} ${_iwyu_opts } )
177182 else ()
178183 set (ENABLE_IWYU FALSE )
179184 endif ()
You can’t perform that action at this time.
0 commit comments