Skip to content

Commit 0b73318

Browse files
authored
Merge pull request #789 from F0REacH/nvcc_stray_character_fix
Fix nvcc stray character Issue #760
2 parents 49c881e + 38eddca commit 0b73318

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ include(coveralls)
6969
find_package(Git REQUIRED)
7070
# version.cmake will get the current PADDLE_VERSION
7171
include(version)
72-
add_definitions(-DPADDLE_VERSION=\"${PADDLE_VERSION}\")
72+
add_definitions(-DPADDLE_VERSION=${PADDLE_VERSION})
7373

7474
if(NOT WITH_GPU)
7575
add_definitions(-DPADDLE_ONLY_CPU)

paddle/utils/Version.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff 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"

0 commit comments

Comments
 (0)