added missing debug compiler flags and tuned library linking flags

This commit is contained in:
Markus Makela
2014-09-18 11:05:40 +03:00
parent 95edddcbe5
commit 7471911087
3 changed files with 13 additions and 6 deletions

View File

@ -31,8 +31,15 @@ configure_file(${CMAKE_SOURCE_DIR}/server/include/version.h.in ${CMAKE_SOURCE_DI
configure_file(${CMAKE_SOURCE_DIR}/maxscale.conf.in ${CMAKE_SOURCE_DIR}/maxscale.conf)
configure_file(${CMAKE_SOURCE_DIR}/etc/init.d/maxscale.in ${CMAKE_SOURCE_DIR}/etc/init.d/maxscale)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -fPIC")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -fPIC")
if(BUILD_TYPE MATCHES Debug)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ggdb -O0 -pthread -pipe -DSS_DEBUG -Wformat -Werror=format-security -fstack-protector --param=ssp-buffer-size=4")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ggdb -O0 -pthread -pipe -DSS_DEBUG -Wformat -Werror=format-security -fstack-protector --param=ssp-buffer-size=4")
endif()
if(GCOV)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fprofile-arcs -ftest-coverage")

View File

@ -1,5 +1,5 @@
add_library(log_manager SHARED log_manager.cc)
target_link_libraries(log_manager utils pthread aio stdc++)
target_link_libraries(log_manager pthread aio stdc++)
install(TARGETS log_manager DESTINATION lib)
if(BUILD_TESTS)
add_subdirectory(test)

View File

@ -6,15 +6,15 @@ add_executable(maxscale atomic.c buffer.c spinlock.c gateway.c
gw_utils.c utils.c dcb.c load_utils.c session.c service.c server.c
poll.c config.c users.c hashtable.c dbusers.c thread.c gwbitmask.c
monitor.c adminusers.c secrets.c filter.c modutil.c hint.c housekeeper.c)
target_link_libraries(maxscale utils log_manager ssl aio pthread crypt dl ${EMBEDDED_LIB} crypto inih z rt m stdc++)
target_link_libraries(maxscale ${EMBEDDED_LIB} utils log_manager ssl aio pthread crypt dl crypto inih z rt m stdc++)
install(TARGETS maxscale DESTINATION bin)
add_executable(maxkeys maxkeys.c secrets.c utils.c)
target_link_libraries(maxkeys utils log_manager ssl aio pthread crypt dl ${EMBEDDED_LIB} crypto inih z rt m)
target_link_libraries(maxkeys utils log_manager pthread crypt crypto)
install(TARGETS maxkeys DESTINATION bin)
add_executable(maxpasswd maxpasswd.c secrets.c utils.c)
target_link_libraries(maxpasswd utils log_manager ssl aio pthread crypt dl ${EMBEDDED_LIB} crypto inih z rt m)
target_link_libraries(maxpasswd utils log_manager pthread crypt crypto)
install(TARGETS maxpasswd DESTINATION bin)
if(BUILD_TESTS)