Skip to content

Commit

Permalink
Disabled format validations on platforms that don't have format valid…
Browse files Browse the repository at this point in the history
…ation script
  • Loading branch information
TheMostDiligent authored and LadySerenaKitty committed Feb 2, 2024
1 parent ede75ed commit 204008a
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions BuildTools/CMake/BuildUtils.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -401,20 +401,22 @@ function(add_format_validation_target MODULE_NAME MODULE_ROOT_PATH IDE_FOLDER)
set(RUN_VALIDATION_SCRIPT ./validate_format_freebsd.sh)
elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin")
set(RUN_VALIDATION_SCRIPT ./validate_format_mac.sh)
else()
message(FATAL_ERROR "Unexpected host system")
endif()

# Run the format validation script
add_custom_command(TARGET ${MODULE_NAME}-ValidateFormatting
COMMAND ${RUN_VALIDATION_SCRIPT}
WORKING_DIRECTORY "${MODULE_ROOT_PATH}/BuildTools/FormatValidation"
COMMENT "Validating ${MODULE_NAME} module's source code formatting..."
VERBATIM
)
if (RUN_VALIDATION_SCRIPT)
# Run the format validation script
add_custom_command(TARGET ${MODULE_NAME}-ValidateFormatting
COMMAND ${RUN_VALIDATION_SCRIPT}
WORKING_DIRECTORY "${MODULE_ROOT_PATH}/BuildTools/FormatValidation"
COMMENT "Validating ${MODULE_NAME} module's source code formatting..."
VERBATIM
)

if(TARGET ${MODULE_NAME}-ValidateFormatting)
set_target_properties(${MODULE_NAME}-ValidateFormatting PROPERTIES FOLDER ${IDE_FOLDER})
if(TARGET ${MODULE_NAME}-ValidateFormatting)
set_target_properties(${MODULE_NAME}-ValidateFormatting PROPERTIES FOLDER ${IDE_FOLDER})
endif()
else()
message(DEBUG "${MODULE_NAME}-ValidateFormatting target will be disabled because format validation script is not available on ${CMAKE_HOST_SYSTEM_NAME} host platform.")
endif()

endfunction()
Expand Down

0 comments on commit 204008a

Please sign in to comment.