All: under mingw32+msys: fix an issue when using Cmake version >= 2.8.5 which uses by default a response file.
This response file is not expanded under mingw3 2 (mingw/gcc bug?), and the list of include paths, found in this file, is not taken in account. Now, under mingw32+msys, when not cross-compiling, the response file is disabled. Cvpcb, Pcbnew: fix a list of libs which should be added only when cross-compiling: Previously, they were always added, which creates an issue with mingw/msy/ gcc 2.8. Now they are added only when cross-compiling (this issue was noticeable only with msys+mingw version 2.8)
This commit is contained in:
parent
683a655fa7
commit
5cea94089a
|
@ -115,6 +115,26 @@ if( CMAKE_COMPILER_IS_GNUCXX )
|
||||||
if( MINGW )
|
if( MINGW )
|
||||||
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" )
|
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" )
|
||||||
|
|
||||||
|
# _UNICODE definition seems needed under mingw/gcc 4.8
|
||||||
|
# (Kicad uses unicode, and on Windows, wxWidgets >= 2.9.4 is mandatory
|
||||||
|
# and uses unicode)
|
||||||
|
if( GCC_VERSION VERSION_EQUAL 4.8.0 OR GCC_VERSION VERSION_GREATER 4.8.0 )
|
||||||
|
add_definitions(-D_UNICODE)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Since version 2.8.5, Cmake uses a response file (.rsp) to
|
||||||
|
# pass the list of include paths to gcc
|
||||||
|
# unfortunately, under mingw32+msys, at least with gcc 4.8 and previous,
|
||||||
|
# this file is not expanded and include paths defined in this file are not taken in account
|
||||||
|
# this is the case of wxWidgets includes
|
||||||
|
# Disable this response file for includes ( See Windows-GNU.cmake module )
|
||||||
|
if( WIN32 AND MSYS AND NOT CMAKE_CROSSCOMPILING )
|
||||||
|
# fixme: it is needed only with MSYS+MINGW32? or always under MINGW
|
||||||
|
if (${CMAKE_SIZEOF_VOID_P} MATCHES 4)
|
||||||
|
set(CMAKE_CXX_USE_RESPONSE_FILE_FOR_INCLUDES 0)
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
else()
|
else()
|
||||||
# We build DLL/DSOs from static libraries, so create position independent code
|
# We build DLL/DSOs from static libraries, so create position independent code
|
||||||
# for all cases, since we do not have DLL/DSO specific static libraries.
|
# for all cases, since we do not have DLL/DSO specific static libraries.
|
||||||
|
|
|
@ -110,7 +110,7 @@ target_link_libraries( cvpcb
|
||||||
)
|
)
|
||||||
|
|
||||||
# Only for win32 cross compilation using MXE
|
# Only for win32 cross compilation using MXE
|
||||||
if(WIN32 AND MSYS)
|
if( WIN32 AND MSYS AND CMAKE_CROSSCOMPILING )
|
||||||
target_link_libraries(cvpcb
|
target_link_libraries(cvpcb
|
||||||
opengl32
|
opengl32
|
||||||
glu32
|
glu32
|
||||||
|
@ -119,7 +119,7 @@ target_link_libraries(cvpcb
|
||||||
freetype
|
freetype
|
||||||
bz2
|
bz2
|
||||||
)
|
)
|
||||||
endif(WIN32 AND MSYS)
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if( BUILD_GITHUB_PLUGIN )
|
if( BUILD_GITHUB_PLUGIN )
|
||||||
|
|
|
@ -551,7 +551,7 @@ target_link_libraries( pcbnew
|
||||||
)
|
)
|
||||||
|
|
||||||
# Only for win32 cross compilation using MXE
|
# Only for win32 cross compilation using MXE
|
||||||
if(WIN32 AND MSYS)
|
if( WIN32 AND MSYS AND CMAKE_CROSSCOMPILING )
|
||||||
target_link_libraries(pcbnew
|
target_link_libraries(pcbnew
|
||||||
opengl32
|
opengl32
|
||||||
glu32
|
glu32
|
||||||
|
@ -560,7 +560,7 @@ target_link_libraries(pcbnew
|
||||||
freetype
|
freetype
|
||||||
bz2
|
bz2
|
||||||
)
|
)
|
||||||
endif(WIN32 AND MSYS)
|
endif()
|
||||||
|
|
||||||
if( MAKE_LINK_MAPS )
|
if( MAKE_LINK_MAPS )
|
||||||
# generate a link map with cross reference
|
# generate a link map with cross reference
|
||||||
|
|
Loading…
Reference in New Issue