pull/5537/merge
Kim Kulling 2024-09-15 17:17:51 -04:00 committed by GitHub
commit b52f469e8f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 33 additions and 20 deletions

View File

@ -16,9 +16,13 @@ jobs:
strategy:
fail-fast: false
matrix:
name: [ubuntu-latest-g++, macos-latest-clang++, windows-latest-cl.exe, ubuntu-latest-clang++]
name: [ubuntu-latest-g++, macos-latest-clang++, windows-latest-cl.exe, windows-latest-clang.exe, ubuntu-latest-clang++]
# For Windows msvc, for Linux and macOS let's use the clang compiler, use gcc for Linux.
include:
- name: windows-latest-clang.exe
os: windows-latest
cxx: clang++.exe
cc: clang.exe
- name: windows-latest-cl.exe
os: windows-latest
cxx: cl.exe
@ -65,13 +69,13 @@ jobs:
${{ runner.os }}-DX_SDK
- name: Download DXSetup
if: contains(matrix.name, 'windows') && steps.dxcache.outputs.cache-hit != 'true'
if: contains(matrix.name, 'windows-latest-cl.exe') && steps.dxcache.outputs.cache-hit != 'true'
run: |
curl -s -o DXSDK_Jun10.exe --location https://download.microsoft.com/download/A/E/7/AE743F1F-632B-4809-87A9-AA1BB3458E31/DXSDK_Jun10.exe
cmd.exe /c start /wait .\DXSDK_Jun10.exe /U /O /F /S /P "${{ github.workspace }}\DX_SDK"
- name: Set Windows specific CMake arguments
if: contains(matrix.name, 'windows')
if: contains(matrix.name, 'windows-latest-cl.exe')
id: windows_extra_cmake_args
run: echo ":set-output name=args::=-DASSIMP_BUILD_ASSIMP_TOOLS=1 -DASSIMP_BUILD_ASSIMP_VIEW=1" >> $GITHUB_OUTPUT

View File

@ -1346,7 +1346,6 @@ add_compile_options(
IF (ASSIMP_WARNINGS_AS_ERRORS)
MESSAGE(STATUS "Treating all warnings as errors (for assimp library only)")
IF (MSVC)
IF(CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) # clang-cl
TARGET_COMPILE_OPTIONS(assimp PRIVATE -Wall -Werror
-Wno-microsoft-enum-value
@ -1397,6 +1396,7 @@ IF (ASSIMP_WARNINGS_AS_ERRORS)
-Wno-undefined-func-template
-Wno-declaration-after-statement
-Wno-deprecated-declarations
-Wno-deprecated-non-prototype
)
ELSE()
TARGET_COMPILE_OPTIONS(assimp PRIVATE /W4 /WX)

View File

@ -5,6 +5,9 @@
#include "gzguts.h"
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-non-prototype"
/* gzclose() is in a separate file so that it is linked in only if it is used.
That way the other gzclose functions can be used instead to avoid linking in
unneeded compression or decompression routines. */
@ -23,3 +26,6 @@ int ZEXPORT gzclose(file)
return gzclose_r(file);
#endif
}
#pragma clang diagnostic pop

View File

@ -23,6 +23,8 @@ z_const char * const z_errmsg[10] = {
(z_const char *)""
};
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wdeprecated-non-prototype"
const char * ZEXPORT zlibVersion()
{
@ -321,6 +323,7 @@ void ZLIB_INTERNAL zcfree(opaque, ptr)
(void)opaque;
free(ptr);
}
#pragma clang diagnostic pop
#endif /* MY_ZCALLOC */

View File

@ -3,7 +3,7 @@
Open Asset Import Library (assimp)
---------------------------------------------------------------------------
Copyright (c) 2006-2020, assimp team
Copyright (c) 2006-2024, assimp team
All rights reserved.
@ -45,32 +45,34 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <gtest/gtest.h>
#if defined(_MSC_VER) || defined(__MINGW64__) || defined(__MINGW32__)
#define TMP_PATH "./"
# define TMP_PATH "./"
#elif defined(__GNUC__) || defined(__clang__)
#define TMP_PATH "/tmp/"
# define TMP_PATH "/tmp/"
#endif
#if defined(_MSC_VER)
# ifndef _CRT_SECURE_NO_WARNINGS
# define _CRT_SECURE_NO_WARNINGS
# endif
#include <io.h>
inline FILE* MakeTmpFile(char* tmplate)
{
auto pathtemplate = _mktemp(tmplate);
inline FILE* MakeTmpFile(char* tmplate) {
char *pathtemplate = tmplate;
int err = _mktemp_s(pathtemplate, std::strlen(pathtemplate));
EXPECT_EQ(err, 0);
EXPECT_NE(pathtemplate, nullptr);
if(pathtemplate == nullptr)
{
if(pathtemplate == nullptr) {
return nullptr;
}
auto* fs = std::fopen(pathtemplate, "w+");
EXPECT_NE(fs, nullptr);
EXPECT_NE(fs, nullptr); return fs;
return fs;
}
#elif defined(__GNUC__) || defined(__clang__)
inline FILE* MakeTmpFile(char* tmplate)
{
inline FILE* MakeTmpFile(char* tmplate) {
auto fd = mkstemp(tmplate);
EXPECT_NE(-1, fd);
if(fd == -1)
{
if(fd == -1) {
return nullptr;
}
auto fs = fdopen(fd, "w+");

View File

@ -5,8 +5,6 @@ Open Asset Import Library (assimp)
Copyright (c) 2006-2024, assimp team
All rights reserved.
Redistribution and use of this software in source and binary forms,
@ -89,7 +87,7 @@ TEST_F( IOStreamBufferTest, open_close_Test ) {
auto* fs = MakeTmpFile(fname);
ASSERT_NE(nullptr, fs);
auto written = std::fwrite( data, sizeof(*data), dataCount, fs );
auto written = std::fwrite(data, sizeof(*data), dataCount, fs);
EXPECT_NE( 0U, written );
auto flushResult = std::fflush( fs );
ASSERT_EQ(0, flushResult);