From 8b82ec4c95855cb787e7eae91462c2798eb8006a Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Thu, 16 Feb 2017 11:13:20 +0100 Subject: [PATCH] Only include OpenMP headers if we are actually compiling with OpenMP Fixes building on OSX with Clang --- src/FffPolygonGenerator.cpp | 5 ++++- src/main.cpp | 6 ++++-- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/FffPolygonGenerator.cpp b/src/FffPolygonGenerator.cpp index 007590a0..07e0f834 100644 --- a/src/FffPolygonGenerator.cpp +++ b/src/FffPolygonGenerator.cpp @@ -2,7 +2,10 @@ #include #include // multimap (ordered map allowing duplicate keys) -#include + +#ifdef _OPENMP + #include " +#endif #include "utils/math.h" #include "utils/algorithm.h" diff --git a/src/main.cpp b/src/main.cpp index 887e59bf..f68bcb19 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -20,7 +20,9 @@ #include "settings/SettingsToGV.h" -#include // omp_get_num_threads +#ifdef _OPENMP + #include // omp_get_num_threads +#endif namespace cura { @@ -437,4 +439,4 @@ int main(int argc, char **argv) } return 0; -} \ No newline at end of file +}