Fix compiler flag usage
The compiler flags overwrote the default values that CMake generates instead of appending to them.
This commit is contained in:
@ -146,16 +146,6 @@ if(CMAKE_VERSION VERSION_GREATER 2.6)
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
|
||||||
IF(DEFINED OLEVEL)
|
|
||||||
if((OLEVEL GREATER -1) AND (OLEVEL LESS 4) )
|
|
||||||
set(FLAGS "${FLAGS} -O${OLEVEL}" CACHE STRING "Compilation flags" FORCE)
|
|
||||||
message(STATUS "Optimization level at: ${OLEVEL}")
|
|
||||||
else()
|
|
||||||
message(WARNING "Optimization level was set to a bad value, ignoring it. (Valid values are 0-3)")
|
|
||||||
endif()
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if(GCOV)
|
if(GCOV)
|
||||||
set(FLAGS "${FLAGS} -fprofile-arcs -ftest-coverage" CACHE STRING "Compilation flags" FORCE)
|
set(FLAGS "${FLAGS} -fprofile-arcs -ftest-coverage" CACHE STRING "Compilation flags" FORCE)
|
||||||
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov")
|
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lgcov")
|
||||||
@ -168,19 +158,19 @@ endif()
|
|||||||
|
|
||||||
if(USE_C99)
|
if(USE_C99)
|
||||||
message(STATUS "Using C99 standard")
|
message(STATUS "Using C99 standard")
|
||||||
set(CMAKE_C_FLAGS "-std=c99 -D_GNU_SOURCE=1 ${FLAGS}")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=c99 -D_GNU_SOURCE=1 ${FLAGS}")
|
||||||
else()
|
else()
|
||||||
set(CMAKE_C_FLAGS "${FLAGS}")
|
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${FLAGS}")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
set(CMAKE_C_FLAGS_DEBUG "${DEBUG_FLAGS} -DSS_DEBUG -DLOG_ASSERT")
|
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} ${DEBUG_FLAGS} -DSS_DEBUG -DLOG_ASSERT")
|
||||||
set(CMAKE_C_FLAGS_RELEASE "")
|
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -Wno-uninitialized")
|
||||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "-ggdb")
|
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -ggdb -Wno-uninitialized")
|
||||||
|
|
||||||
set(CMAKE_CXX_FLAGS "${FLAGS} -Wno-deprecated-declarations")
|
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${FLAGS} -Wno-deprecated-declarations")
|
||||||
set(CMAKE_CXX_FLAGS_DEBUG "${DEBUG_FLAGS} -DSS_DEBUG -DLOG_ASSERT -Wno-deprecated-declarations")
|
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} ${DEBUG_FLAGS} -DSS_DEBUG -DLOG_ASSERT -Wno-deprecated-declarations")
|
||||||
set(CMAKE_CXX_FLAGS_RELEASE "-Wno-deprecated-declarations")
|
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wno-deprecated-declarations -Wno-uninitialized")
|
||||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "-ggdb -Wno-deprecated-declarations")
|
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -ggdb -Wno-deprecated-declarations -Wno-uninitialized")
|
||||||
|
|
||||||
include_directories(include)
|
include_directories(include)
|
||||||
include_directories(server/inih)
|
include_directories(server/inih)
|
||||||
|
@ -264,7 +264,7 @@ typedef enum skygw_chk_t
|
|||||||
(SERVER_IS_SLAVE(s) ? "RUNNING SLAVE" : \
|
(SERVER_IS_SLAVE(s) ? "RUNNING SLAVE" : \
|
||||||
(SERVER_IS_JOINED(s) ? "RUNNING JOINED" : \
|
(SERVER_IS_JOINED(s) ? "RUNNING JOINED" : \
|
||||||
(SERVER_IS_NDB(s) ? "RUNNING NDB" : \
|
(SERVER_IS_NDB(s) ? "RUNNING NDB" : \
|
||||||
((SERVER_IS_RUNNING(s) && SERVER_IN_MAINT(s)) ? "RUNNING MAINTENANCE" : \
|
((!SERVER_IS_DOWN(s) && SERVER_IN_MAINT(s)) ? "RUNNING MAINTENANCE" : \
|
||||||
(SERVER_IS_RELAY_SERVER(s) ? "RUNNING RELAY" : \
|
(SERVER_IS_RELAY_SERVER(s) ? "RUNNING RELAY" : \
|
||||||
(SERVER_IS_RUNNING(s) ? "RUNNING (only)" : \
|
(SERVER_IS_RUNNING(s) ? "RUNNING (only)" : \
|
||||||
(SERVER_IS_DOWN(s) ? "DOWN" : "UNKNOWN STATUS"))))))))
|
(SERVER_IS_DOWN(s) ? "DOWN" : "UNKNOWN STATUS"))))))))
|
||||||
|
@ -3020,7 +3020,8 @@ int mxs_log_message(int priority,
|
|||||||
assert(!true);
|
assert(!true);
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(len == augmentation_len);
|
(void)len;
|
||||||
|
ss_dassert(len == augmentation_len);
|
||||||
}
|
}
|
||||||
|
|
||||||
va_start(valist, format);
|
va_start(valist, format);
|
||||||
|
@ -630,7 +630,6 @@ avro_binlog_end_t avro_read_all_events(AVRO_INSTANCE *router)
|
|||||||
{
|
{
|
||||||
int event_header_length;
|
int event_header_length;
|
||||||
int event_header_ntypes;
|
int event_header_ntypes;
|
||||||
int n_events;
|
|
||||||
|
|
||||||
/** Extract the event header lengths */
|
/** Extract the event header lengths */
|
||||||
event_header_length = ptr[2 + 50 + 4];
|
event_header_length = ptr[2 + 50 + 4];
|
||||||
@ -653,15 +652,10 @@ avro_binlog_end_t avro_read_all_events(AVRO_INSTANCE *router)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
n_events = hdr.event_size - event_header_length - (2 + 50 + 4 + 1);
|
uint8_t *checksum = ptr + hdr.event_size - event_header_length - event_header_ntypes;
|
||||||
|
if (checksum[0] == 1)
|
||||||
if (event_header_ntypes < n_events)
|
|
||||||
{
|
{
|
||||||
uint8_t *checksum = ptr + hdr.event_size - event_header_length - event_header_ntypes;
|
found_chksum = true;
|
||||||
if (checksum[0] == 1)
|
|
||||||
{
|
|
||||||
found_chksum = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Decode CLOSE/STOP Event */
|
/* Decode CLOSE/STOP Event */
|
||||||
|
Reference in New Issue
Block a user