File tree Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Expand file tree Collapse file tree 1 file changed +13
-11
lines changed Original file line number Diff line number Diff line change @@ -399,20 +399,22 @@ function(add_format_validation_target MODULE_NAME MODULE_ROOT_PATH IDE_FOLDER)
399
399
set (RUN_VALIDATION_SCRIPT ./validate_format_linux.sh )
400
400
elseif (CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin" )
401
401
set (RUN_VALIDATION_SCRIPT ./validate_format_mac.sh )
402
- else ()
403
- message (FATAL_ERROR "Unexpected host system" )
404
402
endif ()
405
403
406
- # Run the format validation script
407
- add_custom_command (TARGET ${MODULE_NAME} -ValidateFormatting
408
- COMMAND ${RUN_VALIDATION_SCRIPT}
409
- WORKING_DIRECTORY "${MODULE_ROOT_PATH} /BuildTools/FormatValidation"
410
- COMMENT "Validating ${MODULE_NAME} module's source code formatting..."
411
- VERBATIM
412
- )
404
+ if (RUN_VALIDATION_SCRIPT )
405
+ # Run the format validation script
406
+ add_custom_command (TARGET ${MODULE_NAME} -ValidateFormatting
407
+ COMMAND ${RUN_VALIDATION_SCRIPT}
408
+ WORKING_DIRECTORY "${MODULE_ROOT_PATH} /BuildTools/FormatValidation"
409
+ COMMENT "Validating ${MODULE_NAME} module's source code formatting..."
410
+ VERBATIM
411
+ )
413
412
414
- if (TARGET ${MODULE_NAME} -ValidateFormatting )
415
- set_target_properties (${MODULE_NAME} -ValidateFormatting PROPERTIES FOLDER ${IDE_FOLDER} )
413
+ if (TARGET ${MODULE_NAME} -ValidateFormatting )
414
+ set_target_properties (${MODULE_NAME} -ValidateFormatting PROPERTIES FOLDER ${IDE_FOLDER} )
415
+ endif ()
416
+ else ()
417
+ message (DEBUG "${MODULE_NAME} -ValidateFormatting target will be disabled because format validation script is not available on ${CMAKE_HOST_SYSTEM_NAME} host platform." )
416
418
endif ()
417
419
418
420
endfunction ()
You can’t perform that action at this time.
0 commit comments