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
diff --git a/CMakeLists.txt b/CMakeLists.txt index 63f5e10..7406fca 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -431,6 +431,7 @@ 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.