Skip to content

Commit

Permalink
Some fixes to allow build with mingw (#2304)
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexpux authored and lgritz committed Aug 1, 2019
1 parent 68d972d commit 7d3ebb8
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ add_subdirectory (src/fonts)
add_subdirectory (src/nuke)

# install pkgconfig file
IF ( NOT WIN32 )
IF ( NOT MSVC )
configure_file(src/build-scripts/OpenImageIO.pc.in "${CMAKE_BINARY_DIR}/OpenImageIO.pc" @ONLY)
install (FILES "${CMAKE_BINARY_DIR}/OpenImageIO.pc"
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
Expand Down
2 changes: 1 addition & 1 deletion src/include/OpenImageIO/export.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
///
///

#if defined(_MSC_VER) || defined(__CYGWIN__)
#if defined(_WIN32) || defined(__CYGWIN__)
# ifndef OIIO_STATIC_BUILD
# define OIIO_IMPORT __declspec(dllimport)
# define OIIO_EXPORT __declspec(dllexport)
Expand Down
2 changes: 1 addition & 1 deletion src/include/OpenImageIO/simd.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// OIIO_SIMD_HAS_SIMD8 : nonzero if vfloat8, vint8, vbool8 are defined
// OIIO_SIMD_HAS_SIMD16 : nonzero if vfloat16, vint16, vbool16 are defined

#if defined(_MSC_VER)
#if defined(_WIN32)
# include <intrin.h>
#elif defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__))
# include <x86intrin.h>
Expand Down
2 changes: 1 addition & 1 deletion src/iv/ivmain.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ getargs(int argc, char* argv[])
}
}

#ifdef WIN32
#ifdef _MSC_VER
// if we are not in DEBUG mode this code switch the app to
// full windowed mode (no console and no need to define WinMain)
// FIXME: this should be done in CMakeLists.txt but first we have to
Expand Down
4 changes: 3 additions & 1 deletion src/libOpenImageIO/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,10 @@ if (MSVC)
APPEND_STRING PROPERTY COMPILE_FLAGS " /bigobj ")
endif ()

if (WIN32)
if (MSVC)
target_link_libraries (OpenImageIO psapi.lib)
elseif(MINGW)
target_link_libraries (OpenImageIO psapi ws2_32)
endif ()

if (VISIBILITY_MAP_FILE)
Expand Down
2 changes: 1 addition & 1 deletion src/libutil/farmhash.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@

#if defined(FARMHASH_UNKNOWN_ENDIAN) || !defined(bswap_64)

#ifdef _MSC_VER
#ifdef _WIN32

#undef bswap_32
#undef bswap_64
Expand Down

0 comments on commit 7d3ebb8

Please sign in to comment.