mirror of
https://github.com/PixarAnimationStudios/OpenSubdiv
synced 2024-11-12 15:10:33 +00:00
Merge pull request #1289 from thomthom/dev-clang-windows
Corrections to allow for LLVM Clang builds on Windows.
This commit is contained in:
commit
5474fe88fd
@ -171,6 +171,15 @@ if (CMAKE_COMPILER_IS_GNUCC OR CMAKE_COMPILER_IS_CLANGCC OR CMAKE_COMPILER_IS_IC
|
|||||||
list(APPEND OSD_COMPILER_FLAGS -Wall -Wextra)
|
list(APPEND OSD_COMPILER_FLAGS -Wall -Wextra)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
if(WIN32)
|
||||||
|
# Make sure the constants in <math.h>/<cmath> get defined.
|
||||||
|
list(APPEND OSD_COMPILER_FLAGS -D_USE_MATH_DEFINES)
|
||||||
|
|
||||||
|
# Make sure WinDef.h does not define min and max macros which
|
||||||
|
# will conflict with std::min() and std::max().
|
||||||
|
list(APPEND OSD_COMPILER_FLAGS -DNOMINMAX)
|
||||||
|
endif()
|
||||||
|
|
||||||
# HBR uses the offsetof macro on a templated struct, which appears
|
# HBR uses the offsetof macro on a templated struct, which appears
|
||||||
# to spuriously set off this warning in both gcc and Clang
|
# to spuriously set off this warning in both gcc and Clang
|
||||||
list(APPEND OSD_COMPILER_FLAGS -Wno-invalid-offsetof)
|
list(APPEND OSD_COMPILER_FLAGS -Wno-invalid-offsetof)
|
||||||
|
@ -25,7 +25,7 @@
|
|||||||
#ifndef STOPWATCH_H
|
#ifndef STOPWATCH_H
|
||||||
#define STOPWATCH_H
|
#define STOPWATCH_H
|
||||||
|
|
||||||
#if (_WIN32 || _WIN64)
|
#if (_WIN32)
|
||||||
#include <windows.h>
|
#include <windows.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
@ -37,7 +37,7 @@ class Stopwatch {
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
#ifndef _WINDOWS
|
#ifndef _WIN32
|
||||||
Stopwatch() : _totalElapsed(0) { }
|
Stopwatch() : _totalElapsed(0) { }
|
||||||
|
|
||||||
void Start() {
|
void Start() {
|
||||||
@ -91,7 +91,7 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
#ifndef _WINDOWS
|
#ifndef _WIN32
|
||||||
double _elapsed;
|
double _elapsed;
|
||||||
double _totalElapsed;
|
double _totalElapsed;
|
||||||
#else
|
#else
|
||||||
|
Loading…
Reference in New Issue
Block a user