Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
4 changes: 3 additions & 1 deletion Engine/lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,12 @@ set(PNG_STATIC on CACHE BOOL "" FORCE)
mark_as_advanced(PNG_STATIC)
set(PNG_SHARED off CACHE BOOL "" FORCE)
mark_as_advanced(PNG_SHARED)
set(PNG_BUILD_ZLIB on CACHE BOOL "" FORCE)
set(PNG_BUILD_ZLIB OFF CACHE BOOL "" FORCE)
mark_as_advanced(PNG_BUILD_ZLIB)
set(PNG_TESTS off CACHE BOOL "" FORCE)
mark_as_advanced(PNG_TESTS)
set(PNG_HARDWARE_OPTIMIZATIONS on CACHE BOOL "" FORCE)
set(SKIP_INSTALL_ALL ON CACHE BOOL "" FORCE)
mark_as_advanced(PNG_HARDWARE_OPTIMIZATIONS)

if(APPLE)
Expand All @@ -186,6 +187,7 @@ endif()
mark_as_advanced(PNG_DEBUG)
mark_as_advanced(PNG_FRAMEWORK)
mark_as_advanced(PNG_PREFIX)
add_subdirectory(lpng ${TORQUE_LIB_TARG_DIRECTORY}/lpng EXCLUDE_FROM_ALL)

add_subdirectory(tinyxml2 ${TORQUE_LIB_TARG_DIRECTORY}/tinyxml2 EXCLUDE_FROM_ALL)
add_subdirectory(opcode ${TORQUE_LIB_TARG_DIRECTORY}/opcode EXCLUDE_FROM_ALL)
Expand Down
81 changes: 81 additions & 0 deletions Engine/lib/lpng/.appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
version: 1.6.x-{build}

branches:
except:
- /master/
- /v[0-9]+[.][0-9]+[.][0-9]+/

image:
- Visual Studio 2022

shallow_clone: true

environment:
matrix:
- TOOLCHAIN: vstudio
AUTOMATION: cmake
ARCH: x86
- TOOLCHAIN: vstudio
AUTOMATION: cmake
ARCH: x64
- TOOLCHAIN: vstudio
AUTOMATION: cmake
ARCH: arm64
- TOOLCHAIN: llvm
AUTOMATION: cmake
ARCH: x64
- TOOLCHAIN: msys2
AUTOMATION: cmake
ARCH: i686
- TOOLCHAIN: msys2
AUTOMATION: cmake
ARCH: x86_64
- TOOLCHAIN: msys2
AUTOMATION: configure
ARCH: i686
- TOOLCHAIN: msys2
AUTOMATION: configure
ARCH: x86_64
- TOOLCHAIN: msys2
AUTOMATION: makefiles
ARCH: i686
- TOOLCHAIN: msys2
AUTOMATION: makefiles
ARCH: x86_64

install:
- 'if "%TOOLCHAIN%"=="vstudio" C:\tools\vcpkg\vcpkg.exe install zlib:%ARCH%-windows'
- 'if "%TOOLCHAIN%"=="vstudio" C:\tools\vcpkg\vcpkg.exe integrate install'
- 'if "%TOOLCHAIN%"=="llvm" C:\tools\vcpkg\vcpkg.exe install zlib:%ARCH%-windows'
- 'if "%TOOLCHAIN%"=="llvm" C:\tools\vcpkg\vcpkg.exe integrate install'
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="cmake" C:\msys64\usr\bin\pacman.exe -S --noconfirm mingw-w64-%ARCH%-cmake mingw-w64-%ARCH%-ninja'

before_build:
- 'if "%TOOLCHAIN%"=="vstudio" set CI_CMAKE_GENERATOR=Visual Studio 17 2022'
- 'if "%TOOLCHAIN%"=="vstudio" set CI_CMAKE_TOOLCHAIN_FILE=C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake'
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="x86" set CI_CMAKE_GENERATOR_PLATFORM=Win32'
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="x64" set CI_CMAKE_GENERATOR_PLATFORM=x64'
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="arm64" set CI_CMAKE_GENERATOR_PLATFORM=ARM64'
- 'if "%TOOLCHAIN%"=="vstudio" if "%ARCH%"=="arm64" set CI_CMAKE_VARS=-DPNG_TESTS=0'
- 'if "%TOOLCHAIN%"=="llvm" set CI_CMAKE_GENERATOR=Ninja'
- 'if "%TOOLCHAIN%"=="llvm" set CI_CMAKE_TOOLCHAIN_FILE=C:\tools\vcpkg\scripts\buildsystems\vcpkg.cmake'
- 'if "%TOOLCHAIN%"=="llvm" set CI_CC=clang'
- 'if "%TOOLCHAIN%"=="msys2" set CI_CMAKE_GENERATOR=Ninja'
- 'if "%TOOLCHAIN%"=="msys2" set CI_CC=gcc'
- 'if "%TOOLCHAIN%"=="msys2" if "%ARCH%"=="i686" set MSYSTEM=MINGW32'
- 'if "%TOOLCHAIN%"=="msys2" if "%ARCH%"=="x86_64" set MSYSTEM=MINGW64'
- 'set CI_CMAKE_BUILD_FLAGS=-j2'
- 'set CI_CTEST_FLAGS=-j2'
- 'set CI_MAKE_FLAGS=-j2'
- 'set CI_MAKEFILES=scripts/makefile.gcc scripts/makefile.msys scripts/makefile.std'

build_script:
- 'if "%TOOLCHAIN%"=="vstudio" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_cmake.sh"'
- 'if "%TOOLCHAIN%"=="llvm" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_cmake.sh"'
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="cmake" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_cmake.sh"'
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="configure" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_configure.sh"'
- 'if "%TOOLCHAIN%"=="msys2" if "%AUTOMATION%"=="makefiles" C:\msys64\usr\bin\bash.exe -l "%APPVEYOR_BUILD_FOLDER%\ci\ci_verify_makefiles.sh"'

cache:
- 'C:\tools\vcpkg\installed'
- 'C:\msys64\var\cache\pacman'
94 changes: 94 additions & 0 deletions Engine/lib/lpng/.cmake-format.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
# https://pypi.org/project/cmakelang
# https://github.com/cheshirekow/cmake_format

# ----------------------
# Options for formatting
# ----------------------

# How wide to allow formatted cmake files
# TODO: Reflow the CMake files to allow setting the maximum line width to 100.
line_width: 255

# How many spaces to tab for indent
tab_size: 2

# If true, lines are indented using tab characters (utf-8 0x09) instead of
# <tab_size> space characters (utf-8 0x20). In cases where the layout would
# require a fractional tab character, the behavior of the fractional
# indentation is governed by <fractional_tab_policy>
use_tabchars: false

# If <use_tabchars> is True, then the value of this variable indicates how
# fractional indentions are handled during whitespace replacement. If set to
# 'use-space', fractional indentation is left as spaces (utf-8 0x20). If set
# to `round-up` fractional indentation is replaced with a single tab character
# (utf-8 0x09) effectively shifting the column to the next tabstop
fractional_tab_policy: "use-space"

# Enable comment markup parsing and reflow
enable_markup: false

# -------------------
# Options for linting
# -------------------

# Lint codes to disable
disabled_codes: [
# TODO:
# Reconcile the CMake variable names with the patterns below, then
# re-enable the "invalid variable name XXX" messages.
"C0103",

# TODO:
# Add brief COMMENT arguments to the `add_custom_target` commands.
"C0113",
]

# Regular expression pattern describing valid function names
function_pattern: "[0-9a-z_]+"

# Regular expression pattern describing valid macro names
macro_pattern: "[0-9A-Z_]+"

# Regular expression pattern describing valid names for variables with global
# (cache) scope
global_var_pattern: "[A-Z][0-9A-Z_]+"

# Regular expression pattern describing valid names for variables with global
# scope (but internal semantic)
internal_var_pattern: "_[A-Z][0-9A-Z_]+"

# Regular expression pattern describing valid names for variables with local
# scope
local_var_pattern: "[a-z][a-z0-9_]+"

# Regular expression pattern describing valid names for privatedirectory
# variables
private_var_pattern: "_[0-9a-z_]+"

# Regular expression pattern describing valid names for public directory
# variables
public_var_pattern: "[A-Z][0-9A-Z_]+"

# Regular expression pattern describing valid names for function/macro
# arguments and loop variables.
argument_var_pattern: "[a-z][a-z0-9_]+"

# Regular expression pattern describing valid names for keywords used in
# functions or macros
keyword_pattern: "[A-Z][0-9A-Z_]+"

# In the heuristic for C0201, how many conditionals to match within a loop in
# before considering the loop a parser
max_conditionals_custom_parser: 2

# Require at least this many newlines between statements;
# require no more than this many newlines between statements;
# etc.
min_statement_spacing: 1
max_statement_spacing: 2
max_returns: 6
max_branches: 12
max_arguments: 5
max_localvars: 15
max_statements: 50
55 changes: 55 additions & 0 deletions Engine/lib/lpng/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# https://editorconfig.org

root = true

[*]
charset = utf-8
insert_final_newline = true
trim_trailing_whitespace = true

[*.txt]
indent_size = unset
indent_style = space

[*.[chS]]
indent_size = 3
indent_style = space
max_doc_length = 80
max_line_length = 80

[*.dfa]
indent_size = 3
indent_style = space
max_doc_length = 80
max_line_length = 80

[*.awk]
indent_size = 3
indent_style = space
max_doc_length = 80
max_line_length = 100

[*.cmake]
indent_size = 2
indent_style = space
max_doc_length = 80
max_line_length = 100

[*.sh]
indent_size = 4
indent_style = space
max_doc_length = 100
max_line_length = 100

[{Makefile.in,aclocal.m4,ltmain.sh}]
indent_size = unset
indent_style = unset
insert_final_newline = unset
max_doc_length = unset
max_line_length = unset
trim_trailing_whitespace = unset

[COMMIT_EDITMSG]
indent_style = space
max_doc_length = unset
max_line_length = 72
10 changes: 10 additions & 0 deletions Engine/lib/lpng/.editorconfig-checker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"Disable": {
"Charset": true,
"IndentSize": true
},
"Exclude": [
".git/",
"out/"
]
}
31 changes: 31 additions & 0 deletions Engine/lib/lpng/.github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Linting libpng

on:
push:
branches:
- libpng16
- libpng18
pull_request:
branches:
- libpng16
- libpng18

jobs:
lint:
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Set up the cache
uses: actions/cache@v4
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/pip.txt') }}
restore-keys: ${{ runner.os }}-pip-
- name: Install yamllint
run: pip install yamllint
- name: Install editorconfig-checker
uses: editorconfig-checker/action-editorconfig-checker@main
- name: Check out the code
uses: actions/checkout@v4
- name: Run the linting script
run: bash ./ci/ci_lint.sh
32 changes: 32 additions & 0 deletions Engine/lib/lpng/.github/workflows/verify-linux.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Verifying libpng on Linux

on:
push:
branches:
- libpng16
- libpng18
pull_request:
branches:
- libpng16
- libpng18

jobs:
verify-linux:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -y --no-install-recommends build-essential zlib1g-dev
if [[ "${{ github.ref }}" != refs/*/libpng16 && "${{ github.base_ref }}" != libpng16 ]]
then
sudo apt-get install -y --no-install-recommends autoconf automake libtool m4
fi
- name: Check out the code
uses: actions/checkout@v4
- name: Run the configure verification script
run: bash ./ci/ci_verify_configure.sh
env:
CI_MAKE_FLAGS: -j2
CI_SANITIZERS: address,undefined
25 changes: 25 additions & 0 deletions Engine/lib/lpng/.github/workflows/verify-macos.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Verifying libpng on macOS

on:
push:
branches:
- libpng16
- libpng18
pull_request:
branches:
- libpng16
- libpng18

jobs:
verify-macos:
runs-on: macos-latest
timeout-minutes: 10
steps:
- name: Check out the code
uses: actions/checkout@v4
- name: Run the CMake verification script
run: bash ./ci/ci_verify_cmake.sh
env:
CI_CMAKE_GENERATOR: Xcode
CI_CMAKE_BUILD_FLAGS: -j2
CI_CTEST_FLAGS: -j2
37 changes: 37 additions & 0 deletions Engine/lib/lpng/.github/workflows/verify-windows.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Verifying libpng on Windows

on:
push:
branches:
- libpng16
- libpng18
pull_request:
branches:
- libpng16
- libpng18

jobs:
verify-windows:
runs-on: windows-latest
timeout-minutes: 10
steps:
- name: Set up vcpkg cache
uses: actions/cache@v4
with:
path: C:/vcpkg/installed
key: ${{ runner.os }}-vcpkg-${{ hashFiles('vcpkg.json', '**/vcpkg.json') }}
restore-keys: ${{ runner.os }}-vcpkg-
- name: Install dependencies
run: |
vcpkg install zlib:x64-windows
vcpkg integrate install
- name: Check out the code
uses: actions/checkout@v4
- name: Run the CMake verification script
run: bash ./ci/ci_verify_cmake.sh
env:
CI_CMAKE_GENERATOR: Visual Studio 17 2022
CI_CMAKE_GENERATOR_PLATFORM: x64
CI_CMAKE_TOOLCHAIN_FILE: C:/vcpkg/scripts/buildsystems/vcpkg.cmake
CI_CMAKE_BUILD_FLAGS: -j2
CI_CTEST_FLAGS: -j2
Loading
Loading