Commit 4eec9fd0 authored by Wayne Stambaugh's avatar Wayne Stambaugh

Fix OpenMP link error on MinGW.

parent 4426d4c5
...@@ -157,10 +157,17 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" ) ...@@ -157,10 +157,17 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
endif() endif()
find_package( OpenMP QUIET ) find_package( OpenMP QUIET )
if( OPENMP_FOUND ) if( OPENMP_FOUND )
set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" ) set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" ) set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}" )
add_definitions( -DUSE_OPENMP ) add_definitions( -DUSE_OPENMP )
# MinGW does not include the OpenMP link library and FindOpenMP.cmake does not
# set it either. Not sure this is the most elegant solution but it works.
if( MINGW )
set( OPENMP_LIBRARIES gomp )
endif()
endif() endif()
if( MINGW ) if( MINGW )
......
...@@ -116,6 +116,7 @@ if( USE_KIWAY_DLLS ) ...@@ -116,6 +116,7 @@ if( USE_KIWAY_DLLS )
${GLEW_LIBRARIES} ${GLEW_LIBRARIES}
${CAIRO_LIBRARIES} ${CAIRO_LIBRARIES}
${PIXMAN_LIBRARY} ${PIXMAN_LIBRARY}
${OPENMP_LIBRARIES}
) )
# Only for win32 cross compilation using MXE # Only for win32 cross compilation using MXE
......
...@@ -536,6 +536,7 @@ if( USE_KIWAY_DLLS ) ...@@ -536,6 +536,7 @@ if( USE_KIWAY_DLLS )
OUTPUT_NAME pcbnew OUTPUT_NAME pcbnew
PREFIX ${KIFACE_PREFIX} PREFIX ${KIFACE_PREFIX}
SUFFIX ${KIFACE_SUFFIX} SUFFIX ${KIFACE_SUFFIX}
COMPILE_FLAGS ${OpenMP_CXX_FLAGS}
) )
target_link_libraries( pcbnew_kiface target_link_libraries( pcbnew_kiface
3d-viewer 3d-viewer
...@@ -557,6 +558,7 @@ if( USE_KIWAY_DLLS ) ...@@ -557,6 +558,7 @@ if( USE_KIWAY_DLLS )
${PIXMAN_LIBRARY} ${PIXMAN_LIBRARY}
${Boost_LIBRARIES} # must follow GITHUB ${Boost_LIBRARIES} # must follow GITHUB
${PCBNEW_EXTRA_LIBS} # -lrt must follow Boost ${PCBNEW_EXTRA_LIBS} # -lrt must follow Boost
${OPENMP_LIBRARIES}
) )
set_source_files_properties( pcbnew.cpp PROPERTIES set_source_files_properties( pcbnew.cpp PROPERTIES
# The KIFACE is in pcbnew.cpp, export it: # The KIFACE is in pcbnew.cpp, export it:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment