Commit a952d4e4 authored by Luan Varaschim Welter's avatar Luan Varaschim Welter

SCRUM#113 toolchain for 32-bit windows target working

parent edb0489d
Pipeline #10922 passed with stages
in 10 minutes and 55 seconds
......@@ -8,6 +8,9 @@ requirements
c++ compiler
cmake
libudev
### cross compiling Linux Host/ Windows target ###
- i685-w64-mingw32-gcc compiler for Windows 32-bit target
- x86_64-w64-mingw32-gcc compiler for Windows 64-bit target
building and compiling
----------------------
......@@ -16,14 +19,17 @@ Run
$ cd build
$ cmake ..
to generate a `Makefile`, library objects and misterious CMake files, then
to generate a `Makefile`, library objects and misterious CMake files
or
$ cmake -D CMAKE_TOOLCHAIN_FILE=mingw_cross_toolchain_32-bit.cmake ..
to generate a `Makefile` for crosscompiling with a Linux Host/ W32 target
$ cmake -D CMAKE_TOOLCHAIN_FILE=mingw_cross_toolchain.cmake ..
or
to generate a `Makefile` for crosscompiling with a Linux Host/ W32 target
$ cmake -D CMAKE_TOOLCHAIN_FILE=mingw_cross_toolchain_64-bit.cmake ..
to generate a `Makefile` for crosscompiling with a Linux Host/ W64 target
$ make
......
......@@ -18,5 +18,4 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
pwd
echo "using gcc : 5.3 : x86_64-w64-mingw32-g++-posix ;" > tools/build/src/user-config.jam
echo "using gcc : 5.3 : ${1} ;" > tools/build/src/user-config.jam
......@@ -3,7 +3,7 @@
#include <agent/open_file.h>
#if defined(WIN32)
#include <windows.h>
#include <versionhelpers.h>
#include <agent/versionhelpers.h>
#include <agent/windows_helper.h>
#endif // WIN32
......
/**
* This file is part of the mingw-w64 runtime package.
* No warranty is given; refer to the file DISCLAIMER within this package.
*/
#ifndef _INC_VERSIONHELPERS
#define _INC_VERSIONHELPERS
#include <winapifamily.h>
#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) && !defined(__WIDL__)
#ifdef __cplusplus
#define VERSIONHELPERAPI inline bool
#else
#define VERSIONHELPERAPI FORCEINLINE BOOL
#endif
VERSIONHELPERAPI IsWindowsVersionOrGreater(WORD major, WORD minor, WORD servpack)
{
OSVERSIONINFOEXW vi = {sizeof(vi),major,minor,0,0,{0},servpack};
return VerifyVersionInfoW(&vi, VER_MAJORVERSION|VER_MINORVERSION|VER_SERVICEPACKMAJOR,
VerSetConditionMask(VerSetConditionMask(VerSetConditionMask(0,
VER_MAJORVERSION,VER_GREATER_EQUAL),
VER_MINORVERSION,VER_GREATER_EQUAL),
VER_SERVICEPACKMAJOR, VER_GREATER_EQUAL));
}
VERSIONHELPERAPI IsWindowsXPOrGreater(void) {
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 0);
}
VERSIONHELPERAPI IsWindowsXPSP1OrGreater(void) {
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 1);
}
VERSIONHELPERAPI IsWindowsXPSP2OrGreater(void) {
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 2);
}
VERSIONHELPERAPI IsWindowsXPSP3OrGreater(void) {
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINXP), LOBYTE(_WIN32_WINNT_WINXP), 3);
}
VERSIONHELPERAPI IsWindowsVistaOrGreater(void) {
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 0);
}
VERSIONHELPERAPI IsWindowsVistaSP1OrGreater(void) {
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 1);
}
VERSIONHELPERAPI IsWindowsVistaSP2OrGreater(void) {
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_VISTA), LOBYTE(_WIN32_WINNT_VISTA), 2);
}
VERSIONHELPERAPI IsWindows7OrGreater(void) {
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 0);
}
VERSIONHELPERAPI IsWindows7SP1OrGreater(void) {
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN7), LOBYTE(_WIN32_WINNT_WIN7), 1);
}
VERSIONHELPERAPI IsWindows8OrGreater(void) {
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WIN8), LOBYTE(_WIN32_WINNT_WIN8), 0);
}
VERSIONHELPERAPI IsWindows8Point1OrGreater(void) {
return IsWindowsVersionOrGreater(HIBYTE(_WIN32_WINNT_WINBLUE), LOBYTE(_WIN32_WINNT_WINBLUE), 0);
}
VERSIONHELPERAPI IsWindowsServer(void) {
OSVERSIONINFOEXW vi = {sizeof(vi),0,0,0,0,{0},0,0,0,VER_NT_WORKSTATION};
return !VerifyVersionInfoW(&vi, VER_PRODUCT_TYPE, VerSetConditionMask(0, VER_PRODUCT_TYPE, VER_EQUAL));
}
#endif
#endif
SET ( CMAKE_SYSTEM_NAME Windows )
SET ( CROSS_COMPILING ON )
SET ( CMAKE_C_COMPILER i686-w64-mingw32-gcc-posix )
SET ( CMAKE_CXX_COMPILER i686-w64-mingw32-g++-posix )
SET ( CMAKE_RC_COMPILER i686-w64-mingw32-windres )
SET ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWIN32" )
SET ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -static -lwinpthread" )
SET ( CROSS_STATIC "iphlpapi" )
# here is the target environment located
SET(CMAKE_FIND_ROOT_PATH /usr/i686-w64-mingw32 )
# 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)
......@@ -44,7 +44,7 @@ if (NOT Boost)
GIT_SUBMODULES libs/asio libs/config libs/core libs/date_time libs/detail libs/io libs/iterator libs/predef libs/preprocessor libs/smart_ptr libs/throw_exception libs/system libs/filesystem libs/integer tools/build tools/bcp libs/serialization libs/interprocess libs/tokenizer libs/algorithm libs/program_options libs/regex libs/static_assert libs/thread libs/utility libs/numeric libs/range libs/array libs/bind libs/concept_check libs/lexical_cast libs/math libs/functional libs/assert libs/type_traits libs/mpl libs/move libs/container libs/any libs/type_index libs/function libs/chrono libs/ratio libs/intrusive libs/spirit libs/winapi libs/tuple libs/exception libs/optional
UPDATE_COMMAND ./bootstrap.sh --without-icu --with-libraries=filesystem,system,regex,program_options --includedir=${CMAKE_BINARY_DIR}/include/ && ${CMAKE_BINARY_DIR}/../configure_boost_crosscompile.sh
UPDATE_COMMAND ./bootstrap.sh --without-icu --with-libraries=filesystem,system,regex,program_options --includedir=${CMAKE_BINARY_DIR}/include/ && ${CMAKE_BINARY_DIR}/../configure_boost_crosscompile.sh ${CMAKE_CXX_COMPILER}
CONFIGURE_COMMAND ./b2 headers
BUILD_COMMAND ./b2 link=static install --libdir=${CMAKE_BINARY_DIR}/lib toolset=gcc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment