Commit 271fcfaf authored by Jonathan Perkin's avatar Jonathan Perkin

No need to save/restore C*FLAGS, they are only used for one script.

Use CMAKE_*_FLAGS_RELWITHDEBINFO for C*FLAGS expansion, they are
the most likely to contain the flags we need.
parent 59644045
...@@ -90,15 +90,13 @@ IF(MALLOC_LIB) ...@@ -90,15 +90,13 @@ IF(MALLOC_LIB)
ENDIF() ENDIF()
IF(CMAKE_GENERATOR MATCHES "Makefiles") IF(CMAKE_GENERATOR MATCHES "Makefiles")
# No multiconfig build - use CMAKE_C_FLAGS SET(CFLAGS "@CMAKE_C_FLAGS_RELWITHDEBINFO@")
SET(CFLAGS "@CMAKE_C_FLAGS@") SET(CXXFLAGS "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@")
SET(CXXFLAGS "@CMAKE_CXX_FLAGS@")
FOREACH(ARCH ${CMAKE_OSX_ARCHITECTURES}) FOREACH(ARCH ${CMAKE_OSX_ARCHITECTURES})
SET(CFLAGS "${CFLAGS} -arch ${ARCH}") SET(CFLAGS "${CFLAGS} -arch ${ARCH}")
SET(CXXFLAGS "${CXXFLAGS} -arch ${ARCH}") SET(CXXFLAGS "${CXXFLAGS} -arch ${ARCH}")
ENDFOREACH() ENDFOREACH()
ELSE() ELSE()
# Multiconfig build - use CMAKE_C_FLAGS_RELWITHDEBINFO
SET(CFLAGS "@CMAKE_C_FLAGS_RELWITHDEBINFO@") SET(CFLAGS "@CMAKE_C_FLAGS_RELWITHDEBINFO@")
SET(CXXFLAGS "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@") SET(CXXFLAGS "@CMAKE_CXX_FLAGS_RELWITHDEBINFO@")
ENDIF() ENDIF()
...@@ -144,16 +142,10 @@ SET(HOSTNAME "hostname") ...@@ -144,16 +142,10 @@ SET(HOSTNAME "hostname")
# and expand default cmake variables # and expand default cmake variables
SET(CC ${CMAKE_C_COMPILER}) SET(CC ${CMAKE_C_COMPILER})
SET(CXX ${CMAKE_CXX_COMPILER}) SET(CXX ${CMAKE_CXX_COMPILER})
# Override CFLAGS for mysqlbug then reset
SET(BACKUP_CFLAGS ${CFLAGS})
SET(BACKUP_CXXFLAGS ${CXXFLAGS})
SET(CFLAGS ${CMAKE_C_FLAGS_RELWITHDEBINFO})
SET(CXXFLAGS ${CMAKE_CXX_FLAGS_RELWITHDEBINFO})
#
SET(SAVE_CC ${CMAKE_C_COMPILER}) SET(SAVE_CC ${CMAKE_C_COMPILER})
SET(SAVE_CXX ${CMAKE_CXX_COMPILER}) SET(SAVE_CXX ${CMAKE_CXX_COMPILER})
SET(SAVE_CFLAGS ${CMAKE_C_FLAGS_RELWITHDEBINFO}) SET(SAVE_CFLAGS ${CFLAGS})
SET(SAVE_CXXFLAGS ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}) SET(SAVE_CXXFLAGS ${CXXFLAGS})
# XXX no cmake equivalent for this, just make one up # XXX no cmake equivalent for this, just make one up
SET(CONFIGURE_LINE "Built using CMake") SET(CONFIGURE_LINE "Built using CMake")
...@@ -183,10 +175,6 @@ INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/mysqlbug ...@@ -183,10 +175,6 @@ INSTALL_SCRIPT(${CMAKE_CURRENT_BINARY_DIR}/mysqlbug
COMPONENT Server COMPONENT Server
) )
# Reset CFLAGS/CXXFLAGS back
SET(CFLAGS ${BACKUP_CFLAGS})
SET(CXXFLAGS ${BACKUP_CXXFLAGS})
ENDIF(UNIX) ENDIF(UNIX)
# Really ugly, one script, "mysql_install_db", needs prefix set to ".", # Really ugly, one script, "mysql_install_db", needs prefix set to ".",
......
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