kopia lustrzana https://github.com/stlink-org/stlink
Refactoring for package distribution
- New cpack package-config for DEB and RPM - Toolchain file for cross-building - Script to automate MinGW cross-building - Added file headers for .cmake files - Added dpkg and rpm to required pkgspull/960/head
rodzic
38a5c14877
commit
ce6ffe7030
20
.travis.yml
20
.travis.yml
|
@ -10,7 +10,7 @@ matrix:
|
|||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['gcc-5', 'libusb-1.0.0-dev', 'libgtk-3-dev']
|
||||
packages: ['gcc-5', 'libusb-1.0.0-dev', 'libgtk-3-dev', 'rpm']
|
||||
- os: linux
|
||||
env: BADGE=linux
|
||||
arch: x64
|
||||
|
@ -18,7 +18,7 @@ matrix:
|
|||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['gcc-7', 'libusb-1.0.0-dev', 'libgtk-3-dev']
|
||||
packages: ['gcc-7', 'libusb-1.0.0-dev', 'libgtk-3-dev', 'rpm']
|
||||
- os: linux
|
||||
env: BADGE=linux
|
||||
arch: x64
|
||||
|
@ -26,7 +26,7 @@ matrix:
|
|||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['gcc-9', 'libusb-1.0.0-dev', 'libgtk-3-dev']
|
||||
packages: ['gcc-9', 'libusb-1.0.0-dev', 'libgtk-3-dev', 'rpm']
|
||||
- os: linux
|
||||
env: BADGE=linux
|
||||
arch: x64
|
||||
|
@ -34,7 +34,7 @@ matrix:
|
|||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-xenial-3.7']
|
||||
packages: ['clang-3.7', 'libusb-1.0.0-dev', 'libgtk-3-dev']
|
||||
packages: ['clang-3.7', 'libusb-1.0.0-dev', 'libgtk-3-dev', 'rpm']
|
||||
- os: linux
|
||||
env: BADGE=linux
|
||||
arch: x64
|
||||
|
@ -42,7 +42,7 @@ matrix:
|
|||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-bionic-6.0']
|
||||
packages: ['clang-6.0', 'libusb-1.0.0-dev', 'libgtk-3-dev']
|
||||
packages: ['clang-6.0', 'libusb-1.0.0-dev', 'libgtk-3-dev', 'rpm']
|
||||
# - os: linux
|
||||
# arch: x64
|
||||
# compiler: clang-6.0
|
||||
|
@ -60,7 +60,7 @@ matrix:
|
|||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['gcc-5', 'libusb-1.0.0-dev', 'libgtk-3-dev']
|
||||
packages: ['gcc-5', 'libusb-1.0.0-dev', 'libgtk-3-dev', 'rpm']
|
||||
- os: linux
|
||||
env: BADGE=linux
|
||||
arch: x86
|
||||
|
@ -68,7 +68,7 @@ matrix:
|
|||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['gcc-7', 'libusb-1.0.0-dev', 'libgtk-3-dev']
|
||||
packages: ['gcc-7', 'libusb-1.0.0-dev', 'libgtk-3-dev', 'rpm']
|
||||
- os: linux
|
||||
env: BADGE=linux
|
||||
arch: x86
|
||||
|
@ -76,7 +76,7 @@ matrix:
|
|||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test']
|
||||
packages: ['gcc-9', 'libusb-1.0.0-dev', 'libgtk-3-dev']
|
||||
packages: ['gcc-9', 'libusb-1.0.0-dev', 'libgtk-3-dev', 'rpm']
|
||||
- os: linux
|
||||
env: BADGE=linux
|
||||
arch: x86
|
||||
|
@ -84,7 +84,7 @@ matrix:
|
|||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-xenial-3.7']
|
||||
packages: ['clang-3.7', 'libusb-1.0.0-dev', 'libgtk-3-dev']
|
||||
packages: ['clang-3.7', 'libusb-1.0.0-dev', 'libgtk-3-dev', 'rpm']
|
||||
- os: linux
|
||||
env: BADGE=linux
|
||||
arch: x86
|
||||
|
@ -92,7 +92,7 @@ matrix:
|
|||
addons:
|
||||
apt:
|
||||
sources: ['ubuntu-toolchain-r-test', 'llvm-toolchain-bionic-6.0']
|
||||
packages: ['clang-6.0', 'libusb-1.0.0-dev', 'libgtk-3-dev']
|
||||
packages: ['clang-6.0', 'libusb-1.0.0-dev', 'libgtk-3-dev', 'rpm']
|
||||
|
||||
### macOS ###
|
||||
- os: osx
|
||||
|
|
2
Makefile
2
Makefile
|
@ -45,7 +45,7 @@ package: build/Release
|
|||
@$(MAKE) -C build/Release package
|
||||
|
||||
test: debug
|
||||
@echo "[TEST]"
|
||||
@echo "[TEST] Debug"
|
||||
@$(MAKE) -C build/Debug test
|
||||
|
||||
build/Debug:
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
# Findlibusb.cmake
|
||||
# Find and install external libusb library
|
||||
|
||||
# Once done this will define
|
||||
#
|
||||
# LIBUSB_FOUND libusb present on system
|
||||
|
@ -8,7 +10,7 @@
|
|||
|
||||
include(FindPackageHandleStandardArgs)
|
||||
|
||||
if (APPLE) # macOS
|
||||
if (APPLE) # macOS
|
||||
FIND_PATH(
|
||||
LIBUSB_INCLUDE_DIR NAMES libusb.h
|
||||
HINTS /usr /usr/local /opt
|
||||
|
@ -25,7 +27,7 @@ if (APPLE) # macOS
|
|||
message(FATAL_ERROR "No libusb library found on your system! Install libusb-1.0 from Homebrew or MacPorts")
|
||||
endif ()
|
||||
|
||||
elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") # FreeBSD; libusb is integrated into the system
|
||||
elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") # FreeBSD; libusb is integrated into the system
|
||||
FIND_PATH(
|
||||
LIBUSB_INCLUDE_DIR NAMES libusb.h
|
||||
HINTS /usr/include
|
||||
|
@ -41,7 +43,7 @@ elseif (CMAKE_SYSTEM_NAME STREQUAL "FreeBSD") # FreeBSD; libusb is integrated
|
|||
message(FATAL_ERROR "Expected libusb library not found on your system! Verify your system integrity.")
|
||||
endif ()
|
||||
|
||||
elseif (WIN32) # Windows
|
||||
elseif (WIN32 OR (EXISTS "/etc/debian_version" AND MINGW)) # Windows or MinGW-toolchain on Debian
|
||||
# for MinGW/MSYS/MSVC: 64-bit or 32-bit?
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
set(ARCH 64)
|
||||
|
@ -49,7 +51,7 @@ elseif (WIN32) # Windows
|
|||
set(ARCH 32)
|
||||
endif ()
|
||||
|
||||
if (NOT EXISTS "/etc/debian_version")
|
||||
if (WIN32 AND NOT EXISTS "/etc/debian_version") # Skip this for Debian...
|
||||
FIND_PATH(
|
||||
LIBUSB_INCLUDE_DIR NAMES libusb.h
|
||||
HINTS /usr /usr/local /opt
|
||||
|
@ -71,12 +73,17 @@ elseif (WIN32) # Windows
|
|||
endif ()
|
||||
endif ()
|
||||
|
||||
if (NOT LIBUSB_FOUND OR EXISTS "/etc/debian_version")
|
||||
if (NOT LIBUSB_FOUND)
|
||||
# Preparations for installing libusb library
|
||||
set(LIBUSB_WIN_VERSION 1.0.23) # set libusb version
|
||||
set(LIBUSB_WIN_ARCHIVE libusb-${LIBUSB_WIN_VERSION}.7z)
|
||||
set(LIBUSB_WIN_ARCHIVE_PATH ${CMAKE_BINARY_DIR}/${LIBUSB_WIN_ARCHIVE})
|
||||
set(LIBUSB_WIN_OUTPUT_FOLDER ${CMAKE_BINARY_DIR}/3rdparty/libusb-${LIBUSB_WIN_VERSION})
|
||||
if (WIN32 AND NOT EXISTS "/etc/debian_version") # ... on native Windows systems
|
||||
set(LIBUSB_WIN_ARCHIVE_PATH ${CMAKE_BINARY_DIR}/${LIBUSB_WIN_ARCHIVE})
|
||||
set(LIBUSB_WIN_OUTPUT_FOLDER ${CMAKE_BINARY_DIR}/3rdparty/libusb-${LIBUSB_WIN_VERSION})
|
||||
else (EXISTS "/etc/debian_version" AND MINGW) # ... only for cross-building on Debian
|
||||
set(LIBUSB_WIN_ARCHIVE_PATH ${CMAKE_SOURCE_DIR}/build-mingw/${LIBUSB_WIN_ARCHIVE})
|
||||
set(LIBUSB_WIN_OUTPUT_FOLDER ${CMAKE_SOURCE_DIR}/build-mingw/3rdparty/libusb-${LIBUSB_WIN_VERSION})
|
||||
endif ()
|
||||
|
||||
# Get libusb package
|
||||
if (EXISTS ${LIBUSB_WIN_ARCHIVE_PATH}) # ... should the package be already there (for whatever reason)
|
||||
|
@ -107,6 +114,7 @@ elseif (WIN32) # Windows
|
|||
)
|
||||
|
||||
if (MINGW OR MSYS)
|
||||
set(LIBUSB_NAME usb-1.0)
|
||||
find_library(
|
||||
LIBUSB_LIBRARY NAMES ${LIBUSB_NAME}
|
||||
HINTS ${LIBUSB_WIN_OUTPUT_FOLDER}/MinGW${ARCH}/static
|
||||
|
@ -115,6 +123,7 @@ elseif (WIN32) # Windows
|
|||
)
|
||||
|
||||
else (MSVC)
|
||||
set(LIBUSB_NAME libusb-1.0.lib)
|
||||
find_library(
|
||||
LIBUSB_LIBRARY NAMES ${LIBUSB_NAME}
|
||||
HINTS ${LIBUSB_WIN_OUTPUT_FOLDER}/MS${ARCH}/dll
|
||||
|
@ -127,7 +136,7 @@ elseif (WIN32) # Windows
|
|||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(libusb DEFAULT_MSG LIBUSB_LIBRARY LIBUSB_INCLUDE_DIR)
|
||||
mark_as_advanced(LIBUSB_INCLUDE_DIR LIBUSB_LIBRARY)
|
||||
|
||||
else () # all other OS (unix-based)
|
||||
else () # all other OS (unix-based)
|
||||
FIND_PATH(
|
||||
LIBUSB_INCLUDE_DIR NAMES libusb.h
|
||||
HINTS /usr /usr/local /opt
|
||||
|
|
|
@ -1,3 +1,6 @@
|
|||
# c_flags.cmake
|
||||
# Configure C compiler flags
|
||||
|
||||
include(CheckCCompilerFlag)
|
||||
|
||||
function(add_cflag_if_supported flag)
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
# Determine project version
|
||||
# * Using Git
|
||||
# * Local .version file
|
||||
# get_version.cmake
|
||||
# Determine project version by using Git or a local .version file
|
||||
|
||||
set(__detect_version 0)
|
||||
|
||||
|
@ -77,13 +76,14 @@ if (GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git")
|
|||
endif(GIT_DESCRIBE_RESULT EQUAL 0)
|
||||
endif ()
|
||||
|
||||
##
|
||||
# Failure to read version via git
|
||||
# Possible cases:
|
||||
# -> git is not found or
|
||||
# -> /.git does not exist or
|
||||
# -> GIT_DESCRIBE failed or
|
||||
# -> version string is of invalid format
|
||||
|
||||
##
|
||||
if (NOT GIT_FOUND OR NOT EXISTS "${PROJECT_SOURCE_DIR}/.git" OR ERROR_FLAG EQUAL 1)
|
||||
message(STATUS "Git and/or repository not found.") # e.g. when building from source package
|
||||
message(STATUS "Try to detect version from \"${PROJECT_SOURCE_DIR}/.version\" file instead...")
|
||||
|
|
|
@ -0,0 +1,20 @@
|
|||
# set_toolchain.cmake
|
||||
# Toolchain file for cross-building on a Debian/Ubuntu Linux system
|
||||
|
||||
###
|
||||
# Set toolchain and configure target environment on the build host system
|
||||
###
|
||||
|
||||
# Set cross compilers to use for C and C++
|
||||
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
|
||||
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
|
||||
set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
|
||||
|
||||
# Set path to directory with headers and libraries of the cross compiler
|
||||
set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
|
||||
|
||||
# Modify default behavior of FIND_XXX() commands to search for headers and libraries
|
||||
# in the target environment and search for programs in the build 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)
|
|
@ -1,67 +1,68 @@
|
|||
# cpack_config.cmake
|
||||
# Configure and generate packages for distribution
|
||||
|
||||
###
|
||||
# Configure package
|
||||
###
|
||||
|
||||
set(CPACK_PACKAGE_NAME ${PROJECT_NAME})
|
||||
set(CPACK_PACKAGE_VERSION ${PROJECT_VERSION})
|
||||
set(CPACK_PACKAGE_DESCRIPTION "Open source STM32 MCU programming toolset")
|
||||
set(CPACK_PACKAGE_VENDOR "stlink-org")
|
||||
set(CMAKE_PROJECT_HOMEPAGE_URL "https://github.com/stlink-org/stlink")
|
||||
|
||||
set(CPACK_SET_DESTDIR "ON")
|
||||
set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_BINARY_DIR}/dist")
|
||||
|
||||
if (APPLE)
|
||||
if (APPLE) # macOS
|
||||
set(CPACK_GENERATOR "ZIP")
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-macosx-amd64")
|
||||
set(CPACK_INSTALL_PREFIX "")
|
||||
elseif (WIN32) ### TODO: Binary build config for windows...
|
||||
|
||||
elseif (WIN32 AND NOT EXISTS "/etc/debian_version") # Windows
|
||||
set(CPACK_GENERATOR "ZIP")
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-win32")
|
||||
set(CPACK_INSTALL_PREFIX "")
|
||||
|
||||
# Sample toolchain file for building for Windows from a Debian/Ubuntu Linux system.
|
||||
# Typical usage:
|
||||
# *) install cross compiler: `sudo apt-get install mingw-w64`
|
||||
# *) cd build
|
||||
# *) cmake -DCMAKE_TOOLCHAIN_FILE=./cmake/linux-mingw64.cmake ..
|
||||
# *) cmake -DCMAKE_TOOLCHAIN_FILE=./cmake/linux-mingw32.cmake ..
|
||||
elseif (WIN32) # Windows cross-build on Debian/Ubuntu
|
||||
set(CPACK_OUTPUT_FILE_PREFIX "${CMAKE_SOURCE_DIR}/build/Release/dist")
|
||||
set(CPACK_GENERATOR "ZIP")
|
||||
set(CPACK_PACKAGE_FILE_NAME "${PROJECT_NAME}-${PROJECT_VERSION}-${TOOLCHAIN_PREFIX}")
|
||||
set(CPACK_INSTALL_PREFIX "")
|
||||
|
||||
#set(CMAKE_SYSTEM_NAME Windows)
|
||||
#set(TOOLCHAIN_PREFIX x86_64-w64-mingw32)
|
||||
#set(TOOLCHAIN_PREFIX i686-w64-mingw32)
|
||||
|
||||
# cross compilers to use for C and C++
|
||||
#set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}-gcc)
|
||||
#set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}-g++)
|
||||
#set(CMAKE_RC_COMPILER ${TOOLCHAIN_PREFIX}-windres)
|
||||
|
||||
# target environment on the build host system
|
||||
# set 1st to dir with the cross compiler's C/C++ headers/libs
|
||||
#set(CMAKE_FIND_ROOT_PATH /usr/${TOOLCHAIN_PREFIX})
|
||||
|
||||
# modify default behavior of FIND_XXX() commands to
|
||||
# search for headers/libs in the target environment and
|
||||
# search for programs in the build 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)
|
||||
|
||||
elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND EXISTS "/etc/debian_version")
|
||||
elseif (EXISTS "/etc/debian_version") # Package-build is available on Debian/Ubuntu only
|
||||
message(STATUS "Debian-based Linux OS detected")
|
||||
|
||||
### Debian-specific
|
||||
set(CPACK_GENERATOR "DEB")
|
||||
set(CPACK_DEBIAN_PACKAGE_DESCRIPTION "Open source STM32 MCU programming toolset")
|
||||
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "https://github.com/stlink-org/stlink")
|
||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Luca Boccassi")
|
||||
set(CPACK_PACKAGE_CONTACT "bluca@debian.org")
|
||||
set(CPACK_GENERATOR "DEB;RPM") # RPM requires package `rpm`
|
||||
|
||||
## Set debian_revision number
|
||||
# Convention: Restart the debian_revision at 1 each time the upstream_version is increased.
|
||||
set(CPACK_DEBIAN_PACKAGE_RELEASE "0")
|
||||
###
|
||||
# Debian (DEB)
|
||||
###
|
||||
|
||||
## Debian package name
|
||||
# CPACK_DEB_PACKAGE_NAME --> Default: CPACK_PACKAGE_NAME
|
||||
|
||||
## DEB package file name
|
||||
# CPack DEB generator generates package file name in deb format:
|
||||
# <PackageName>_<VersionNumber>-<DebianRevisionNumber>_<DebianArchitecture>.deb
|
||||
set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT)
|
||||
|
||||
# CPACK_DEBIAN_PACKAGE_VERSION --> Default: CPACK_PACKAGE_VERSION
|
||||
|
||||
## Set debian_revision number
|
||||
# Convention: Restart the debian_revision at 1 each time the upstream_version is increased.
|
||||
set(CPACK_DEBIAN_PACKAGE_RELEASE "1")
|
||||
|
||||
# CPACK_DEBIAN_PACKAGE_ARCHITECTURE --> Default: Output of dpkg --print-architecture
|
||||
set(CPACK_DEBIAN_PACKAGE_DEPENDS "pkg-config, build-essential, debhelper (>=9), cmake (>= 3.4.2), libusb-1.0-0-dev (>= 1.0.20)")
|
||||
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Luca Boccassi <bluca@debian.org>")
|
||||
# CPACK_DEBIAN_PACKAGE_DESCRIPTION --> Default: CPACK_DEBIAN_PACKAGE_DESCRIPTION (as it is set)
|
||||
# CPACK_DEBIAN_PACKAGE_SECTION --> Default: “devel”
|
||||
# CPACK_DEBIAN_ARCHIVE_TYPE --> Default: “gnutar”
|
||||
# CPACK_DEBIAN_COMPRESSION_TYPE --> Default: “gzip”
|
||||
# CPACK_DEBIAN_PACKAGE_PRIORITY --> Default: “optional”
|
||||
# CPACK_DEBIAN_PACKAGE_HOMEPAGE --> Default: CMAKE_PROJECT_HOMEPAGE_URL
|
||||
set(CPACK_DEBIAN_PACKAGE_SUGGESTS "libgtk-3-dev, pandoc")
|
||||
|
||||
## Add CHANGELOG in Debian-specific format
|
||||
### TODO
|
||||
|
||||
|
@ -71,15 +72,36 @@ elseif (${CMAKE_SYSTEM_NAME} STREQUAL "Linux" AND EXISTS "/etc/debian_version")
|
|||
# Include a postinst-script
|
||||
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_SOURCE_DIR}/cmake/packaging/debian/postinst")
|
||||
|
||||
### rpm-specific ### TODO: Package config for opensuse should go here...
|
||||
###
|
||||
# Slackware & Redhat (RPM)
|
||||
###
|
||||
|
||||
# CPACK_RPM_PACKAGE_SUMMARY --> Default: CPACK_PACKAGE_DESCRIPTION_SUMMARY
|
||||
# CPACK_RPM_PACKAGE_NAME --> Default: CPACK_PACKAGE_NAME
|
||||
|
||||
## RPM package file name
|
||||
# Allow rpmbuild to generate package file name
|
||||
set(CPACK_RPM_FILE_NAME RPM-DEFAULT)
|
||||
|
||||
# CPACK_RPM_PACKAGE_VERSION --> Default: CPACK_PACKAGE_VERSION
|
||||
# CPACK_RPM_PACKAGE_ARCHITECTURE --> Default: Native architecture output by uname -m
|
||||
|
||||
## Set rpm revision number
|
||||
# Convention: Restart the debian_revision at 1 each time the upstream_version is increased.
|
||||
set(CPACK_RPM_PACKAGE_RELEASE "1")
|
||||
|
||||
set(CPACK_RPM_PACKAGE_LICENSE "BSD-3")
|
||||
# CPACK_RPM_PACKAGE_GROUP --> Default: “unknown” (RPM Groups are deprecated on Fedora)
|
||||
# CPACK_RPM_PACKAGE_VENDOR --> Default: CPACK_PACKAGE_VENDOR (as it is set)
|
||||
# CPACK_RPM_PACKAGE_URL --> Default: CMAKE_PROJECT_HOMEPAGE_URL
|
||||
set(CPACK_RPM_PACKAGE_DESCRIPTION CPACK_DEBIAN_PACKAGE_DESCRIPTION)
|
||||
else ()
|
||||
### TODO: Package config for fedora should go here...
|
||||
# No package configuration on other platforms ...
|
||||
endif ()
|
||||
|
||||
|
||||
###
|
||||
# Build package
|
||||
# Build packages
|
||||
###
|
||||
|
||||
include(CPack)
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
###
|
||||
# Build package with binaries for Windows
|
||||
###
|
||||
|
||||
# Install this cross-compiler toolchain:
|
||||
#sudo apt-get install mingw-w64
|
||||
|
||||
# x86_64
|
||||
mkdir build-mingw
|
||||
cd build-mingw
|
||||
cmake -DCMAKE_SYSTEM_NAME=Windows \
|
||||
-DTOOLCHAIN_PREFIX=x86_64-w64-mingw32 \
|
||||
-DCMAKE_TOOLCHAIN_FILE=./cmake/modules/set_toolchain.cmake ..
|
||||
make package
|
||||
cd ..
|
||||
rm -rf build-mingw
|
||||
|
||||
# i686
|
||||
mkdir build-mingw
|
||||
cd build-mingw
|
||||
cmake -DCMAKE_SYSTEM_NAME=Windows \
|
||||
-DTOOLCHAIN_PREFIX=i686-w64-mingw32 \
|
||||
-DCMAKE_TOOLCHAIN_FILE=./cmake/modules/set_toolchain.cmake ..
|
||||
make package
|
||||
cd ..
|
||||
rm -rf build-mingw
|
|
@ -1,10 +0,0 @@
|
|||
.debhelper
|
||||
files
|
||||
debhelper-build-stamp
|
||||
*.log
|
||||
*.substvars
|
||||
libstlink-dev
|
||||
libstlink
|
||||
stlink-gui
|
||||
stlink-tools
|
||||
tmp
|
|
@ -87,6 +87,8 @@ Install the following packages from your package repository:
|
|||
* `gcc` or `clang` or `mingw32-gcc` or `mingw64-gcc` (C-compiler; very likely gcc is already present)
|
||||
* `build-essential` (on Debian based distros (debian, ubuntu))
|
||||
* `cmake` (3.4.2 or later, use the latest version available from the repository)
|
||||
* `dpkg`
|
||||
* `rpm`
|
||||
* `pkg-config`
|
||||
* `libusb-1.0`
|
||||
* `libusb-1.0-0-dev` (development headers for building)
|
||||
|
|
Ładowanie…
Reference in New Issue