build: prepare testbed executable
This commit is contained in:
@@ -310,32 +310,31 @@ if(ENTT_INSTALL)
|
||||
export(PACKAGE EnTT)
|
||||
endif()
|
||||
|
||||
# Tests
|
||||
# Tests and testbed
|
||||
|
||||
option(ENTT_BUILD_TESTING "Enable building tests." OFF)
|
||||
|
||||
if(ENTT_BUILD_TESTING)
|
||||
option(ENTT_FIND_GTEST_PACKAGE "Enable finding gtest package." OFF)
|
||||
|
||||
option(ENTT_BUILD_BENCHMARK "Build benchmark." OFF)
|
||||
option(ENTT_BUILD_EXAMPLE "Build examples." OFF)
|
||||
option(ENTT_BUILD_LIB "Build lib tests." OFF)
|
||||
option(ENTT_BUILD_SNAPSHOT "Build snapshot test with Cereal." OFF)
|
||||
|
||||
set(ENTT_ID_TYPE std::uint32_t CACHE STRING "Type of identifiers to use for the tests")
|
||||
set(ENTT_CXX_STD cxx_std_17 CACHE STRING "C++ standard revision to use for the tests")
|
||||
|
||||
include(CTest)
|
||||
enable_testing()
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
|
||||
# Testbed
|
||||
|
||||
option(ENTT_BUILD_TESTBED "Enable building testbed." OFF)
|
||||
|
||||
if(ENTT_BUILD_TESTBED)
|
||||
add_subdirectory(testbed)
|
||||
if(ENTT_BUILD_TESTING OR ENTT_BUILD_TESTBED)
|
||||
set(ENTT_ID_TYPE std::uint32_t CACHE STRING "Type of identifiers to use for tests and testbed")
|
||||
set(ENTT_CXX_STD cxx_std_17 CACHE STRING "C++ standard revision to use for tests and testbed")
|
||||
|
||||
if(ENTT_BUILD_TESTING)
|
||||
option(ENTT_FIND_GTEST_PACKAGE "Enable finding gtest package." OFF)
|
||||
|
||||
option(ENTT_BUILD_BENCHMARK "Build benchmark." OFF)
|
||||
option(ENTT_BUILD_EXAMPLE "Build examples." OFF)
|
||||
option(ENTT_BUILD_LIB "Build lib tests." OFF)
|
||||
option(ENTT_BUILD_SNAPSHOT "Build snapshot test with Cereal." OFF)
|
||||
|
||||
include(CTest)
|
||||
enable_testing()
|
||||
add_subdirectory(test)
|
||||
endif()
|
||||
|
||||
if(ENTT_BUILD_TESTBED)
|
||||
add_subdirectory(testbed)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# Documentation
|
||||
|
||||
1
TODO
1
TODO
@@ -35,3 +35,4 @@ TODO:
|
||||
* meta non-const allow_cast overloads: (const int &) to (int &) is not allowed, but (const int &) to (double &) is allowed (support only for convertibles)
|
||||
* improve non-const allow cast with in-place switch
|
||||
* meta fixed_size could return the size directly if present
|
||||
* setup testbed workflow on the CI
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
# Testbed configuration
|
||||
|
||||
add_executable(testbed)
|
||||
|
||||
set(ENTT_TESTBED_EXECUTABLE testbed)
|
||||
|
||||
set_target_properties(testbed PROPERTIES CXX_EXTENSIONS OFF)
|
||||
target_compile_features(testbed PUBLIC ${ENTT_CXX_STD})
|
||||
|
||||
target_compile_definitions(
|
||||
${ENTT_TESTBED_EXECUTABLE}
|
||||
PRIVATE
|
||||
ENTT_ID_TYPE=${ENTT_ID_TYPE}
|
||||
NOMINMAX
|
||||
)
|
||||
|
||||
target_sources(
|
||||
${ENTT_TESTBED_EXECUTABLE}
|
||||
PRIVATE
|
||||
testbed.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(
|
||||
${ENTT_TESTBED_EXECUTABLE}
|
||||
PRIVATE
|
||||
EnTT::EnTT
|
||||
)
|
||||
|
||||
target_include_directories(
|
||||
${ENTT_TESTBED_EXECUTABLE}
|
||||
PRIVATE
|
||||
${testbed_SOURCE_DIR}
|
||||
)
|
||||
|
||||
6
testbed/testbed.cpp
Normal file
6
testbed/testbed.cpp
Normal file
@@ -0,0 +1,6 @@
|
||||
#include <entt/entt.hpp>
|
||||
|
||||
int main() {
|
||||
[[maybe_unused]] entt::registry registry;
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user