diff --git a/BuildTools/CMake/BuildUtils.cmake b/BuildTools/CMake/BuildUtils.cmake index 034fe508fa..dd158300b5 100644 --- a/BuildTools/CMake/BuildUtils.cmake +++ b/BuildTools/CMake/BuildUtils.cmake @@ -397,8 +397,6 @@ function(add_format_validation_target MODULE_NAME MODULE_ROOT_PATH IDE_FOLDER) set(RUN_VALIDATION_SCRIPT validate_format_win.bat) elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") set(RUN_VALIDATION_SCRIPT ./validate_format_linux.sh) - elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD") - set(RUN_VALIDATION_SCRIPT ./validate_format_freebsd.sh) elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") set(RUN_VALIDATION_SCRIPT ./validate_format_mac.sh) endif() diff --git a/BuildTools/CMakeLists.txt b/BuildTools/CMakeLists.txt index b371f1edcd..539bfb4c04 100644 --- a/BuildTools/CMakeLists.txt +++ b/BuildTools/CMakeLists.txt @@ -8,8 +8,6 @@ elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Linux") set(CLANG_FORMAT_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}/FormatValidation/clang-format_linux_10.0.0" CACHE INTERNAL "clang-format executable path") elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "Darwin") set(CLANG_FORMAT_EXECUTABLE "${CMAKE_CURRENT_SOURCE_DIR}/FormatValidation/clang-format_mac_10.0.0" CACHE INTERNAL "clang-format executable path") -elseif(CMAKE_HOST_SYSTEM_NAME STREQUAL "FreeBSD") - set(CLANG_FORMAT_EXECUTABLE "/usr/local/llvm10/bin/clang-format" CACHE INTERNAL "clang-format executable path") endif() if (NOT EXISTS ${CLANG_FORMAT_EXECUTABLE}) diff --git a/BuildTools/FormatValidation/validate_format_freebsd.sh b/BuildTools/FormatValidation/validate_format_freebsd.sh deleted file mode 100644 index ac6499aefa..0000000000 --- a/BuildTools/FormatValidation/validate_format_freebsd.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/usr/local/bin/bash - -source validate_format_freebsd_implementation.sh - -validate_format ../../Common ../../Graphics ../../Platforms ../../Primitives ../../Tests \ - --exclude ../../Graphics/HLSL2GLSLConverterLib/include/GLSLDefinitions.h \ - --exclude ../../Graphics/HLSL2GLSLConverterLib/include/GLSLDefinitions_inc.h \ - --exclude ../../Graphics/GraphicsEngineVulkan/shaders \ - --exclude ../../Graphics/GraphicsEngine.NET \ - --exclude ../../Tests/DiligentCoreAPITest/assets - diff --git a/BuildTools/FormatValidation/validate_format_freebsd_implementation.sh b/BuildTools/FormatValidation/validate_format_freebsd_implementation.sh deleted file mode 100644 index b35c498aa1..0000000000 --- a/BuildTools/FormatValidation/validate_format_freebsd_implementation.sh +++ /dev/null @@ -1,52 +0,0 @@ -#!/usr/local/bin/bash - -## Get the path of this file no matter where it is called from -## Solution from: https://stackoverflow.com/a/246128/2140449 -VALIDATE_FORMAT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" - -errcho(){ echo "$@" 1>&2; } - -function find_validator_bin() { - local BIN=$(find "$VALIDATE_FORMAT_DIR" -name 'clang-format_freebsd_*') - - ## Try to launch the bin - eval "$BIN --version >/dev/null 2> /dev/null" - if [ $? -ne 0 ]; then - ## BIN failed to run, try to get a system installed clang-format - local SYS_BIN=$(which clang-format 2> /dev/null) - if [ $? -ne 0 ]; then - errcho "WARNING: skipping format validation as no suitable executable was found" - BIN="" - else - local BIN_VERSION=$(echo $BIN | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+') - local SYS_BIN_VERSION=$(eval "$SYS_BIN --version" | grep -Eo '[0-9]+\.[0-9]+\.[0-9]+') - if [ "$BIN_VERSION" != "$SYS_BIN_VERSION" ]; then - errcho "WARNING: could not load the provided clang-format for validation." - errcho " clang-format exists in the system path however its version is $SYS_BIN_VERSION instead of $BIN_VERSION" - errcho " Should the validation fail, you can try skipping it by setting the cmake option:" - errcho " DILIGENT_NO_FORMAT_VALIDATION" - fi - BIN="$SYS_BIN" - fi - fi - echo "$BIN" -} - -function validate_format() { - local BIN=$(find_validator_bin) - if [ ! -z "$BIN" ]; then - python3.9 "$VALIDATE_FORMAT_DIR/clang-format-validate.py" --clang-format-executable "$BIN" -r "$@" - fi -} - -## Example usage: -# -# #!/bin/bash -# source /PATH/TO/THIS/FILE/validate_format_linux_implementation.sh -# -# validate_format ../../Common ../../Graphics ../../Platforms ../../Primitives ../../Tests \ -# --exclude ../../Graphics/HLSL2GLSLConverterLib/include/GLSLDefinitions.h \ -# --exclude ../../Graphics/HLSL2GLSLConverterLib/include/GLSLDefinitions_inc.h \ -# --exclude ../../Graphics/GraphicsEngineVulkan/shaders/GenerateMipsCS_inc.h \ -# --exclude ../../Tests/DiligentCoreAPITest/assets/* -#