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

CMAKE_CROSSCOMPILING_EMULATOR and misc. fixes #1106

merged 3 commits into from
Jul 28, 2021

Conversation

patlefort
Copy link
Contributor

Fix a few problems that I noticed and some mingw related problems.

  • Fix a few formatting problems.
  • Fix for -Wformat-security warnings in internal_win32_file_impl.h for mingw and also for security.
  • In unpack.c: Add missing <stdbool.h> include.
  • Swap intrinsic include check. On mingw both files are present but intrin.h should be used.
  • Disable a warning only for MSVC.
  • Remove useless export on defaulted destructor. Mingw doesn't like it.
  • Add CMAKE_CROSSCOMPILING_EMULATOR for all tests. This allows running tests on a platform like mingw.

Signed-off-by: Patrick Northon northon_patrick3@yahoo.ca

* Fix a few formatting problems.
* Fix for -Wformat-security warnings in internal_win32_file_impl.h for mingw and also for security.
* In unpack.c: Add missing <stdbool.h> include.
* Swap intrinsic include check. On mingw both files are present but intrin.h should be used.
* Disable a warning only for MSVC.
* Remove useless export on defaulted destructor. Mingw doesn't like it.
* Add CMAKE_CROSSCOMPILING_EMULATOR for all tests. This allows running tests on a platform like mingw.

Signed-off-by: Patrick Northon <northon_patrick3@yahoo.ca>
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Jul 23, 2021

CLA Signed

The committers are authorized under a signed CLA.

Copy link
Contributor

@meshula meshula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the contribution, it all looks good, but could I ask for a little bit of documentation as noted in the review?

src/test/IexTest/CMakeLists.txt Show resolved Hide resolved
Signed-off-by: Patrick Northon <northon_patrick3@yahoo.ca>
@patlefort
Copy link
Contributor Author

I added some comments about CMAKE_CROSSCOMPILING_EMULATOR. I also did for commented out tests just in case.

@patlefort
Copy link
Contributor Author

patlefort commented Jul 24, 2021

I notice that while my intrin.h change fix mingw, it break clang. I don't know why it tries to do #include_next <intrin.h> on anything else than MSVC because then nobody can check for the presence of intrin.h for intrinsics support.
My proposition:

#ifdef __has_include
#    if defined(_WIN32) && __has_include(<intrin.h>)
#        include <intrin.h>
#    elif defined(__x86_64__) && __has_include(<x86intrin.h>)
#        include <x86intrin.h>
#    endif
#endif

@cary-ilm cary-ilm changed the title Various fixes. CMAKE_CROSSCOMPILING_EMULATOR and misc. fixes Jul 27, 2021
@cary-ilm
Copy link
Member

Since the bulk of this PR is the CMAKE_CROSSCOMPILING_EMULATOR support, it will be better to have that in the title.

* Remove commented-out add_test lines.

Signed-off-by: Patrick Northon <northon_patrick3@yahoo.ca>
Copy link
Contributor

@meshula meshula left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this all looks good now?

@cary-ilm
Copy link
Member

LGTM, too, thanks!

@cary-ilm cary-ilm merged commit 6131204 into AcademySoftwareFoundation:master Jul 28, 2021
cary-ilm pushed a commit to cary-ilm/openexr that referenced this pull request Jul 31, 2021
…ion#1106)

* Various fixes.

* Fix a few formatting problems.
* Fix for -Wformat-security warnings in internal_win32_file_impl.h for mingw and also for security.
* In unpack.c: Add missing <stdbool.h> include.
* Swap intrinsic include check. On mingw both files are present but intrin.h should be used.
* Disable a warning only for MSVC.
* Remove useless export on defaulted destructor. Mingw doesn't like it.
* Add CMAKE_CROSSCOMPILING_EMULATOR for all tests. This allows running tests on a platform like mingw.

Signed-off-by: Patrick Northon <northon_patrick3@yahoo.ca>

* Add comment about CMAKE_CROSSCOMPILING_EMULATOR.

Signed-off-by: Patrick Northon <northon_patrick3@yahoo.ca>

* * Remove changes from internal_coding.h.
* Remove commented-out add_test lines.

Signed-off-by: Patrick Northon <northon_patrick3@yahoo.ca>
cary-ilm pushed a commit that referenced this pull request Jul 31, 2021
* Various fixes.

* Fix a few formatting problems.
* Fix for -Wformat-security warnings in internal_win32_file_impl.h for mingw and also for security.
* In unpack.c: Add missing <stdbool.h> include.
* Swap intrinsic include check. On mingw both files are present but intrin.h should be used.
* Disable a warning only for MSVC.
* Remove useless export on defaulted destructor. Mingw doesn't like it.
* Add CMAKE_CROSSCOMPILING_EMULATOR for all tests. This allows running tests on a platform like mingw.

Signed-off-by: Patrick Northon <northon_patrick3@yahoo.ca>

* Add comment about CMAKE_CROSSCOMPILING_EMULATOR.

Signed-off-by: Patrick Northon <northon_patrick3@yahoo.ca>

* * Remove changes from internal_coding.h.
* Remove commented-out add_test lines.

Signed-off-by: Patrick Northon <northon_patrick3@yahoo.ca>
@hjmallon
Copy link
Contributor

hjmallon commented Aug 3, 2021

You only need the CMAKE_CROSSCOMPILING_EMULATOR here because of the way the tests are called. If you replace $<TARGET_FILE:OpenEXRUtilTest>, with just OpenEXRUtilTest (for cmake executable targets) then cmake recognises them and this should all happen transparently.

i.e.

add_test(NAME OpenEXRCore.${curtest} COMMAND ${CMAKE_CROSSCOMPILING_EMULATOR} $<TARGET_FILE:OpenEXRCoreTest> ${curtest})

becomes

add_test(NAME OpenEXRCore.${curtest} COMMAND OpenEXRCoreTest ${curtest})

@cary-ilm cary-ilm added the v3.1.1 label Sep 2, 2021
amyspark added a commit to amyspark/openexr that referenced this pull request Feb 24, 2022
Cherry-picked from AcademySoftwareFoundation#1106

Signed-off-by: L. E. Segovia <amy@amyspark.me>
cary-ilm pushed a commit that referenced this pull request Mar 17, 2022
Cherry-picked from #1106

Signed-off-by: L. E. Segovia <amy@amyspark.me>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants