Removed filename strings from release binary.

Reviewers: teon.banek, buda

Reviewed By: teon.banek

Subscribers: pullbot

Differential Revision: https://phabricator.memgraph.io/D839
This commit is contained in:
Matej Ferencevic 2017-10-03 10:36:16 +02:00
parent 5d2ee8f031
commit a40248ab65
4 changed files with 23 additions and 9 deletions

View File

@ -81,6 +81,11 @@ set(GTEST_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/googletest/include
mark_as_advanced(GTEST_LIBRARIES GTEST_INCLUDE_DIR) mark_as_advanced(GTEST_LIBRARIES GTEST_INCLUDE_DIR)
# setup google flags # setup google flags
set(GFLAGS_NO_FILENAMES "0")
if ("${CMAKE_BUILD_TYPE}" MATCHES "^(R|r)(E|e)(L|l).+")
set(GFLAGS_NO_FILENAMES "1")
endif()
ExternalProject_Add(gflags ExternalProject_Add(gflags
PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/gflags PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/gflags
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gflags SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gflags
@ -88,6 +93,7 @@ ExternalProject_Add(gflags
# Not needed, since gflags is C++ only. # Not needed, since gflags is C++ only.
# -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} # -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DGFLAGS_NO_FILENAMES=${GFLAGS_NO_FILENAMES}
-DBUILD_gflags_nothreads_LIB=OFF -DBUILD_gflags_nothreads_LIB=OFF
-DREGISTER_INSTALL_PREFIX=OFF -DREGISTER_INSTALL_PREFIX=OFF
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_SOURCE_DIR}/gflags) -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_SOURCE_DIR}/gflags)
@ -98,6 +104,13 @@ set(GFLAGS_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/gflags/include
mark_as_advanced(GFLAGS_LIBRARY GFLAGS_INCLUDE_DIR) mark_as_advanced(GFLAGS_LIBRARY GFLAGS_INCLUDE_DIR)
# Setup google logging after gflags (so that glog can use it). # Setup google logging after gflags (so that glog can use it).
set(GLOG_NO_FILENAMES "0")
set(GLOG_NO_STACKTRACE "0")
if ("${CMAKE_BUILD_TYPE}" MATCHES "^(R|r)(E|e)(L|l).+")
set(GLOG_NO_FILENAMES "1")
set(GLOG_NO_STACKTRACE "1")
endif()
ExternalProject_Add(glog DEPENDS gflags ExternalProject_Add(glog DEPENDS gflags
PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/glog PREFIX ${CMAKE_CURRENT_SOURCE_DIR}/glog
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/glog SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/glog
@ -105,6 +118,8 @@ ExternalProject_Add(glog DEPENDS gflags
-DCMAKE_C_COMPILER=${CMAKE_C_COMPILER} -DCMAKE_C_COMPILER=${CMAKE_C_COMPILER}
-DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER} -DCMAKE_CXX_COMPILER=${CMAKE_CXX_COMPILER}
-DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_SOURCE_DIR}/glog -DCMAKE_INSTALL_PREFIX=${CMAKE_CURRENT_SOURCE_DIR}/glog
-DGLOG_NO_FILENAMES=${GLOG_NO_FILENAMES}
-DGLOG_NO_STACKTRACE=${GLOG_NO_STACKTRACE}
-Dgflags_DIR=${CMAKE_CURRENT_SOURCE_DIR}/gflags/lib/cmake/gflags) -Dgflags_DIR=${CMAKE_CURRENT_SOURCE_DIR}/gflags/lib/cmake/gflags)
set(GLOG_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/glog/lib/libglog.a CACHE FILEPATH set(GLOG_LIBRARY ${CMAKE_CURRENT_SOURCE_DIR}/glog/lib/libglog.a CACHE FILEPATH
"Path to glog library" FORCE) "Path to glog library" FORCE)

View File

@ -66,9 +66,8 @@ git checkout ${googletest_tag}
cd .. cd ..
# google logging # google logging
#git clone https://github.com/google/glog.git git clone https://github.com/memgraph/glog.git
git clone git://deps.memgraph.io/glog.git glog_tag="b5e33a7468cf7da6412eb50d1e8e704da471f49f" # custom version (v0.3.5+)
glog_tag="a6a166db069520dbbd653c97c2e5b12e08a8bb26" # v0.3.5
cd glog cd glog
git checkout ${glog_tag} git checkout ${glog_tag}
cd .. cd ..
@ -82,9 +81,8 @@ git checkout ${lcov_to_xml_tag}
cd .. cd ..
# google flags # google flags
#git clone https://github.com/gflags/gflags.git git clone https://github.com/memgraph/gflags.git
git clone git://deps.memgraph.io/gflags.git gflags_tag="69ce2926338522788d500e916736ef47e70dd905" # custom version (May 6, 2017)
gflags_tag="652651b421ca5ac7b722a34a301fb656deca5198" # May 6, 2017
cd gflags cd gflags
git checkout ${gflags_tag} git checkout ${gflags_tag}
cd .. cd ..

View File

@ -94,7 +94,9 @@ void load_config(int &argc, char **&argv) {
} }
int main(int argc, char **argv) { int main(int argc, char **argv) {
google::SetUsageMessage("Memgraph database server");
gflags::SetVersionString(version_string); gflags::SetVersionString(version_string);
load_config(argc, argv); load_config(argc, argv);
google::InitGoogleLogging(argv[0]); google::InitGoogleLogging(argv[0]);

View File

@ -20,9 +20,8 @@
std::cerr << "ASSERT: " << message << std::endl; \ std::cerr << "ASSERT: " << message << std::endl; \
std::cerr << stacktrace.dump(); std::cerr << stacktrace.dump();
#else #else
#define __handle_assert_message(message) \ #define __handle_assert_message(message) \
std::cerr << "ASSERT: " << message << " In file " << __FILE__ << " #" \ std::cerr << "ASSERT: " << message << std::endl;
<< __LINE__ << std::endl;
#endif #endif
/** /**