Fixed support for Clang
Minor addition to unit tests.
This commit is contained in:
parent
1926a9eabb
commit
d8dfba8361
2 changed files with 9 additions and 3 deletions
|
@ -19,17 +19,20 @@ target_include_directories(EntityComponentSystem INTERFACE ${CMAKE_SOURCE_DIR})
|
|||
include_directories(${CMAKE_SOURCE_DIR})
|
||||
|
||||
|
||||
set(CMAKE_CXX_FLAGS "-std=c++14 -Wall -Wextra")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14 -Wall -Wextra")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "-O0 -g")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "-O3 -D NDEBUG")
|
||||
|
||||
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(NOT (GCC_VERSION VERSION_GREATER 5.0 OR GCC_VERSION VERSION_EQUAL 5.0))
|
||||
message(FATAL_ERROR "${PROJECT_NAME} requires g++ 5.0 or greater.")
|
||||
endif ()
|
||||
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -stdlib=libc++")
|
||||
execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion OUTPUT_VARIABLE CLANG_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||
if(NOT (CLANG_VERSION VERSION_GREATER 3.4 OR CLANG_VERSION VERSION_EQUAL 3.4))
|
||||
message(FATAL_ERROR "${PROJECT_NAME} requires clang 3.4 or greater.")
|
||||
endif()
|
||||
elseif(MSVC)
|
||||
else()
|
||||
message(FATAL_ERROR "Your C++ compiler does not support C++14.")
|
||||
|
|
|
@ -124,6 +124,9 @@ TEST(Meta, Combine)
|
|||
listAllTemp = EC::Meta::IndexOf<T1, ListAll>::value;
|
||||
combinedAllTemp = EC::Meta::IndexOf<T1, CombinedAll>::value;
|
||||
EXPECT_EQ(combinedAllTemp, listAllTemp);
|
||||
|
||||
bool same = std::is_same<CombinedAll, ListAll>::value;
|
||||
EXPECT_TRUE(same);
|
||||
}
|
||||
|
||||
TEST(Meta, Morph)
|
||||
|
|
Loading…
Reference in a new issue