Skip to content

Commit cec1493

Browse files
brechtsandersIdclip
authored andcommitted
Fix for MinGW Windows builds: mkdir() takes only 1 parameter and avoid specifying CRT targets
Signed-off-by: Nick Avramoussis <[email protected]>
1 parent bf2540b commit cec1493

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

openvdb/openvdb/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ if(OPENVDB_CORE_STATIC)
504504
set_target_properties(openvdb_static
505505
PROPERTIES OUTPUT_NAME ${OPENVDB_STATIC_LIBRARY_NAME})
506506

507-
if(WIN32)
507+
if(MSVC)
508508
if(NOT CMAKE_MSVC_RUNTIME_LIBRARY)
509509
# NOTE: MSVC_RUNTIME_LIBRARY does not propagate to targets, so
510510
# also add it explicitly as a compile option
@@ -555,7 +555,7 @@ if(OPENVDB_CORE_SHARED)
555555
)
556556
endif()
557557

558-
if(WIN32)
558+
if(MSVC)
559559
if(NOT CMAKE_MSVC_RUNTIME_LIBRARY)
560560
# NOTE: MSVC_RUNTIME_LIBRARY does not propagate to targets, so
561561
# 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) + ")");

0 commit comments

Comments
 (0)