fix linux build broken in 687c08a

Stop saving and restoring the CMAKE_REQUIRED_* variables for the compile
test, because the subsequent Wx header symbol tests need them set up for
Wx support as well.

Also --param foo=bar needs to be a single string in the list of compiler
flags, or cmake can misinterpret the second part as a library when it is
passed to libraries/link-options.
This commit is contained in:
Rafael Kitover 2017-03-10 06:38:50 -08:00
parent 145f6d433c
commit 82c8a1e3fa
2 changed files with 2 additions and 11 deletions

View File

@ -345,7 +345,7 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
CHECK_CXX_COMPILER_FLAG("--param ssp-buffer-size=4" SSP_BUFFER_SIZE_FLAG)
IF(SSP_BUFFER_SIZE_FLAG)
SET(MY_C_FLAGS ${MY_C_FLAGS} --param ssp-buffer-size=4)
SET(MY_C_FLAGS ${MY_C_FLAGS} "--param ssp-buffer-size=4")
ENDIF()
ENDIF()

View File

@ -87,13 +87,9 @@ ENDFOREACH()
# check if this build of wx actually has OpenGL support
SET(CURRENT_CMAKE_REQUIRED_LIBRARIES ${CMAKE_REQUIRED_LIBRARIES})
SET(CURRENT_CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS})
SET(CURRENT_CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES})
SET(CURRENT_CMAKE_REQUIRED_DEFINITIONS ${CMAKE_REQUIRED_DEFINITIONS})
SET(CMAKE_REQUIRED_LIBRARIES ${MY_CXX_FLAGS} ${MY_C_FLAGS} ${MY_CXX_LINKER_FLAGS} ${MY_C_LINKER_FLAGS} ${CMAKE_REQUIRED_LIBRARIES} ${wxWidgets_LIBRARIES})
SET(CMAKE_REQUIRED_FLAGS ${CMAKE_REQUIRED_FLAGS} ${wxWidgets_CXX_FLAGS} ${MY_CXX_FLAGS} ${MY_C_FLAGS})
SET(CMAKE_REQUIRED_INCLUDES ${CMAKE_REQUIRED_INCLUDES} ${wxWidgets_INCLUDE_DIRS})
FOREACH(DEF ${wxWidgets_DEFINITIONS})
@ -120,11 +116,6 @@ IF(NOT WX_HAS_OPENGL)
FIND_PACKAGE(wxWidgets REQUIRED)
ENDIF()
SET(CMAKE_REQUIRED_LIBRARIES ${CURRENT_CMAKE_REQUIRED_LIBRARIES})
SET(CMAKE_REQUIRED_FLAGS ${CURRENT_CMAKE_REQUIRED_FLAGS})
SET(CMAKE_REQUIRED_INCLUDES ${CURRENT_CMAKE_REQUIRED_INCLUDES})
SET(CMAKE_REQUIRED_DEFINITIONS ${CURRENT_CMAKE_REQUIRED_DEFINITIONS})
# end of wx OpenGL check
FOREACH(CXX_COMPILE_FLAG ${wxWidgets_CXX_FLAGS})