From a345e94fcbb31a080f8a562b91c94e95c8538264 Mon Sep 17 00:00:00 2001 From: Toma Date: Wed, 9 Feb 2022 23:06:45 +0100 Subject: [PATCH] Removed meson (#7) * Moved source files under src directory. * Added cmake build files * Fixing windows builds for cmake * Updated meson versions, plus fixing windows cmake build * Fixed artifact for CI * Updated meson build after moving source to src directory * Fine tuned the cmake projects based on the meson build * Added proper flags for x86 builds * Removed meson build files * Previous merge restored some deleted files --- .github/workflows/build-all-targets.yml | 34 ------- .travis.yml | 115 ---------------------- meson.build | 28 ------ requirements.txt | 3 - tools/cross-compilation/linux-aarch64.txt | 12 --- tools/cross-compilation/linux-amd64.txt | 12 --- tools/cross-compilation/linux-armhf.txt | 12 --- tools/cross-compilation/linux-i686.txt | 16 --- tools/cross-compilation/windows-x64.txt | 13 --- tools/cross-compilation/windows-x86.txt | 16 --- 10 files changed, 261 deletions(-) delete mode 100644 .github/workflows/build-all-targets.yml delete mode 100644 .travis.yml delete mode 100644 meson.build delete mode 100644 requirements.txt delete mode 100644 tools/cross-compilation/linux-aarch64.txt delete mode 100644 tools/cross-compilation/linux-amd64.txt delete mode 100644 tools/cross-compilation/linux-armhf.txt delete mode 100644 tools/cross-compilation/linux-i686.txt delete mode 100644 tools/cross-compilation/windows-x64.txt delete mode 100644 tools/cross-compilation/windows-x86.txt diff --git a/.github/workflows/build-all-targets.yml b/.github/workflows/build-all-targets.yml deleted file mode 100644 index bb40ce4..0000000 --- a/.github/workflows/build-all-targets.yml +++ /dev/null @@ -1,34 +0,0 @@ -name: build-all-targets -on: [push, pull_request] -jobs: - build: - runs-on: ubuntu-latest - strategy: - fail-fast: false - matrix: - target: [linux-amd64, linux-i686, linux-armhf, linux-aarch64, windows-x64, windows-x86] - steps: - - name: Checkout - uses: actions/checkout@v2 - - name: Prepare Build Environemnt - run: | - sudo apt-get update - sudo apt-get -y install build-essential python3-virtualenv python3-dev python3-pip ninja-build cmake gcc-i686-linux-gnu - sudo apt-get -y install gcc-arm-linux-gnueabihf pkg-config-arm-linux-gnueabihf libc6-dev-armhf-cross gcc-aarch64-linux-gnu libc6-dev-arm64-cross - sudo apt-get -y install gcc-mingw-w64-x86-64 gcc-mingw-w64-i686 - virtualenv .venv --python=python3 - . .venv/bin/activate - pip3 install --upgrade pip - pip3 install -r requirements.txt - - name: Build - run: | - ./.venv/bin/meson build-${{ matrix.target }} --buildtype=release -Dwrap_mode=forcefallback --cross-file tools/cross-compilation/${{ matrix.target }}.txt - ninja -v -C build-${{ matrix.target }} - - name: Upload artifacts - uses: actions/upload-artifact@v2 - with: - name: ${{ matrix.target }} - path: | - build-${{ matrix.target }}/mvdparser - build-${{ matrix.target }}/mvdparser.exe - if-no-files-found: ignore diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 7cb57f6..0000000 --- a/.travis.yml +++ /dev/null @@ -1,115 +0,0 @@ -dist: bionic - -os: - - linux - -compiler: - - gcc - -language: c - -env: - global: - DATETIME=$(date +%Y%m%d-%H%M%S) - DATE=${DATETIME%%-*} - TIME=${DATETIME##*-} - -jobs: - include: - - os: linux - env: - OS=linux - ARCH=amd64 - EXTENSION= - - os: linux - env: - OS=linux - ARCH=i686 - EXTENSION= - - os: linux - env: - OS=linux - ARCH=armhf - EXTENSION= - - os: linux - env: - OS=linux - ARCH=aarch64 - EXTENSION= - - os: linux - env: - OS=windows - ARCH=x64 - EXTENSION=.exe - addons: - apt: - packages: - - mingw-w64 - - os: linux - env: - OS=windows - ARCH=x86 - EXTENSION=.exe - addons: - apt: - packages: - - mingw-w64 - -addons: - apt: - update: true - packages: - build-essential - python-virtualenv - python3-dev - python3-pip - ninja-build - cmake - gcc-multilib - -before_install: - # install cross compiler tools if we are going to compile binares for arm (notice it will remove gcc-multilib and creates a dependency issue if we try to install those packages with the others) - - if [ -z "${ARCH##armhf}" ]; then sudo apt-get -y install gcc-arm-linux-gnueabihf pkg-config-arm-linux-gnueabihf libc6-dev-armhf-cross ;fi - - if [ -z "${ARCH##aarch64}" ]; then sudo apt-get -y install gcc-aarch64-linux-gnu linux-libc-dev-arm64-cross libc6-dev-arm64-cross ;fi - # activate virtualenv with python3, meson requires python3 - - virtualenv .venv --python=python3 - - . .venv/bin/activate - - pip3 install --upgrade pip - # install python packages like meson, ninja etc... - - pip3 install -r requirements.txt - -before_script: - # add current commit ref to include files for debugging ease - - sed -i "s/#define GIT_COMMIT.*$/$(git log -n 1 --format=format:"#define GIT_COMMIT \"%h\"" HEAD)/" maindef.h - -script: - # build binary - - meson build --buildtype=release --cross-file tools/cross-compilation/${OS}-${ARCH}.txt - - ninja -v -C build - -after_success: - - export BINARY=mvdparser${EXTENSION} - - export CHECKSUM=mvdparser.md5 - # print basic info about compiled files - - file build/${BINARY} - # create hash for download verification - - md5sum build/${BINARY} > build/${CHECKSUM} - # update snapshots links - - if [ -z "${TRAVIS_TAG}" ]; then mkdir -p upload/snapshots/${OS}/${ARCH} ;fi - - if [ -z "${TRAVIS_TAG}" ]; then mkdir -p upload/snapshots/latest/${OS}/${ARCH} ;fi - - if [ -z "${TRAVIS_TAG}" ]; then cp build/${BINARY} upload/snapshots/${OS}/${ARCH}/${DATETIME}_${TRAVIS_COMMIT:0:7}_${BINARY} ;fi - - if [ -z "${TRAVIS_TAG}" ]; then cp build/${CHECKSUM} upload/snapshots/${OS}/${ARCH}/${DATETIME}_${TRAVIS_COMMIT:0:7}_${CHECKSUM} ;fi - - if [ -z "${TRAVIS_TAG}" ]; then cp build/${BINARY} upload/snapshots/latest/${OS}/${ARCH}/${BINARY} ;fi - - if [ -z "${TRAVIS_TAG}" ]; then cp build/${CHECKSUM} upload/snapshots/latest/${OS}/${ARCH}/${CHECKSUM} ;fi - # update releases links - - if [ -n "${TRAVIS_TAG}" ]; then mkdir -p upload/releases/{latest,${TRAVIS_TAG}}/${OS}/${ARCH} ;fi - - if [ -n "${TRAVIS_TAG}" ]; then cp build/${BINARY} upload/releases/${TRAVIS_TAG}/${OS}/${ARCH}/${BINARY} ;fi - - if [ -n "${TRAVIS_TAG}" ]; then cp build/${CHECKSUM} upload/releases/${TRAVIS_TAG}/${OS}/${ARCH}/${CHECKSUM} ;fi - - if [ -n "${TRAVIS_TAG}" ]; then cp build/${BINARY} upload/releases/latest/${OS}/${ARCH}/${BINARY} ;fi - - if [ -n "${TRAVIS_TAG}" ]; then cp build/${CHECKSUM} upload/releases/latest/${OS}/${ARCH}/${CHECKSUM} ;fi - # add SFTP authentication key to the build environment - - openssl aes-256-cbc -K $encrypted_2be706a63e31_key -iv $encrypted_2be706a63e31_iv -in mvdparser_builds.key.enc -out mvdparser_builds.key -d - # set correct permissions on private key - - chmod 600 mvdparser_builds.key - # push built items to SFTP storage - - sftp -q -i mvdparser_builds.key -rp -o 'StrictHostKeyChecking no' -o 'UserKnownHostsFile /dev/null' -P ${SFTP_PORT} ${SFTP_USERNAME}@${SFTP_HOST}:/ <<< $'put -rp upload/*' diff --git a/meson.build b/meson.build deleted file mode 100644 index 761cf7d..0000000 --- a/meson.build +++ /dev/null @@ -1,28 +0,0 @@ -project('mvdparser', 'c') - -mvdparser_sources = [ - 'src/frag_parser.c', - 'src/logger.c', - 'src/main.c', - 'src/mvd_parser.c', - 'src/net_msg.c', - 'src/netmsg_parser.c', - 'src/qw_protocol.c', - 'src/shared.c', - 'src/strptime.c', -] - -if host_machine.system() == 'windows' - mvdparser_sources += 'src/sys_win.c' -elif host_machine.system() == 'linux' - mvdparser_sources += 'src/sys_linux.c' -else - # FIXME macOS / other platform support -endif - -executable('mvdparser', mvdparser_sources, - dependencies : [ - meson.get_compiler('c').find_library('m', required : false), - meson.get_compiler('c').find_library('winmm', required : false), - ], -) diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index 911d94b..0000000 --- a/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -meson==0.58.0 -ninja==1.10.0.post2 -scikit-build==0.6.1 diff --git a/tools/cross-compilation/linux-aarch64.txt b/tools/cross-compilation/linux-aarch64.txt deleted file mode 100644 index f22f9a6..0000000 --- a/tools/cross-compilation/linux-aarch64.txt +++ /dev/null @@ -1,12 +0,0 @@ -[binaries] -c = 'aarch64-linux-gnu-gcc' -cpp = 'aarch64-linux-gnu-c++' -ar = 'aarch64-linux-gnu-ar' -strip = 'aarch64-linux-gnu-strip' -pkgconfig = 'aarch64-linux-gnu-pkg-config' - -[host_machine] -system = 'linux' -cpu_family = 'aarch64' -cpu = 'aarch64' -endian = 'little' diff --git a/tools/cross-compilation/linux-amd64.txt b/tools/cross-compilation/linux-amd64.txt deleted file mode 100644 index 682ed1d..0000000 --- a/tools/cross-compilation/linux-amd64.txt +++ /dev/null @@ -1,12 +0,0 @@ -[binaries] -c = 'gcc' -cpp = 'g++' -ar = 'ar' -strip = 'strip' -pkgconfig = 'pkg-config' - -[host_machine] -system = 'linux' -cpu_family = 'x86_64' -cpu = 'x86_64' -endian = 'little' diff --git a/tools/cross-compilation/linux-armhf.txt b/tools/cross-compilation/linux-armhf.txt deleted file mode 100644 index 5d74d71..0000000 --- a/tools/cross-compilation/linux-armhf.txt +++ /dev/null @@ -1,12 +0,0 @@ -[binaries] -c = 'arm-linux-gnueabihf-gcc' -cpp = 'arm-linux-gnueabihf-cpp' -ar = 'arm-linux-gnueabihf-ar' -strip = 'arm-linux-gnueabihf-strip' -pkgconfig = 'arm-linux-gnueabihf-pkg-config' - -[host_machine] -system = 'linux' -cpu_family = 'arm' -cpu = 'armv7hl' -endian = 'little' diff --git a/tools/cross-compilation/linux-i686.txt b/tools/cross-compilation/linux-i686.txt deleted file mode 100644 index 1ee33cf..0000000 --- a/tools/cross-compilation/linux-i686.txt +++ /dev/null @@ -1,16 +0,0 @@ -[binaries] -c = 'i686-linux-gnu-gcc' -cpp = 'i686-linux-gnu-g++' -ar = 'i686-linux-gnu-ar' -strip = 'i686-linux-gnu-strip' -pkgconfig = 'i686-linux-gnu-pkg-config' - -[properties] -c_args = ['-m32'] -c_link_args = ['-m32'] - -[host_machine] -system = 'linux' -cpu_family = 'x86' -cpu = 'i686' -endian = 'little' diff --git a/tools/cross-compilation/windows-x64.txt b/tools/cross-compilation/windows-x64.txt deleted file mode 100644 index 2e2f6df..0000000 --- a/tools/cross-compilation/windows-x64.txt +++ /dev/null @@ -1,13 +0,0 @@ -[binaries] -c = 'x86_64-w64-mingw32-gcc' -cpp = 'x86_64-w64-mingw32-g++' -ar = 'x86_64-w64-mingw32-ar' -strip = 'x86_64-w64-mingw32-strip' -pkgconfig = 'x86_64-w64-mingw32-pkg-config' -windres = 'x86_64-w64-mingw32-windres' - -[host_machine] -system = 'windows' -cpu_family = 'x86_64' -cpu = 'x86_64' -endian = 'little' diff --git a/tools/cross-compilation/windows-x86.txt b/tools/cross-compilation/windows-x86.txt deleted file mode 100644 index 10799ce..0000000 --- a/tools/cross-compilation/windows-x86.txt +++ /dev/null @@ -1,16 +0,0 @@ -[binaries] -c = 'i686-w64-mingw32-gcc' -cpp = 'i686-w64-mingw32-g++' -ar = 'i686-w64-mingw32-ar' -strip = 'i686-w64-mingw32-strip' -pkgconfig = 'i686-w64-mingw32-pkg-config' -windres = 'i686-w64-mingw32-windres' - -[properties] -c_args = ['-msse2', '-mfpmath=sse'] - -[host_machine] -system = 'windows' -cpu_family = 'x86' -cpu = 'i686' -endian = 'little'