You've already forked libopenshot
mirror of
https://github.com/OpenShot/libopenshot.git
synced 2026-03-02 08:53:52 -08:00
Add ENABLE_IWTU CMake option
Add CMake handling for `-DENABLE_IWYU=1" to enable scanning with include-what-you-use (if `iwyu` binary is found in PATH), and e.g. `-DIWYU_OPTS="--max_line_length=120 --verbose=1"` to supply args.
This commit is contained in:
@@ -36,6 +36,7 @@ include(FeatureSummary)
|
||||
################ OPTIONS ##################
|
||||
# Optional build settings for libopenshot
|
||||
OPTION(USE_SYSTEM_JSONCPP "Use system installed JsonCpp" OFF)
|
||||
option(ENABLE_IWYU "Enable 'Include What You Use' scanner" OFF)
|
||||
|
||||
################ WINDOWS ##################
|
||||
# Set some compiler options for Windows
|
||||
@@ -181,6 +182,21 @@ endif(USE_SYSTEM_JSONCPP)
|
||||
#set(PROFILER "/usr/lib/libprofiler.so.0.3.2")
|
||||
#set(PROFILER "/usr/lib/libtcmalloc.so.4")
|
||||
|
||||
if(ENABLE_IWYU)
|
||||
find_program(IWYU_PATH NAMES "iwyu"
|
||||
DOC "include-what-you-use source code scanner executable")
|
||||
if(IWYU_PATH)
|
||||
if(IWYU_OPTS)
|
||||
separate_arguments(IWYU_OPTS)
|
||||
list(APPEND _iwyu_cmd ${IWYU_PATH} "-Xiwyu" ${IWYU_OPTS})
|
||||
endif()
|
||||
set(CMAKE_CXX_INCLUDE_WHAT_YOU_USE ${_iwyu_cmd})
|
||||
else()
|
||||
set(ENABLE_IWYU FALSE)
|
||||
endif()
|
||||
endif()
|
||||
add_feature_info("IWYU (include-what-you-use)" ENABLE_IWYU "Scan all source files with 'iwyu'")
|
||||
|
||||
#### GET LIST OF EFFECT FILES ####
|
||||
FILE(GLOB EFFECT_FILES "${CMAKE_CURRENT_SOURCE_DIR}/effects/*.cpp")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user