Commit 7c340f6b authored by Brian Sidebotham's avatar Brian Sidebotham

* Fix building of Github plugin support for Windows using Mingw-w64

* Pre-built binaries for OpenSSL can be used from the LuaDist project: https://github.com/LuaDist/openssl/releases
* Building of Boost libraries fixed for Mingw-w64 for github plugin
parent 602aa168
......@@ -53,14 +53,7 @@ option( KICAD_SCRIPTING_WXPYTHON
option( USE_FP_LIB_TABLE "Use the new footprint library table implementation. ( default OFF)" )
# BUILD_GITHUB_PLUGIN for MINGW is pretty demanding due to download_openssl.cmake and openssl's
# use of perl to drive its configure step. You might find it works in a cross builder say on linux.
# Dick is not personally supporting Windows any more with this exotic stuff. Some other windows
# developer will have to smooth out the build issues. So enable this for MINGW without my help but
# with my best wishes.
if( NOT MINGW )
option( BUILD_GITHUB_PLUGIN "Build the GITHUB_PLUGIN for pcbnew." OFF )
endif()
option( BUILD_GITHUB_PLUGIN "Build the GITHUB_PLUGIN for pcbnew." OFF )
#Set version option (stable or testing)
......
......@@ -87,21 +87,27 @@ if( BUILD_GITHUB_PLUGIN )
# It will probably be simpler to make this the only path in the future.
# (BTW "test" yields "unit_test_framework" when passed to bootstrap.{sh,bat} ).
# (BTW "test" yields "unit_test_framework" when passed to bootstrap.sh ).
#message( STATUS "BOOST_LIBS_BUILT:${BOOST_LIBS_BUILT}" )
string( REPLACE "unit_test_framework" "test" libs_csv "${BOOST_LIBS_BUILT}" )
#message( STATUS "REPLACE libs_csv:${libs_csv}" )
string( REGEX REPLACE "\\;" "," libs_csv "${libs_csv}" )
#message( STATUS "libs_csv:${libs_csv}" )
string( REPLACE "unit_test_framework" "test" boost_libs_list "${BOOST_LIBS_BUILT}" )
#message( STATUS "REPLACE libs_csv:${boost_libs_list}" )
if( MINGW )
set( bootstrap "bootstart.bat mingw" )
set( bootstrap bootstrap.bat mingw )
foreach( lib ${boost_libs_list} )
set( b2_libs ${b2_libs} --with-${lib} )
endforeach()
unset( PIC_STUFF )
else()
set( bootstrap bootstrap.sh )
string( REGEX REPLACE "\\;" "," libs_csv "${boost_libs_list}" )
#message( STATUS "libs_csv:${libs_csv}" )
set( bootstrap bootstrap.sh --with-libraries=${libs_csv} )
# pass to *both* C and C++ compilers
set( PIC_STUFF "cflags=${PIC_FLAG}" )
set( BOOST_INCLUDE "${BOOST_ROOT}/include" )
unset( b2_libs )
endif()
ExternalProject_Add( boost
......@@ -120,13 +126,13 @@ if( BUILD_GITHUB_PLUGIN )
BINARY_DIR "${PREFIX}/src/boost/"
CONFIGURE_COMMAND ./${bootstrap}
--with-libraries=${libs_csv}
BUILD_COMMAND ./b2
variant=release
threading=multi
toolset=gcc
${PIC_STUFF}
${b2_libs}
#link=static
--prefix=<INSTALL_DIR>
install
......@@ -134,12 +140,35 @@ if( BUILD_GITHUB_PLUGIN )
INSTALL_COMMAND ""
)
if( MINGW )
execute_process( COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE )
string( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.[0-9]+.*" "\\1\\2" BOOST_GCC_VERSION ${GCC_VERSION} )
#message( STATUS "BOOST_GCC_VERSION: ${BOOST_GCC_VERSION}" )
string( REGEX REPLACE "([0-9]+)\\.([0-9]+)\\.([0-9])" "\\1_\\2" BOOST_LIB_VERSION ${BOOST_RELEASE} )
#message( STATUS "BOOST_LIB_VERSION: ${BOOST_LIB_VERSION}" )
# adjust the names of the libraries to suit the build. There's no
# symbolic links provided on the MinGW build to allow us to use
# generic names for the libs
foreach( lib ${BOOST_LIBS_BUILT} )
set( mingw_boost_libs ${mingw_boost_libs} ${lib}-mgw${BOOST_GCC_VERSION}-mt-${BOOST_LIB_VERSION} )
endforeach()
set( BOOST_LIBS_BUILT ${mingw_boost_libs} )
set( BOOST_INCLUDE "${BOOST_ROOT}/include/boost-${BOOST_LIB_VERSION}" )
unset( mingw_boost_libs )
endif()
set( boost_libs "" )
set_boost_lib_names( "${BOOST_LIBS_BUILT}" boost_libs )
#message( STATUS "BOOST_ROOT:${BOOST_ROOT} boost_libs:${boost_libs}" )
set( Boost_LIBRARIES ${boost_libs} CACHE FILEPATH "Boost libraries directory" )
set( Boost_INCLUDE_DIR "${BOOST_ROOT}/include" CACHE FILEPATH "Boost include directory" )
set( Boost_LIBRARIES ${boost_libs} CACHE FILEPATH "Boost libraries directory" )
set( Boost_INCLUDE_DIR "${BOOST_INCLUDE}" CACHE FILEPATH "Boost include directory" )
#message( STATUS "Boost_INCLUDE_DIR: ${Boost_INCLUDE_DIR}" )
else( BUILD_GITHUB_PLUGIN )
......
......@@ -26,7 +26,7 @@
#################################################
include( download_avhttp )
if( MINGW )
if( MINGW AND NOT OPENSSL_ROOT_DIR )
# download, compile and install to scratch dir a recent OPENSSL library and headers
include( download_openssl )
else()
......@@ -64,6 +64,13 @@ target_link_libraries( github_plugin
${OPENSSL_LIBRARIES}
)
if( MINGW )
target_link_libraries( github_plugin
${wxWidgets_LIBRARIES}
ws2_32
)
endif()
add_dependencies( github_plugin boost )
add_dependencies( github_plugin avhttp )
......
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