Add OpenMP flags when compiling for C if enabled.

- Previously we were only adding the OpenMP flags when compiling for C++
  which could cause linker issues when compiling the C examples.

Change-Id: Ie7d8192b9da6fb17b8f554e6d164ec0a65403c99
This commit is contained in:
Alex Stewart
2017-06-01 10:56:47 +01:00
parent f93ad78f23
commit 7c5964e2de
+1
View File
@@ -431,6 +431,7 @@ if (OPENMP)
message("-- Building with OpenMP.")
list(APPEND CERES_COMPILE_OPTIONS CERES_USE_OPENMP)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}")
if (UNIX)
# At least on Linux, we need pthreads to be enabled for mutex to
# compile. This may not work on Windows or Android.