1
0
mirror of https://github.com/pdf2htmlEX/pdf2htmlEX.git synced 2024-12-22 13:00:08 +00:00

check more c++11 features

This commit is contained in:
Lu Wang 2014-11-17 22:53:42 +08:00
parent bd891e7eb0
commit 24dd236614
2 changed files with 14 additions and 3 deletions

View File

@ -84,10 +84,20 @@ else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x")
endif() endif()
include(CheckCXXCompilerFlag) # check the C++11 features we need
check_cxx_compiler_flag("${CMAKE_CXX_FLAGS}" CXX0X_SUPPORT) include(CheckCXXSourceCompiles)
check_cxx_source_compiles("
#include <vector>
int main()
{
char * ptr = nullptr;
std::vector<int> v;
auto f = [&](){ for(auto & i : v) ++i; };
f();
}
" CXX0X_SUPPORT)
if(NOT CXX0X_SUPPORT) if(NOT CXX0X_SUPPORT)
message(FATAL_ERROR "Error: your compiler does not support C++0x, please update it.") message(FATAL_ERROR "Error: your compiler does not support C++0x/C++11, please update it.")
endif() endif()

1
test/.gitattributes vendored Normal file
View File

@ -0,0 +1 @@
*.pdf binary