Skip to content

Commit dae1903

Browse files
authored
Merge pull request #1114 from Idclip/mingw
Fixes for building for Windows with MinGW
2 parents d1beee0 + 4eaf4b5 commit dae1903

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

openvdb/openvdb/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ if(OPENVDB_CORE_STATIC)
508508
set_target_properties(openvdb_static
509509
PROPERTIES OUTPUT_NAME ${OPENVDB_STATIC_LIBRARY_NAME})
510510

511-
if(WIN32)
511+
if(MSVC)
512512
if(NOT CMAKE_MSVC_RUNTIME_LIBRARY)
513513
# NOTE: MSVC_RUNTIME_LIBRARY does not propagate to targets, so
514514
# also add it explicitly as a compile option
@@ -559,7 +559,7 @@ if(OPENVDB_CORE_SHARED)
559559
)
560560
endif()
561561

562-
if(WIN32)
562+
if(MSVC)
563563
if(NOT CMAKE_MSVC_RUNTIME_LIBRARY)
564564
# NOTE: MSVC_RUNTIME_LIBRARY does not propagate to targets, so
565565
# also add it explicitly as a compile option

openvdb/openvdb/io/TempFile.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,11 @@ struct TempFile::TempFileImpl
7070
{
7171
if (const char* dir = std::getenv("OPENVDB_TEMP_DIR")) {
7272
if (0 != ::access(dir, F_OK)) {
73+
#ifdef _WIN32
74+
::mkdir(dir);
75+
#else
7376
::mkdir(dir, S_IRUSR | S_IWUSR | S_IXUSR);
77+
#endif
7478
if (0 != ::access(dir, F_OK)) {
7579
OPENVDB_THROW(IoError,
7680
"failed to create OPENVDB_TEMP_DIR (" + std::string(dir) + ")");

pendingchanges/mingw.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Build:
2+
- Build fixes for MinGW on Windows
3+
[Contributed by Brecht Sanders]

0 commit comments

Comments
 (0)