feat(shell): include build type when printing version

This commit is contained in:
Leonardo de Moura 2014-09-18 22:40:05 -07:00
parent dd31ed60b0
commit 2bde3f55d5
2 changed files with 7 additions and 2 deletions

View file

@ -62,7 +62,7 @@ endif()
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/") set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/Modules/")
# Initialize CXXFLAGS. # Initialize CXXFLAGS.
set(CMAKE_CXX_FLAGS "-Wall -Wextra -std=c++11 ${LEAN_EXTRA_CXX_FLAGS}") set(CMAKE_CXX_FLAGS "-Wall -Wextra -std=c++11 ${LEAN_EXTRA_CXX_FLAGS} -DLEAN_BUILD_TYPE=\"${CMAKE_BUILD_TYPE}\"")
set(CMAKE_CXX_FLAGS_DEBUG "-g -DLEAN_DEBUG -DLEAN_TRACE") set(CMAKE_CXX_FLAGS_DEBUG "-g -DLEAN_DEBUG -DLEAN_TRACE")
set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG") set(CMAKE_CXX_FLAGS_MINSIZEREL "-Os -DNDEBUG")
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG") set(CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG")

View file

@ -61,8 +61,13 @@ static void on_ctrl_c(int ) {
lean::request_interrupt(); lean::request_interrupt();
} }
#define XSTR(x) #x
#define STR(x) XSTR(x)
static void display_header(std::ostream & out) { static void display_header(std::ostream & out) {
out << "Lean (version " << LEAN_VERSION_MAJOR << "." << LEAN_VERSION_MINOR << ", commit " << std::string(g_githash).substr(0, 12) << ")\n"; out << "Lean (version " << LEAN_VERSION_MAJOR << "." << LEAN_VERSION_MINOR
<< ", commit " << std::string(g_githash).substr(0, 12)
<< ", " << STR(LEAN_BUILD_TYPE) << ")\n";
} }
static void display_help(std::ostream & out) { static void display_help(std::ostream & out) {