mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-06-03 02:20:50 +00:00
cmake: detect openMP
This commit is contained in:
parent
cdbd508007
commit
e229f62020
4 changed files with 27 additions and 0 deletions
|
@ -500,6 +500,20 @@ else ( enable-readline )
|
||||||
unset ( READLINE_LIBS CACHE )
|
unset ( READLINE_LIBS CACHE )
|
||||||
endif ( enable-readline )
|
endif ( enable-readline )
|
||||||
|
|
||||||
|
unset ( HAVE_OPENMP CACHE )
|
||||||
|
find_package ( OpenMP QUIET )
|
||||||
|
if ( OpenMP_FOUND OR OpenMP_C_FOUND )
|
||||||
|
message(STATUS "Found OpenMP ${OpenMP_C_SPEC_DATE}")
|
||||||
|
# require at least OMP 4.0
|
||||||
|
if ( ( NOT OpenMP_C_SPEC_DATE LESS "201307" ) OR NOT ( OpenMP_C_VERSION VERSION_LESS "4.0" ) )
|
||||||
|
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
|
||||||
|
set ( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
|
||||||
|
set ( CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} ${OpenMP_EXE_LINKER_FLAGS}" )
|
||||||
|
set ( LIBFLUID_LIBS "${OpenMP_C_LIBRARIES};${LIBFLUID_LIBS}" )
|
||||||
|
set ( HAVE_OPENMP 1 )
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
|
|
||||||
if(enable-tests)
|
if(enable-tests)
|
||||||
# manipulate some variables to setup a proper test env
|
# manipulate some variables to setup a proper test env
|
||||||
|
|
|
@ -127,6 +127,12 @@ else ( WITH_PROFILING )
|
||||||
message ( "Profiling: no" )
|
message ( "Profiling: no" )
|
||||||
endif ( WITH_PROFILING )
|
endif ( WITH_PROFILING )
|
||||||
|
|
||||||
|
if ( HAVE_OPENMP )
|
||||||
|
message ( "OpenMP 4.0: yes" )
|
||||||
|
else ( HAVE_OPENMP )
|
||||||
|
message ( "OpenMP 4.0: no" )
|
||||||
|
endif ( HAVE_OPENMP )
|
||||||
|
|
||||||
if ( ENABLE_DEBUG )
|
if ( ENABLE_DEBUG )
|
||||||
message ( "Debug: yes" )
|
message ( "Debug: yes" )
|
||||||
else ( ENABLE_DEBUG )
|
else ( ENABLE_DEBUG )
|
||||||
|
|
|
@ -76,6 +76,9 @@
|
||||||
/* Define to 1 if you have the <netinet/tcp.h> header file. */
|
/* Define to 1 if you have the <netinet/tcp.h> header file. */
|
||||||
#cmakedefine HAVE_NETINET_TCP_H @HAVE_NETINET_TCP_H@
|
#cmakedefine HAVE_NETINET_TCP_H @HAVE_NETINET_TCP_H@
|
||||||
|
|
||||||
|
/* Define if compiling with openMP to enable parallel audio rendering */
|
||||||
|
#cmakedefine HAVE_OPENMP @HAVE_OPENMP@
|
||||||
|
|
||||||
/* Define to 1 if you have the <pthread.h> header file. */
|
/* Define to 1 if you have the <pthread.h> header file. */
|
||||||
#cmakedefine HAVE_PTHREAD_H @HAVE_PTHREAD_H@
|
#cmakedefine HAVE_PTHREAD_H @HAVE_PTHREAD_H@
|
||||||
|
|
||||||
|
|
|
@ -102,6 +102,10 @@
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#if HAVE_OPENMP
|
||||||
|
#include <omp.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if HAVE_IO_H
|
#if HAVE_IO_H
|
||||||
#include <io.h>
|
#include <io.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue