From 5f44050bb700c39353ff3df0a6b51ab872fb0f41 Mon Sep 17 00:00:00 2001 From: Hanspeter Portner Date: Thu, 17 May 2018 08:39:54 +0200 Subject: [PATCH] initial migration to meson. --- .gitlab-ci.yml | 13 +++++-------- .travis.yml | 17 ----------------- CMakeLists.txt | 13 ------------- README.md | 7 +++---- VERSION | 2 +- cmake/arm-linux-gnueabihf.cmake | 18 ------------------ cmake/i686-linux-gnu.cmake | 7 ------- cmake/i686-w64-mingw32.cmake | 23 ----------------------- cmake/universal-apple-darwin.cmake | 20 -------------------- cmake/x86_64-linux-gnu.cmake | 4 ---- cmake/x86_64-w64-mingw32.cmake | 23 ----------------------- meson.build | 17 +++++++++++++++++ meson/arm-linux-gnueabihf | 18 ++++++++++++++++++ meson/i686-linux-gnu | 17 +++++++++++++++++ meson/i686-w64-mingw32 | 17 +++++++++++++++++ meson/universal-apple-darwin | 19 +++++++++++++++++++ meson/x86_64-linux-gnu | 16 ++++++++++++++++ meson/x86_64-w64-mingw32 | 17 +++++++++++++++++ 18 files changed, 130 insertions(+), 138 deletions(-) delete mode 100644 .travis.yml delete mode 100644 CMakeLists.txt delete mode 100644 cmake/arm-linux-gnueabihf.cmake delete mode 100644 cmake/i686-linux-gnu.cmake delete mode 100644 cmake/i686-w64-mingw32.cmake delete mode 100644 cmake/universal-apple-darwin.cmake delete mode 100644 cmake/x86_64-linux-gnu.cmake delete mode 100644 cmake/x86_64-w64-mingw32.cmake create mode 100644 meson.build create mode 100644 meson/arm-linux-gnueabihf create mode 100644 meson/i686-linux-gnu create mode 100644 meson/i686-w64-mingw32 create mode 100644 meson/universal-apple-darwin create mode 100644 meson/x86_64-linux-gnu create mode 100644 meson/x86_64-w64-mingw32 diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index bf7dae6..6c87c35 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -4,9 +4,9 @@ stages: .variables_template: &variables_definition variables: - BASE_NAME: "dfuse_pack" + BASE_NAME: "lv2lint" PKG_CONFIG_PATH: "/opt/lv2/lib/pkgconfig:/opt/${CI_BUILD_NAME}/lib/pkgconfig" - TOOLCHAIN_FILE: "${CI_PROJECT_DIR}/cmake/${CI_BUILD_NAME}.cmake" + TOOLCHAIN_FILE: "${CI_PROJECT_DIR}/meson/${CI_BUILD_NAME}" .common_template: &common_definition <<: *variables_definition @@ -19,12 +19,9 @@ stages: .build_template: &build_definition <<: *common_definition script: - - mkdir build - - pushd build - - cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX="${CI_PROJECT_DIR}/${BASE_NAME}-$(cat ../VERSION)/${CI_BUILD_NAME}" -DCMAKE_TOOLCHAIN_FILE=${TOOLCHAIN_FILE} .. - - cmake .. # needed for darwin - - make - - make install + - meson --prefix=/ --cross-file "${TOOLCHAIN_FILE}" -Dstatic-build=false build + - ninja -C build + - DESTDIR="${CI_PROJECT_DIR}/${BASE_NAME}-$(cat VERSION)/${CI_BUILD_NAME}" ninja -C build install .universal_linux_template: &universal_linux_definition image: ventosus/universal-linux-gnu diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 54f192e..0000000 --- a/.travis.yml +++ /dev/null @@ -1,17 +0,0 @@ -language: - - c -os: - - linux -compiler: - - gcc - - clang -before_install: - - sudo apt-get -qq update -install: - - sudo apt-get install -y libeina-dev -before_script: - - mkdir build - - cd build - - cmake .. -script: - - make diff --git a/CMakeLists.txt b/CMakeLists.txt deleted file mode 100644 index a7f6cf6..0000000 --- a/CMakeLists.txt +++ /dev/null @@ -1,13 +0,0 @@ -cmake_minimum_required(VERSION 2.8) - -project(dfuse_pack) - -set(CMAKE_C_FLAGS "-fdata-sections -ffunction-sections ${CMAKE_C_FLAGS}") -set(CMAKE_C_FLAGS "-std=gnu11 -Wextra -Wno-unused-parameter -ffast-math -fvisibility=hidden ${CMAKE_C_FLAGS}") -set(CMAKE_C_FLAGS "-Wshadow -Wimplicit-function-declaration -Wredundant-decls -Wmissing-prototypes -Wstrict-prototypes ${CMAKE_C_FLAGS}") - -include_directories("${PROJECT_SOURCE_DIR}") - -# dfuse_pack -add_executable(dfuse_pack dfuse_pack.c) -install(TARGETS dfuse_pack DESTINATION bin) diff --git a/README.md b/README.md index 56e4556..91a4b68 100644 --- a/README.md +++ b/README.md @@ -14,11 +14,10 @@ This command line utility lets you pack raw binary firmware images into a DfuSe ### Build / install - mkdir build + meson build cd build - cmake .. - make - sudo make install + ninja -j4 + sudo ninja install ### Arguments diff --git a/VERSION b/VERSION index 78bc1ab..af88ba8 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.10.0 +0.11.1 diff --git a/cmake/arm-linux-gnueabihf.cmake b/cmake/arm-linux-gnueabihf.cmake deleted file mode 100644 index 102583c..0000000 --- a/cmake/arm-linux-gnueabihf.cmake +++ /dev/null @@ -1,18 +0,0 @@ -# the name of the target operating system -set(CMAKE_SYSTEM_NAME Linux) -set(CMAKE_SYSTEM_PROCESSOR "armv7h") -set(TOOLCHAIN "arm-linux-gnueabihf") - -# which compilers to use for C and C++ -set(CMAKE_C_COMPILER "${TOOLCHAIN}-gcc") -set(CMAKE_CXX_COMPILER "${TOOLCHAIN}-g++") - -# here is the target environment located -set(CMAKE_FIND_ROOT_PATH "usr/${TOOLCHAIN}") - -# adjust the default behaviour of the FIND_XXX() commands: -# search headers and libraries in the target environment, search -# programs in the host environment -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/cmake/i686-linux-gnu.cmake b/cmake/i686-linux-gnu.cmake deleted file mode 100644 index 7768048..0000000 --- a/cmake/i686-linux-gnu.cmake +++ /dev/null @@ -1,7 +0,0 @@ -# the name of the target operating system -set(CMAKE_SYSTEM_NAME Linux) -set(CMAKE_SYSTEM_PROCESSOR "i686") -set(TOOLCHAIN "i686-linux-gnu") - -set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -m32" CACHE STRING "c++ flags") -set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -m32" CACHE STRING "c flags") diff --git a/cmake/i686-w64-mingw32.cmake b/cmake/i686-w64-mingw32.cmake deleted file mode 100644 index dfd9783..0000000 --- a/cmake/i686-w64-mingw32.cmake +++ /dev/null @@ -1,23 +0,0 @@ -# the name of the target operating system -set(CMAKE_SYSTEM_NAME Windows) -set(CMAKE_SYSTEM_PROCESSOR "i686") -set(TOOLCHAIN "i686-w64-mingw32") - -# which compilers to use for C and C++ -set(CMAKE_C_COMPILER "${TOOLCHAIN}-gcc") -set(CMAKE_CXX_COMPILER "${TOOLCHAIN}-g++") -set(CMAKE_RC_COMPILER "${TOOLCHAIN}-windres") - -# here is the target environment located -set(CMAKE_FIND_ROOT_PATH "/usr/${TOOLCHAIN}") - -# adjust the default behaviour of the FIND_XXX() commands: -# search headers and libraries in the target environment, search -# programs in the host environment -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) - -set(LIBS ${LIBS} "-static-libgcc") - -set(WINE wine32) diff --git a/cmake/universal-apple-darwin.cmake b/cmake/universal-apple-darwin.cmake deleted file mode 100644 index 3be88f1..0000000 --- a/cmake/universal-apple-darwin.cmake +++ /dev/null @@ -1,20 +0,0 @@ -# the name of the target operating system -set(CMAKE_SYSTEM_NAME Darwin) -set(CMAKE_SYSTEM_PROCESSOR "x86_64") -set(TOOLCHAIN "universal-apple-darwin") - -set(CMAKE_OSX_ARCHITECTURES "x86_64;i386") - -# which compilers to use for C and C++ -set(CMAKE_C_COMPILER "/usr/${TOOLCHAIN}/bin/x86_64-apple-darwin15-clang") -set(CMAKE_CXX_COMPILER "/usr/${TOOLCHAIN}/bin/x86_64-apple-darwin15-clang++") - -# here is the target environment located -set(CMAKE_FIND_ROOT_PATH "/usr/${TOOLCHAIN}") - -# adjust the default behaviour of the FIND_XXX() commands: -# search headers and libraries in the target environment, search -# programs in the host environment -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) diff --git a/cmake/x86_64-linux-gnu.cmake b/cmake/x86_64-linux-gnu.cmake deleted file mode 100644 index 7ab5477..0000000 --- a/cmake/x86_64-linux-gnu.cmake +++ /dev/null @@ -1,4 +0,0 @@ -# the name of the target operating system -set(CMAKE_SYSTEM_NAME Linux) -set(CMAKE_SYSTEM_PROCESSOR "x86_64") -set(TOOLCHAIN "x86_64-linux-gnu") diff --git a/cmake/x86_64-w64-mingw32.cmake b/cmake/x86_64-w64-mingw32.cmake deleted file mode 100644 index 87c5eae..0000000 --- a/cmake/x86_64-w64-mingw32.cmake +++ /dev/null @@ -1,23 +0,0 @@ -# the name of the target operating system -set(CMAKE_SYSTEM_NAME Windows) -set(CMAKE_SYSTEM_PROCESSOR "x86_64") -set(TOOLCHAIN "x86_64-w64-mingw32") - -# which compilers to use for C and C++ -set(CMAKE_C_COMPILER "${TOOLCHAIN}-gcc") -set(CMAKE_CXX_COMPILER "${TOOLCHAIN}-g++") -set(CMAKE_RC_COMPILER "${TOOLCHAIN}-windres") - -# here is the target environment located -set(CMAKE_FIND_ROOT_PATH "/usr/${TOOLCHAIN}") - -# adjust the default behaviour of the FIND_XXX() commands: -# search headers and libraries in the target environment, search -# programs in the host environment -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) - -set(LIBS ${LIBS} "-static-libgcc") - -set(WINE wine64) diff --git a/meson.build b/meson.build new file mode 100644 index 0000000..ab6397f --- /dev/null +++ b/meson.build @@ -0,0 +1,17 @@ +project('dfuse_pack', 'c', default_options : [ + 'buildtype=release', + 'warning_level=1', + 'werror=false', + 'b_lto=true', + 'c_std=c11']) + +version = run_command('cat', 'VERSION').stdout().strip() + +add_project_arguments('-D_GNU_SOURCE', language : 'c') + +conf_data = configuration_data() +cc = meson.get_compiler('c') + +executable('dfuse_pack', + 'dfuse_pack.c', + install : true) diff --git a/meson/arm-linux-gnueabihf b/meson/arm-linux-gnueabihf new file mode 100644 index 0000000..6d0ea7b --- /dev/null +++ b/meson/arm-linux-gnueabihf @@ -0,0 +1,18 @@ +[host_machine] +system = 'linux' +cpu_family = 'arm' +cpu = 'armv7hl' +endian = 'little' + +[binaries] +c = '/usr/bin/arm-linux-gnueabihf-gcc' +cpp = '/usr/bin/arm-linux-gnueabihf-cpp' +ar = '/usr/bin/arm-linux-gnueabihf-ar' +strip = '/usr/bin/arm-linux-gnueabihf-strip' +pkgconfig = '/usr/bin/pkg-config' +exe_wrapper = '/usr/bin/qemu-arm' + +[properties] +root = '/usr/arm-linux-gnueabihf' +c_link_args = ['-Wl,-z,defs'] +needs_exe_wrapper = true diff --git a/meson/i686-linux-gnu b/meson/i686-linux-gnu new file mode 100644 index 0000000..ff653c6 --- /dev/null +++ b/meson/i686-linux-gnu @@ -0,0 +1,17 @@ +[host_machine] +system = 'linux' +cpu_family = 'x86' +cpu = 'i686' +endian = 'little' + +[binaries] +c = '/usr/bin/x86_64-linux-gnu-gcc' +cpp = '/usr/bin/x86_64-linux-gnu-g++' +ar = '/usr/bin/x86_64-linux-gnu-ar' +strip = '/usr/bin/x86_64-linux-gnu-strip' +pkgconfig = '/usr/bin/pkg-config' + +[properties] +c_args = ['-m32'] +c_link_args = ['-m32', '-Wl,-z,defs'] +needs_exe_wrapper = false diff --git a/meson/i686-w64-mingw32 b/meson/i686-w64-mingw32 new file mode 100644 index 0000000..3cb44ac --- /dev/null +++ b/meson/i686-w64-mingw32 @@ -0,0 +1,17 @@ +[host_machine] +system = 'windows' +cpu_family = 'i686' +cpu = 'i686' +endian = 'little' + +[binaries] +c = '/usr/bin/i686-w64-mingw32-gcc' +cpp = '/usr/bin/i686-w64-mingw32-c++' +ar = '/usr/bin/i686-w64-mingw32-ar' +strip = '/usr/bin/i686-w64-mingw32-strip' +pkgconfig = '/usr/bin/pkg-config' +exe_wrapper = '/usr/bin/wine' + +[properties] +root = '/usr/i686-w64-mingw32' +needs_exe_wrapper = true diff --git a/meson/universal-apple-darwin b/meson/universal-apple-darwin new file mode 100644 index 0000000..0ee2e02 --- /dev/null +++ b/meson/universal-apple-darwin @@ -0,0 +1,19 @@ +[host_machine] +system = 'darwin' +cpu_family = 'x86_64' +cpu = 'x86_64' +endian = 'little' + +[binaries] +c = '/usr/universal-apple-darwin/bin/x86_64-apple-darwin15-clang' +cpp = '/usr/universal-apple-darwin/bin/x86_64-apple-darwin15-clang++' +objc = '/usr/universal-apple-darwin/bin/x86_64-apple-darwin15-clang' +ar = '/usr/universal-apple-darwin/bin/x86_64-apple-darwin15-ar' +strip = '/usr/universal-apple-darwin/bin/x86_64-apple-darwin15-strip' +pkgconfig = '/usr/bin/pkg-config' + +[properties] +root = '/usr/universal-apple-darwin/SDK/MacOSX10.11.sdk' +c_args = ['-arch', 'i386', '-arch', 'x86_64'] +c_link_args = ['-arch', 'i386', '-arch', 'x86_64'] +needs_exe_wrapper = true diff --git a/meson/x86_64-linux-gnu b/meson/x86_64-linux-gnu new file mode 100644 index 0000000..b09321c --- /dev/null +++ b/meson/x86_64-linux-gnu @@ -0,0 +1,16 @@ +[host_machine] +system = 'linux' +cpu_family = 'x86_64' +cpu = 'x86_64' +endian = 'little' + +[binaries] +c = '/usr/bin/x86_64-linux-gnu-gcc' +cpp = '/usr/bin/x86_64-linux-gnu-g++' +ar = '/usr/bin/x86_64-linux-gnu-ar' +strip = '/usr/bin/x86_64-linux-gnu-strip' +pkgconfig = '/usr/bin/pkg-config' + +[properties] +c_link_args = ['-Wl,-z,defs'] +needs_exe_wrapper = false diff --git a/meson/x86_64-w64-mingw32 b/meson/x86_64-w64-mingw32 new file mode 100644 index 0000000..77dd3a5 --- /dev/null +++ b/meson/x86_64-w64-mingw32 @@ -0,0 +1,17 @@ +[host_machine] +system = 'windows' +cpu_family = 'x86_64' +cpu = 'x86_64' +endian = 'little' + +[binaries] +c = '/usr/bin/x86_64-w64-mingw32-gcc' +cpp = '/usr/bin/x86_64-w64-mingw32-c++' +ar = '/usr/bin/x86_64-w64-mingw32-ar' +strip = '/usr/bin/x86_64-w64-mingw32-strip' +pkgconfig = '/usr/bin/pkg-config' +exe_wrapper = '/usr/bin/wine64' + +[properties] +root = '/usr/x86_64-w64-mingw32' +needs_exe_wrapper = true -- 2.38.5