improve Wx GCC ABI check #142

Start checking the ABI version at -fabi-version=0, which is the default,
and if that succeeds don't set the flag at all.

This will allow the code to work properly if and when Wx removes the ABI
check alltogether.
This commit is contained in:
Rafael Kitover 2017-09-02 18:52:01 -07:00
parent 4b1c9b4e86
commit b1937fe9cb
1 changed files with 2 additions and 2 deletions

View File

@ -111,7 +111,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX)
INCLUDE(CheckCXXSourceRuns)
UNSET(WX_ABI_MATCHES)
SET(WX_ABI_VERSION 1)
SET(WX_ABI_VERSION 0)
SET(CURRENT_DEFS ${CMAKE_REQUIRED_DEFINITIONS})
SET(CURRENT_LIBS ${CMAKE_REQUIRED_LIBRARIES})
@ -149,7 +149,7 @@ wxIMPLEMENT_APP(MyApp);
SET(CMAKE_REQUIRED_DEFINITIONS ${CURRENT_DEFS})
SET(CMAKE_REQUIRED_LIBRARIES ${CURRENT_LIBS})
IF(${${WX_ABI_VAR}})
IF(${${WX_ABI_VAR}} AND (NOT WX_ABI_VERSION EQUAL 0))
# add C++ flags
STRING(REGEX REPLACE "<FLAGS>" "<FLAGS> -fabi-version=${WX_ABI_VERSION} " CMAKE_CXX_COMPILE_OBJECT ${CMAKE_CXX_COMPILE_OBJECT})
SET(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_CXX_LINK_EXECUTABLE} -fabi-version=${WX_ABI_VERSION}")