mirror of
https://github.com/enduro2d/enduro2d.git
synced 2025-12-13 07:45:39 +07:00
fix few MSVC warnings
This commit is contained in:
@@ -5,7 +5,7 @@ environment:
|
|||||||
E2D_WITHOUT_GRAPHICS: true
|
E2D_WITHOUT_GRAPHICS: true
|
||||||
image:
|
image:
|
||||||
- Visual Studio 2017
|
- Visual Studio 2017
|
||||||
- Visual Studio 2019 Preview
|
- Visual Studio 2019
|
||||||
platform:
|
platform:
|
||||||
- Win32
|
- Win32
|
||||||
- x64
|
- x64
|
||||||
|
|||||||
@@ -19,6 +19,14 @@ function(add_e2d_sample NAME)
|
|||||||
target_link_libraries(${SAMPLE_NAME} enduro2d)
|
target_link_libraries(${SAMPLE_NAME} enduro2d)
|
||||||
set_target_properties(${SAMPLE_NAME} PROPERTIES FOLDER samples)
|
set_target_properties(${SAMPLE_NAME} PROPERTIES FOLDER samples)
|
||||||
|
|
||||||
|
target_compile_options(${SAMPLE_NAME}
|
||||||
|
PRIVATE
|
||||||
|
$<$<CXX_COMPILER_ID:MSVC>:
|
||||||
|
/W3 /MP /bigobj>
|
||||||
|
PRIVATE
|
||||||
|
$<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
|
||||||
|
-Wall -Wextra -Wpedantic>)
|
||||||
|
|
||||||
#
|
#
|
||||||
# resources
|
# resources
|
||||||
#
|
#
|
||||||
|
|||||||
12
scripts/gen_msvc2019_project.bat
Normal file
12
scripts/gen_msvc2019_project.bat
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
@echo off
|
||||||
|
set BUILD_DIR=%~dp0%\..\build
|
||||||
|
mkdir %BUILD_DIR%\msvc2019 || goto :error
|
||||||
|
cd %BUILD_DIR%\msvc2019 || goto :error
|
||||||
|
cmake -G "Visual Studio 16 2019" ..\.. || goto :error
|
||||||
|
start enduro2d.sln || goto :error
|
||||||
|
|
||||||
|
goto :EOF
|
||||||
|
|
||||||
|
:error
|
||||||
|
echo Failed with error #%errorlevel%.
|
||||||
|
exit /b %errorlevel%
|
||||||
@@ -78,24 +78,6 @@ namespace
|
|||||||
return success == GL_TRUE;
|
return success == GL_TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool process_program_validation_result(debug& debug, GLuint program) noexcept {
|
|
||||||
E2D_ASSERT(glIsProgram(program));
|
|
||||||
GL_CHECK_CODE(debug, glValidateProgram(program));
|
|
||||||
GLint success = GL_FALSE;
|
|
||||||
GL_CHECK_CODE(debug, glGetProgramiv(program, GL_VALIDATE_STATUS, &success));
|
|
||||||
GLint log_len = 0;
|
|
||||||
GL_CHECK_CODE(debug, glGetProgramiv(program, GL_INFO_LOG_LENGTH, &log_len));
|
|
||||||
if ( log_len > 0 ) {
|
|
||||||
GLchar* log_buffer = static_cast<GLchar*>(E2D_ALLOCA(
|
|
||||||
sizeof(GLchar) * math::numeric_cast<std::size_t>(log_len)));
|
|
||||||
GL_CHECK_CODE(debug, glGetProgramInfoLog(
|
|
||||||
program, log_len, nullptr, log_buffer));
|
|
||||||
debug.log(success ? debug::level::warning : debug::level::error,
|
|
||||||
"RENDER: program validation info:\n--> %0", log_buffer);
|
|
||||||
}
|
|
||||||
return success == GL_TRUE;
|
|
||||||
}
|
|
||||||
|
|
||||||
template < typename... Ext >
|
template < typename... Ext >
|
||||||
bool gl_has_any_extension(debug& debug, Ext... required) noexcept {
|
bool gl_has_any_extension(debug& debug, Ext... required) noexcept {
|
||||||
const GLubyte* all_extensions = nullptr;
|
const GLubyte* all_extensions = nullptr;
|
||||||
|
|||||||
@@ -51,7 +51,7 @@ namespace
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void debug_output_callback(
|
void GLAPIENTRY debug_output_callback(
|
||||||
GLenum source,
|
GLenum source,
|
||||||
GLenum type,
|
GLenum type,
|
||||||
GLuint id,
|
GLuint id,
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ namespace
|
|||||||
const b2f& texrect,
|
const b2f& texrect,
|
||||||
const color32& color)
|
const color32& color)
|
||||||
{
|
{
|
||||||
const std::size_t start_vertex = vertices_.size();
|
const u32 start_vertex = math::numeric_cast<u32>(vertices_.size());
|
||||||
|
|
||||||
// Y
|
// Y
|
||||||
// ^
|
// ^
|
||||||
|
|||||||
@@ -19,6 +19,14 @@ function(add_e2d_tests NAME)
|
|||||||
target_link_libraries(${TESTS_NAME} enduro2d)
|
target_link_libraries(${TESTS_NAME} enduro2d)
|
||||||
set_target_properties(${TESTS_NAME} PROPERTIES FOLDER untests)
|
set_target_properties(${TESTS_NAME} PROPERTIES FOLDER untests)
|
||||||
|
|
||||||
|
target_compile_options(${TESTS_NAME}
|
||||||
|
PRIVATE
|
||||||
|
$<$<CXX_COMPILER_ID:MSVC>:
|
||||||
|
/W3 /MP /bigobj>
|
||||||
|
PRIVATE
|
||||||
|
$<$<OR:$<CXX_COMPILER_ID:GNU>,$<CXX_COMPILER_ID:Clang>,$<CXX_COMPILER_ID:AppleClang>>:
|
||||||
|
-Wall -Wextra -Wpedantic>)
|
||||||
|
|
||||||
#
|
#
|
||||||
# resources
|
# resources
|
||||||
#
|
#
|
||||||
@@ -36,28 +44,8 @@ function(add_e2d_tests NAME)
|
|||||||
add_test(${TESTS_NAME} ${TESTS_NAME})
|
add_test(${TESTS_NAME} ${TESTS_NAME})
|
||||||
endfunction(add_e2d_tests)
|
endfunction(add_e2d_tests)
|
||||||
|
|
||||||
option(E2D_BUILD_BASE_UNTESTS "Build base untests" ON)
|
|
||||||
option(E2D_BUILD_CORE_UNTESTS "Build core untests" ON)
|
|
||||||
option(E2D_BUILD_HIGH_UNTESTS "Build high untests" ON)
|
|
||||||
option(E2D_BUILD_MATH_UNTESTS "Build math untests" ON)
|
|
||||||
option(E2D_BUILD_UTILS_UNTESTS "Build utils untests" ON)
|
|
||||||
|
|
||||||
if(E2D_BUILD_BASE_UNTESTS)
|
|
||||||
add_e2d_tests(base)
|
add_e2d_tests(base)
|
||||||
endif()
|
|
||||||
|
|
||||||
if(E2D_BUILD_CORE_UNTESTS)
|
|
||||||
add_e2d_tests(core)
|
add_e2d_tests(core)
|
||||||
endif()
|
|
||||||
|
|
||||||
if(E2D_BUILD_HIGH_UNTESTS)
|
|
||||||
add_e2d_tests(high)
|
add_e2d_tests(high)
|
||||||
endif()
|
|
||||||
|
|
||||||
if(E2D_BUILD_MATH_UNTESTS)
|
|
||||||
add_e2d_tests(math)
|
add_e2d_tests(math)
|
||||||
endif()
|
|
||||||
|
|
||||||
if(E2D_BUILD_UTILS_UNTESTS)
|
|
||||||
add_e2d_tests(utils)
|
add_e2d_tests(utils)
|
||||||
endif()
|
|
||||||
|
|||||||
@@ -212,9 +212,9 @@ TEST_CASE("strings") {
|
|||||||
|
|
||||||
REQUIRE(wildcard_match(
|
REQUIRE(wildcard_match(
|
||||||
// 你好你好你好你好世界世界世界世界世界世界世界世界彡ಠ
|
// 你好你好你好你好世界世界世界世界世界世界世界世界彡ಠ
|
||||||
mark_string("\u4F60\u597D\u4F60\u597D\u4F60\u597D\u4F60\u597D\u4E16\u754C\u4E16\u754C\u4E16\u754C\u4E16\u754C\u4E16\u754C\u4E16\u754C\u4E16\u754C\u4E16\u754C\u5F61\u0CA0"),
|
mark_string(u8"\u4F60\u597D\u4F60\u597D\u4F60\u597D\u4F60\u597D\u4E16\u754C\u4E16\u754C\u4E16\u754C\u4E16\u754C\u4E16\u754C\u4E16\u754C\u4E16\u754C\u4E16\u754C\u5F61\u0CA0"),
|
||||||
// 你好你好你好你好*世界世界彡*ಠ
|
// 你好你好你好你好*世界世界彡*ಠ
|
||||||
mark_pattern("\u4F60\u597D\u4F60\u597D\u4F60\u597D\u4F60\u597D*\u4E16\u754C\u4E16\u754C\u5F61*\u0CA0")) == true);
|
mark_pattern(u8"\u4F60\u597D\u4F60\u597D\u4F60\u597D\u4F60\u597D*\u4E16\u754C\u4E16\u754C\u5F61*\u0CA0")) == true);
|
||||||
|
|
||||||
REQUIRE(wildcard_match("", "") == true);
|
REQUIRE(wildcard_match("", "") == true);
|
||||||
REQUIRE(wildcard_match("a", "") == false);
|
REQUIRE(wildcard_match("a", "") == false);
|
||||||
|
|||||||
Reference in New Issue
Block a user