diff --git a/.gitignore b/.gitignore index a8f12de9..7e623b17 100644 --- a/.gitignore +++ b/.gitignore @@ -33,3 +33,7 @@ _ReSharper*/ *.suo *.sdf lib/ +*.ninja* +CMakeCache.txt +CMakeFiles/ +cmake_install.cmake diff --git a/CMakeLists.txt b/CMakeLists.txt index 2c82d2b1..b11bc933 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -65,7 +65,11 @@ if(WIN32) if(MINGW) add_definitions(-DNANA_MINGW) add_definitions(-DSTD_CODECVT_NOT_SUPPORTED) - option(NANA_THREAD_NOT_SUPPORTED "Use this flag if MinGW version is older than 4.8.1" ON) + if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + if(CMAKE_CXX_COMPILER_VERSION VERSION_LESS "4.8.1") + option(NANA_THREAD_NOT_SUPPORTED "Use this flag if MinGW version is older than 4.8.1" ON) + endif() + endif() if(NANA_THREAD_NOT_SUPPORTED) add_definitions(-DSTD_THREAD_NOT_SUPPORTED) endif() diff --git a/source/filesystem/filesystem.cpp b/source/filesystem/filesystem.cpp index 80396b00..50e28e33 100644 --- a/source/filesystem/filesystem.cpp +++ b/source/filesystem/filesystem.cpp @@ -430,8 +430,7 @@ namespace nana { delete[] p; return s; } - nana::string s = buf; - return s; + return nana::string(buf); } #elif defined(NANA_LINUX) const char * s = ::getenv("PWD");