aboutsummaryrefslogtreecommitdiffhomepage
path: root/externals/fmt/support
diff options
context:
space:
mode:
authorLioncash <[email protected]>2021-06-23 03:39:40 -0400
committerLioncash <[email protected]>2021-06-23 05:04:53 -0400
commit9bb464a20390a6948965f4e37477ace768f63224 (patch)
treef4120ec864265ea46152a8a55a929e199272748f /externals/fmt/support
parentc6125082ea992c245edab26b6f86e7b904b86eec (diff)
parent3e6176d6f61247c57d4a657a490d983322a3dc90 (diff)
downloaddynarmic-9bb464a20390a6948965f4e37477ace768f63224.tar.gz
dynarmic-9bb464a20390a6948965f4e37477ace768f63224.zip
externals: Update fmt to 8.0.0
Diffstat (limited to 'externals/fmt/support')
-rw-r--r--externals/fmt/support/README2
-rw-r--r--externals/fmt/support/appveyor.yml10
-rwxr-xr-xexternals/fmt/support/build-docs.py58
-rw-r--r--externals/fmt/support/build.gradle73
-rw-r--r--externals/fmt/support/fmt.pro27
-rwxr-xr-xexternals/fmt/support/rst2md.py2
-rwxr-xr-xexternals/fmt/support/travis-build.py119
-rwxr-xr-xexternals/fmt/support/update-coverity-branch.py30
8 files changed, 108 insertions, 213 deletions
diff --git a/externals/fmt/support/README b/externals/fmt/support/README
index e7fbacc7..468f5485 100644
--- a/externals/fmt/support/README
+++ b/externals/fmt/support/README
@@ -2,5 +2,3 @@ This directory contains build support files such as
* CMake modules
* Build scripts
-* qmake (static build with dynamic libc only)
-
diff --git a/externals/fmt/support/appveyor.yml b/externals/fmt/support/appveyor.yml
index f53e4383..64ca58a9 100644
--- a/externals/fmt/support/appveyor.yml
+++ b/externals/fmt/support/appveyor.yml
@@ -6,11 +6,8 @@ clone_depth: 1
image:
- Visual Studio 2015
- - Visual Studio 2019
- - Visual Studio 2017
platform:
- - Win32
- x64
environment:
@@ -18,13 +15,6 @@ environment:
MSVC_DEFAULT_OPTIONS: ON
BUILD: msvc
-matrix:
- exclude:
- - image: Visual Studio 2015
- platform: Win32
- - image: Visual Studio 2019
- platform: Win32
-
before_build:
- mkdir build
- cd build
diff --git a/externals/fmt/support/build-docs.py b/externals/fmt/support/build-docs.py
new file mode 100755
index 00000000..f1395cd6
--- /dev/null
+++ b/externals/fmt/support/build-docs.py
@@ -0,0 +1,58 @@
+#!/usr/bin/env python
+# Build the documentation in CI.
+
+from __future__ import print_function
+import errno, os, shutil, subprocess, sys, urllib
+from subprocess import call, check_call, Popen, PIPE, STDOUT
+
+def rmtree_if_exists(dir):
+ try:
+ shutil.rmtree(dir)
+ except OSError as e:
+ if e.errno == errno.ENOENT:
+ pass
+
+# Build the docs.
+fmt_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
+sys.path.insert(0, os.path.join(fmt_dir, 'doc'))
+import build
+build.create_build_env()
+html_dir = build.build_docs()
+
+repo = 'fmtlib.github.io'
+branch = os.environ['GITHUB_REF']
+is_ci = 'CI' in os.environ
+if is_ci and branch != 'refs/heads/master':
+ print('Branch: ' + branch)
+ exit(0) # Ignore non-master branches
+if is_ci and 'KEY' not in os.environ:
+ # Don't update the repo if building in CI from an account that doesn't have
+ # push access.
+ print('Skipping update of ' + repo)
+ exit(0)
+
+# Clone the fmtlib.github.io repo.
+rmtree_if_exists(repo)
+git_url = 'https://github.com/' if is_ci else '[email protected]:'
+check_call(['git', 'clone', git_url + 'fmtlib/{}.git'.format(repo)])
+
+# Copy docs to the repo.
+target_dir = os.path.join(repo, 'dev')
+rmtree_if_exists(target_dir)
+shutil.copytree(html_dir, target_dir, ignore=shutil.ignore_patterns('.*'))
+if is_ci:
+ check_call(['git', 'config', '--global', 'user.name', 'fmtbot'])
+ check_call(['git', 'config', '--global', 'user.email', '[email protected]'])
+
+# Push docs to GitHub pages.
+check_call(['git', 'add', '--all'], cwd=repo)
+if call(['git', 'diff-index', '--quiet', 'HEAD'], cwd=repo):
+ check_call(['git', 'commit', '-m', 'Update documentation'], cwd=repo)
+ cmd = 'git push'
+ if is_ci:
+ cmd += ' https://[email protected]/fmtlib/fmtlib.github.io.git master'
+ p = Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT, cwd=repo)
+ # Print the output without the key.
+ print(p.communicate()[0].decode('utf-8').replace(os.environ['KEY'], '$KEY'))
+ if p.returncode != 0:
+ raise subprocess.CalledProcessError(p.returncode, cmd)
diff --git a/externals/fmt/support/build.gradle b/externals/fmt/support/build.gradle
index 11648da8..8d18da6b 100644
--- a/externals/fmt/support/build.gradle
+++ b/externals/fmt/support/build.gradle
@@ -1,3 +1,4 @@
+import java.nio.file.Paths
// General gradle arguments for root project
buildscript {
@@ -7,24 +8,25 @@ buildscript {
}
dependencies {
//
- // https://developer.android.com/studio/releases/gradle-plugin
+ // https://developer.android.com/studio/releases/gradle-plugin#updating-gradle
//
- // Notice that 3.3.0 here is the version of [Android Gradle Plugin]
- // Accroding to URL above you will need Gradle 5.0 or higher
+ // Notice that 4.0.0 here is the version of [Android Gradle Plugin]
+ // Accroding to URL above you will need Gradle 6.1 or higher
//
- // If you are using Android Studio, and it is using Gradle's lower
- // version, Use the plugin version 3.1.3 ~ 3.2.0 for Gradle 4.4 ~ 4.10
- classpath 'com.android.tools.build:gradle:3.3.0'
+ classpath "com.android.tools.build:gradle:4.1.1"
}
}
repositories {
google()
jcenter()
}
-
-// Output: Shared library (.so) for Android
-apply plugin: 'com.android.library'
+// Project's root where CMakeLists.txt exists: rootDir/support/.cxx -> rootDir
+def rootDir = Paths.get(project.buildDir.getParent()).getParent()
+println("rootDir: ${rootDir}")
+
+// Output: Shared library (.so) for Android
+apply plugin: "com.android.library"
android {
compileSdkVersion 25 // Android 7.0
@@ -41,13 +43,13 @@ android {
include "arm64-v8a", "armeabi-v7a", "x86_64"
}
}
+ ndkVersion "21.3.6528147" // ANDROID_NDK_HOME is deprecated. Be explicit
defaultConfig {
minSdkVersion 21 // Android 5.0+
targetSdkVersion 25 // Follow Compile SDK
- versionCode 21 // Follow release count
- versionName "5.3.0" // Follow Official version
- testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
+ versionCode 34 // Follow release count
+ versionName "7.1.2" // Follow Official version
externalNativeBuild {
cmake {
@@ -56,9 +58,9 @@ android {
arguments "-DFMT_TEST=false" // Skip test
arguments "-DFMT_DOC=false" // Skip document
cppFlags "-std=c++17"
+ targets "fmt"
}
}
- println("Gradle CMake Plugin: ")
println(externalNativeBuild.cmake.cppFlags)
println(externalNativeBuild.cmake.arguments)
}
@@ -69,16 +71,27 @@ android {
// neighbor of the top level cmake
externalNativeBuild {
cmake {
- path "../CMakeLists.txt"
+ version "3.10.0+"
+ path "${rootDir}/CMakeLists.txt"
// buildStagingDirectory "./build" // Custom path for cmake output
}
- //println(cmake.path)
}
sourceSets{
// Android Manifest for Gradle
main {
- manifest.srcFile 'AndroidManifest.xml'
+ manifest.srcFile "AndroidManifest.xml"
+ }
+ }
+
+ // https://developer.android.com/studio/build/native-dependencies#build_system_configuration
+ buildFeatures {
+ prefab true
+ prefabPublishing true
+ }
+ prefab {
+ fmt {
+ headers "${rootDir}/include"
}
}
}
@@ -88,20 +101,32 @@ assemble.doLast
// Instead of `ninja install`, Gradle will deploy the files.
// We are doing this since FMT is dependent to the ANDROID_STL after build
copy {
- from 'build/intermediates/cmake'
- into '../libs'
+ from "build/intermediates/cmake"
+ into "${rootDir}/libs"
}
// Copy debug binaries
copy {
- from '../libs/debug/obj'
- into '../libs/debug'
+ from "${rootDir}/libs/debug/obj"
+ into "${rootDir}/libs/debug"
}
// Copy Release binaries
copy {
- from '../libs/release/obj'
- into '../libs/release'
+ from "${rootDir}/libs/release/obj"
+ into "${rootDir}/libs/release"
}
// Remove empty directory
- delete '../libs/debug/obj'
- delete '../libs/release/obj'
+ delete "${rootDir}/libs/debug/obj"
+ delete "${rootDir}/libs/release/obj"
+
+ // Copy AAR files. Notice that the aar is named after the folder of this script.
+ copy {
+ from "build/outputs/aar/support-release.aar"
+ into "${rootDir}/libs"
+ rename "support-release.aar", "fmt-release.aar"
+ }
+ copy {
+ from "build/outputs/aar/support-debug.aar"
+ into "${rootDir}/libs"
+ rename "support-debug.aar", "fmt-debug.aar"
+ }
}
diff --git a/externals/fmt/support/fmt.pro b/externals/fmt/support/fmt.pro
deleted file mode 100644
index c555d0b4..00000000
--- a/externals/fmt/support/fmt.pro
+++ /dev/null
@@ -1,27 +0,0 @@
-# Staticlib configuration for qmake builds
-# For some reason qmake 3.1 fails to identify source dependencies and excludes format.cc and printf.cc
-# from compilation so it _MUST_ be called as qmake -nodepend
-# A workaround is implemented below: a custom compiler is defined which does not track dependencies
-
-TEMPLATE = lib
-
-TARGET = fmt
-
-QMAKE_EXT_CPP = .cc
-
-CONFIG = staticlib warn_on c++11
-
-FMT_SOURCES = \
- ../src/format.cc \
- ../src/posix.cc
-
-fmt.name = libfmt
-fmt.input = FMT_SOURCES
-fmt.output = ${QMAKE_FILE_BASE}$$QMAKE_EXT_OBJ
-fmt.clean = ${QMAKE_FILE_BASE}$$QMAKE_EXT_OBJ
-fmt.depends = ${QMAKE_FILE_IN}
-# QMAKE_RUN_CXX will not be expanded
-fmt.commands = $$QMAKE_CXX -c $$QMAKE_CXXFLAGS $$QMAKE_CXXFLAGS_WARN_ON $$QMAKE_CXXFLAGS_RELEASE_WITH_DEBUGINFO $$QMAKE_CXXFLAGS_CXX11 ${QMAKE_FILE_IN}
-fmt.variable_out = OBJECTS
-fmt.CONFIG = no_dependencies no_link
-QMAKE_EXTRA_COMPILERS += fmt
diff --git a/externals/fmt/support/rst2md.py b/externals/fmt/support/rst2md.py
index cf170fe2..3f072007 100755
--- a/externals/fmt/support/rst2md.py
+++ b/externals/fmt/support/rst2md.py
@@ -65,7 +65,7 @@ class Translator(nodes.NodeVisitor):
self.write('\n\n')
def visit_paragraph(self, node):
- pass
+ self.write('\n\n')
def depart_paragraph(self, node):
pass
diff --git a/externals/fmt/support/travis-build.py b/externals/fmt/support/travis-build.py
deleted file mode 100755
index 0cf73c84..00000000
--- a/externals/fmt/support/travis-build.py
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/usr/bin/env python
-# Build the project on Travis CI.
-
-from __future__ import print_function
-import errno, os, shutil, subprocess, sys, urllib
-from subprocess import call, check_call, Popen, PIPE, STDOUT
-
-def rmtree_if_exists(dir):
- try:
- shutil.rmtree(dir)
- except OSError as e:
- if e.errno == errno.ENOENT:
- pass
-
-def makedirs_if_not_exist(dir):
- try:
- os.makedirs(dir)
- except OSError as e:
- if e.errno != errno.EEXIST:
- raise
-
-def install_dependencies():
- branch = os.environ['TRAVIS_BRANCH']
- if branch != 'master':
- print('Branch: ' + branch)
- exit(0) # Ignore non-master branches
- check_call('curl -s https://deb.nodesource.com/gpgkey/nodesource.gpg.key ' +
- '| sudo apt-key add -', shell=True)
- check_call('echo "deb https://deb.nodesource.com/node_0.10 precise main" ' +
- '| sudo tee /etc/apt/sources.list.d/nodesource.list', shell=True)
- check_call(['sudo', 'apt-get', 'update'])
- check_call(['sudo', 'apt-get', 'install', 'python-virtualenv', 'nodejs'])
- check_call(['sudo', 'npm', 'install', '-g', '[email protected]', 'less-plugin-clean-css'])
- deb_file = 'doxygen_1.8.6-2_amd64.deb'
- urllib.urlretrieve('http://mirrors.kernel.org/ubuntu/pool/main/d/doxygen/' +
- deb_file, deb_file)
- check_call(['sudo', 'dpkg', '-i', deb_file])
-
-fmt_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
-
-build = os.environ['BUILD']
-if build == 'Doc':
- travis = 'TRAVIS' in os.environ
- if travis:
- install_dependencies()
- sys.path.insert(0, os.path.join(fmt_dir, 'doc'))
- import build
- build.create_build_env()
- html_dir = build.build_docs()
- repo = 'fmtlib.github.io'
- if travis and 'KEY' not in os.environ:
- # Don't update the repo if building on Travis from an account that
- # doesn't have push access.
- print('Skipping update of ' + repo)
- exit(0)
- # Clone the fmtlib.github.io repo.
- rmtree_if_exists(repo)
- git_url = 'https://github.com/' if travis else '[email protected]:'
- check_call(['git', 'clone', git_url + 'fmtlib/{}.git'.format(repo)])
- # Copy docs to the repo.
- target_dir = os.path.join(repo, 'dev')
- rmtree_if_exists(target_dir)
- shutil.copytree(html_dir, target_dir, ignore=shutil.ignore_patterns('.*'))
- if travis:
- check_call(['git', 'config', '--global', 'user.name', 'amplbot'])
- check_call(['git', 'config', '--global', 'user.email', '[email protected]'])
- # Push docs to GitHub pages.
- check_call(['git', 'add', '--all'], cwd=repo)
- if call(['git', 'diff-index', '--quiet', 'HEAD'], cwd=repo):
- check_call(['git', 'commit', '-m', 'Update documentation'], cwd=repo)
- cmd = 'git push'
- if travis:
- cmd += ' https://[email protected]/fmtlib/fmtlib.github.io.git master'
- p = Popen(cmd, shell=True, stdout=PIPE, stderr=STDOUT, cwd=repo)
- # Print the output without the key.
- print(p.communicate()[0].replace(os.environ['KEY'], '$KEY'))
- if p.returncode != 0:
- raise subprocess.CalledProcessError(p.returncode, cmd)
- exit(0)
-
-standard = os.environ['STANDARD']
-install_dir = os.path.join(fmt_dir, "_install")
-build_dir = os.path.join(fmt_dir, "_build")
-test_build_dir = os.path.join(fmt_dir, "_build_test")
-
-# Configure the library.
-makedirs_if_not_exist(build_dir)
-cmake_flags = [
- '-DCMAKE_INSTALL_PREFIX=' + install_dir, '-DCMAKE_BUILD_TYPE=' + build,
- '-DCMAKE_CXX_STANDARD=' + standard
-]
-
-# Make sure the fuzzers still compile.
-main_cmake_flags = list(cmake_flags)
-if 'ENABLE_FUZZING' in os.environ:
- main_cmake_flags += ['-DFMT_FUZZ=ON', '-DFMT_FUZZ_LINKMAIN=On']
-
-check_call(['cmake', '-DFMT_DOC=OFF', '-DFMT_PEDANTIC=ON', '-DFMT_WERROR=ON', fmt_dir] +
- main_cmake_flags, cwd=build_dir)
-
-# Build the library.
-check_call(['cmake', '--build','.'], cwd=build_dir)
-
-# Test the library.
-env = os.environ.copy()
-env['CTEST_OUTPUT_ON_FAILURE'] = '1'
-if call(['make', 'test'], env=env, cwd=build_dir):
- with open(os.path.join(build_dir, 'Testing', 'Temporary', 'LastTest.log'), 'r') as f:
- print(f.read())
- sys.exit(-1)
-
-# Install the library.
-check_call(['make', 'install'], cwd=build_dir)
-
-# Test installation.
-makedirs_if_not_exist(test_build_dir)
-check_call(['cmake', os.path.join(fmt_dir, "test", "find-package-test")] +
- cmake_flags, cwd=test_build_dir)
-check_call(['make', '-j4'], cwd=test_build_dir)
diff --git a/externals/fmt/support/update-coverity-branch.py b/externals/fmt/support/update-coverity-branch.py
deleted file mode 100755
index 519f5d00..00000000
--- a/externals/fmt/support/update-coverity-branch.py
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/usr/bin/env python
-# Update the coverity branch from the master branch.
-# It is not done automatically because Coverity Scan limits
-# the number of submissions per day.
-
-from __future__ import print_function
-import shutil, tempfile
-from subprocess import check_output, STDOUT
-
-class Git:
- def __init__(self, dir):
- self.dir = dir
-
- def __call__(self, *args):
- output = check_output(['git'] + list(args), cwd=self.dir, stderr=STDOUT)
- print(output)
- return output
-
-dir = tempfile.mkdtemp()
-try:
- git = Git(dir)
- git('clone', '-b', 'coverity', '[email protected]:fmtlib/fmt.git', dir)
- output = git('merge', '-X', 'theirs', '--no-commit', 'origin/master')
- if 'Fast-forward' not in output:
- git('reset', 'HEAD', '.travis.yml')
- git('checkout', '--', '.travis.yml')
- git('commit', '-m', 'Update coverity branch')
- git('push')
-finally:
- shutil.rmtree(dir)