Skip to content
Extraits de code Groupes Projets
Vérifiée Valider 66ff389a rédigé par Kubat's avatar Kubat
Parcourir les fichiers

FIX: Rely entirely on CMake to find OpenMP support

parent 55a0dd36
Aucune branche associée trouvée
Aucune étiquette associée trouvée
1 requête de fusion!189Resolve "Dépendance manquante OpenMP"
......@@ -20,6 +20,20 @@ include(TestBigEndian) # Needed for endianness tests
include(FindOpenMP) # Test OpenMP support
include(GNUInstallDirs) # Needed for installation things
### ###
# TEST OPENMP #
### ###
if(OpenMP_FOUND)
message(STATUS "OpenMP found by CMake for C (version ${OpenMP_C_VERSION}) and C++ (version ${OpenMP_CXX_VERSION})")
else()
message(FATAL_ERROR "OpenMP not found by CMake for C and C++")
endif()
### ###
# SET COMMON VARIABLES #
### ###
set(${CMAKE_C_COMPILER_ID}_C_FLAGS)
set(COMMON_C_FLAGS
-Wall -Wextra -Werror
......@@ -33,7 +47,7 @@ set(COMMON_C_FLAGS
-Wdouble-promotion
-Wformat=2
-Wignored-qualifiers
-fopenmp
${OpenMP_C_FLAGS}
)
set(Clang_C_FLAGS
-Weverything
......@@ -229,16 +243,6 @@ set(SQL_SOURCE_FILES
${CMAKE_CURRENT_SOURCE_DIR}/src/database/memory.sql
)
### ###
# TEST OPENMP #
### ###
if(OpenMP_FOUND)
message(STATUS "OpenMP found by CMake for C and C++")
else()
message(FATAL_ERROR "OpenMP not found by CMake for C and C++")
endif()
### ###
# THE COMPILATION DIRECTIVES #
### ###
......@@ -290,6 +294,7 @@ if(GENERATE_MANPAGES)
endif()
target_link_libraries(lektord PRIVATE
${OpenMP_C_LIBRARIES}
${MPV_LIBRARY}
${CMAKE_DL_LIBS}
${SQLITE3_LIBRARY}
......@@ -299,6 +304,7 @@ target_link_libraries(lektord PRIVATE
Qt${QT_VERSION_MAJOR}::Widgets
)
target_link_libraries(luka PRIVATE
${OpenMP_C_LIBRARIES}
${MPV_LIBRARY}
${CMAKE_DL_LIBS}
${SQLITE3_LIBRARY}
......@@ -307,6 +313,9 @@ target_link_libraries(luka PRIVATE
${SDL2_IMAGE_LIBRARIES}
Qt${QT_VERSION_MAJOR}::Widgets
)
target_link_libraries(lkt PRIVATE
${OpenMP_C_LIBRARIES}
)
target_include_directories(lkt PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/inc)
target_include_directories(luka PRIVATE
......@@ -323,8 +332,6 @@ target_include_directories(lektord PRIVATE
)
target_link_libraries(lektord PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
target_link_libraries(lektord PRIVATE -fopenmp)
target_link_libraries(luka PRIVATE -fopenmp)
target_compile_definitions(lektord PRIVATE ${common_DEFINITIONS})
target_compile_definitions(lkt PRIVATE ${common_DEFINITIONS})
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter