Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CMAKE_CROSSCOMPILING_EMULATOR and misc. fixes #1106

Merged
merged 3 commits into from
Jul 28, 2021
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/lib/Iex/IexThrowErrnoExc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@

#ifdef _WIN32
#include <windows.h>
#pragma warning (disable : 4996)
#endif

#ifdef _MSC_VER
#pragma warning (disable : 4996)
#endif

IEX_INTERNAL_NAMESPACE_SOURCE_ENTER
Expand Down
1 change: 0 additions & 1 deletion src/lib/OpenEXR/ImfKeyCode.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ class IMF_EXPORT_TYPE KeyCode

IMF_EXPORT
KeyCode (const KeyCode &other);
IMF_EXPORT
~KeyCode() = default;
IMF_EXPORT
KeyCode & operator = (const KeyCode &other);
Expand Down
4 changes: 2 additions & 2 deletions src/lib/OpenEXRCore/decoding.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ default_decompress_chunk (exr_decode_pipeline_t* decode)
return pctxt->print_error (
pctxt,
rv,
"Unable to decompress sample table %lu -> %lu",
"Unable to decompress sample table %llu -> %zu",
decode->chunk.sample_count_table_size,
sampsize);
}
Expand All @@ -328,7 +328,7 @@ default_decompress_chunk (exr_decode_pipeline_t* decode)
return pctxt->print_error (
pctxt,
rv,
"Unable to decompress image data %lu -> %lu",
"Unable to decompress image data %llu -> %llu",
decode->chunk.packed_size,
decode->chunk.unpacked_size);
}
Expand Down
6 changes: 3 additions & 3 deletions src/lib/OpenEXRCore/internal_coding.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
#endif

#if defined(__has_include)
# if __has_include(<x86intrin.h>)
cary-ilm marked this conversation as resolved.
Show resolved Hide resolved
# include <x86intrin.h>
# elif __has_include(<intrin.h>)
# if __has_include(<intrin.h>)
# include <intrin.h>
# elif __has_include(<x86intrin.h>)
# include <x86intrin.h>
# endif
#endif
#include <math.h>
Expand Down
4 changes: 2 additions & 2 deletions src/lib/OpenEXRCore/internal_win32_file_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ print_error_helper (

if (error_cb)
error_cb (
(exr_const_context_t) pf, errcode, (const char*) lpDisplayBuf);
(exr_const_context_t) pf, errcode, "%s", (const char*) lpDisplayBuf);
else
pf->print_error (pf, errcode, (const char*) lpDisplayBuf);
pf->print_error (pf, errcode, "%s", (const char*) lpDisplayBuf);

LocalFree (lpMsgBuf);
LocalFree (lpDisplayBuf);
Expand Down
1 change: 1 addition & 0 deletions src/lib/OpenEXRCore/unpack.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "openexr_attr.h"

#include <string.h>
#include <stdbool.h>

#if defined(__x86_64__) || defined(_M_X64)
# ifndef _WIN32
Expand Down
4 changes: 3 additions & 1 deletion src/test/IexTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,6 @@ set_target_properties(IexTest PROPERTIES
if(WIN32 AND BUILD_SHARED_LIBS)
target_compile_definitions(IexTest PRIVATE OPENEXR_DLL)
endif()
add_test(NAME OpenEXR.Iex COMMAND $<TARGET_FILE:IexTest>)

# CMAKE_CROSSCOMPILING_EMULATOR is necessary to support cross-compiling (ex: to win32 from mingw and running tests with wine)
add_test(NAME OpenEXR.Iex COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:IexTest>)
meshula marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 3 additions & 2 deletions src/test/OpenEXRCoreTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,11 @@ if(WIN32 AND (BUILD_SHARED_LIBS OR OPENEXR_BUILD_BOTH_STATIC_SHARED))
target_compile_definitions(CorePerfTest PRIVATE OPENEXR_DLL)
endif()

#add_test(NAME OpenEXR.Core COMMAND $<TARGET_FILE:OpenEXRCoreTest>)
cary-ilm marked this conversation as resolved.
Show resolved Hide resolved
# CMAKE_CROSSCOMPILING_EMULATOR is necessary to support cross-compiling (ex: to win32 from mingw and running tests with wine)
#add_test(NAME OpenEXR.Core COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:OpenEXRCoreTest>)
function(DEFINE_OPENEXRCORE_TESTS)
foreach(curtest IN LISTS ARGN)
add_test(NAME OpenEXRCore.${curtest} COMMAND $<TARGET_FILE:OpenEXRCoreTest> ${curtest})
add_test(NAME OpenEXRCore.${curtest} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:OpenEXRCoreTest> ${curtest})
endforeach()
endfunction()

Expand Down
5 changes: 3 additions & 2 deletions src/test/OpenEXRFuzzTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ if(OPENEXR_RUN_FUZZ_TESTS)

function(DEFINE_OPENEXR_FUZZ_TESTS)
foreach(curtest IN LISTS ARGN)
add_test(NAME OpenEXR.Fuzz.${curtest} COMMAND $<TARGET_FILE:OpenEXRFuzzTest> ${curtest})
add_test(NAME OpenEXR.Fuzz.${curtest} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:OpenEXRFuzzTest> ${curtest})
set_tests_properties(OpenEXR.Fuzz.${curtest} PROPERTIES TIMEOUT 36000)
endforeach()
endfunction()
Expand All @@ -28,7 +28,8 @@ endfunction()
testFuzzDeepScanLines
testFuzzDeepTiles
)
#add_test(NAME OpenEXR.Fuzz COMMAND $<TARGET_FILE:OpenEXRFuzzTest>)
cary-ilm marked this conversation as resolved.
Show resolved Hide resolved
# CMAKE_CROSSCOMPILING_EMULATOR is necessary to support cross-compiling (ex: to win32 from mingw and running tests with wine)
#add_test(NAME OpenEXR.Fuzz COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:OpenEXRFuzzTest>)
#set_tests_properties(OpenEXR.Fuzz PROPERTIES TIMEOUT 36000)

add_custom_target(fuzz $<TARGET_FILE:OpenEXRFuzzTest>)
Expand Down
11 changes: 6 additions & 5 deletions src/test/OpenEXRTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,15 @@ if(WIN32 AND BUILD_SHARED_LIBS)
target_compile_definitions(OpenEXRTest PRIVATE OPENEXR_DLL)
endif()

#add_test(NAME OpenEXR.Core COMMAND $<TARGET_FILE:OpenEXRTest> core)
cary-ilm marked this conversation as resolved.
Show resolved Hide resolved
#add_test(NAME OpenEXR.Basic COMMAND $<TARGET_FILE:OpenEXRTest> basic)
#add_test(NAME OpenEXR.Deep COMMAND $<TARGET_FILE:OpenEXRTest> deep)
#add_test(NAME OpenEXR.Multi COMMAND $<TARGET_FILE:OpenEXRTest> multi)
# CMAKE_CROSSCOMPILING_EMULATOR is necessary to support cross-compiling (ex: to win32 from mingw and running tests with wine)
#add_test(NAME OpenEXR.Core COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:OpenEXRTest> core)
#add_test(NAME OpenEXR.Basic COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:OpenEXRTest> basic)
#add_test(NAME OpenEXR.Deep COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:OpenEXRTest> deep)
#add_test(NAME OpenEXR.Multi COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:OpenEXRTest> multi)

function(DEFINE_OPENEXR_TESTS)
foreach(curtest IN LISTS ARGN)
add_test(NAME OpenEXR.${curtest} COMMAND $<TARGET_FILE:OpenEXRTest> ${curtest})
add_test(NAME OpenEXR.${curtest} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:OpenEXRTest> ${curtest})
endforeach()
endfunction()

Expand Down
5 changes: 3 additions & 2 deletions src/test/OpenEXRUtilTest/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,11 @@ endif()

function(DEFINE_OPENEXR_UTIL_TESTS)
foreach(curtest IN LISTS ARGN)
add_test(NAME OpenEXRUtil.${curtest} COMMAND $<TARGET_FILE:OpenEXRUtilTest> ${curtest})
# CMAKE_CROSSCOMPILING_EMULATOR is necessary to support cross-compiling (ex: to win32 from mingw and running tests with wine)
add_test(NAME OpenEXRUtil.${curtest} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:OpenEXRUtilTest> ${curtest})
endforeach()
endfunction()
#add_test(NAME OpenEXR.OpenEXRUtil COMMAND $<TARGET_FILE:OpenEXRUtilTest>)
cary-ilm marked this conversation as resolved.
Show resolved Hide resolved
#add_test(NAME OpenEXR.OpenEXRUtil COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:OpenEXRUtilTest>)

define_openexr_util_tests(
testFlatImage
Expand Down