File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ include(coveralls)
6969find_package (Git REQUIRED)
7070# version.cmake will get the current PADDLE_VERSION
7171include (version )
72- add_definitions (-DPADDLE_VERSION=\" ${PADDLE_VERSION} \" )
72+ add_definitions (-DPADDLE_VERSION=${PADDLE_VERSION} )
7373
7474if (NOT WITH_GPU)
7575 add_definitions (-DPADDLE_ONLY_CPU)
Original file line number Diff line number Diff line change @@ -33,7 +33,11 @@ void printVersion(std::ostream& os) {
3333#ifndef PADDLE_VERSION
3434#define PADDLE_VERSION " unknown"
3535#endif
36- os << " paddle version: " << PADDLE_VERSION << std::endl
36+ // converts macro to string https://gcc.gnu.org/onlinedocs/cpp/Stringification.html
37+ #define xstr (s ) str(s)
38+ #define str (s ) #s
39+
40+ os << " paddle version: " << xstr (PADDLE_VERSION) << std::endl
3741 << std::boolalpha << " \t "
3842 << " withGpu: " << version::isWithGpu () << std::endl
3943 << " \t "
You can’t perform that action at this time.
0 commit comments