git: b13bdddc8045 - main - devel/cmake-core: remove outdated FindOpenMP.cmake patch
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sun, 30 Apr 2023 18:43:00 UTC
The branch main has been updated by fuz: URL: https://cgit.FreeBSD.org/ports/commit/?id=b13bdddc804511e345e66f152d0e62b689b63cbb commit b13bdddc804511e345e66f152d0e62b689b63cbb Author: Robert Clausecker <fuz@FreeBSD.org> AuthorDate: 2023-04-20 20:33:54 +0000 Commit: Robert Clausecker <fuz@FreeBSD.org> CommitDate: 2023-04-30 18:41:40 +0000 devel/cmake-core: remove outdated FindOpenMP.cmake patch This patch broke the build of any armv6/armv7 package that tried to use OpenMP. It was once appropriate, but is now no longer correct or needed. PR: 270954 MFH: 2023Q2 Approved by: ports-secteam (fluffy), adridg Tested by: portmgr (antoine, exp-run) --- devel/cmake-core/Makefile | 1 + .../files/patch-Modules_FindOpenMP.cmake | 105 --------------------- 2 files changed, 1 insertion(+), 105 deletions(-) diff --git a/devel/cmake-core/Makefile b/devel/cmake-core/Makefile index 1c54ecdfe814..d00726e36fec 100644 --- a/devel/cmake-core/Makefile +++ b/devel/cmake-core/Makefile @@ -1,6 +1,7 @@ PORTNAME= cmake # Remember to update devel/cmake-doc and devel/cmake-gui as well. DISTVERSION= ${_CMAKE_VERSION} +PORTREVISION= 1 CATEGORIES= devel PKGNAMESUFFIX= -core diff --git a/devel/cmake-core/files/patch-Modules_FindOpenMP.cmake b/devel/cmake-core/files/patch-Modules_FindOpenMP.cmake deleted file mode 100644 index 817b4abbb4c0..000000000000 --- a/devel/cmake-core/files/patch-Modules_FindOpenMP.cmake +++ /dev/null @@ -1,105 +0,0 @@ -Avoid looking for pthread by simply asserting that it is there. -Otherwise openmp can't be found because the pthread library -lives in /usr/lib and CMake 3.11 doesn't look there anymore -while looking for openmp. PR 223678. - -Look for omp.h in LOCALBASE and pass suitable -I and -L flags -if those are necessary. Also use OpenMP flags when linking. -PR 223678 and PR 234050. - ---- Modules/FindOpenMP.cmake.orig 2022-11-17 13:55:41 UTC -+++ Modules/FindOpenMP.cmake -@@ -97,6 +97,33 @@ cmake_policy(SET CMP0012 NEW) # if() recognizes number - cmake_policy(SET CMP0054 NEW) # if() quoted variables not dereferenced - cmake_policy(SET CMP0057 NEW) # if IN_LIST - -+set(OpenMP_pthread_LIBRARY -lpthread) -+ -+# If the compiler itself has support for OpenMP, then omp.h is hidden -+# away somewhere and it won't be found here; but if the support comes -+# from an external package, it needs to have the right -I and -L flags. -+find_file(_path_to_omp_h omp.h) -+if(NOT _path_to_omp_h) -+ find_file(_path_to_omp_h omp.h -+ HINTS $ENV{LOCALBASE}/include /usr/local/include) -+endif() -+if(_path_to_omp_h) -+ get_filename_component(OpenMP_INCLUDE_DIR ${_path_to_omp_h} DIRECTORY) -+else() -+ set(OpenMP_INCLUDE_DIR "omp_h-NOTFOUND") -+endif() -+ -+find_library(_path_to_omp_lib omp) -+if(NOT _path_to_omp_lib) -+ find_library(_path_to_omp_lib omp -+ PATHS $ENV{LOCALBASE}/lib /usr/local/lib) -+endif() -+if(_path_to_omp_lib) -+ get_filename_component(OpenMP_LIB_DIR ${_path_to_omp_lib} DIRECTORY) -+else() -+ set(OpenMP_LIB_DIR "omp_lib-NOTFOUND") -+endif() -+ - function(_OPENMP_FLAG_CANDIDATES LANG) - if(NOT OpenMP_${LANG}_FLAG) - unset(OpenMP_FLAG_CANDIDATES) -@@ -211,6 +238,15 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_ - if(OpenMP_VERBOSE_COMPILE_OPTIONS) - string(APPEND OPENMP_FLAGS_TEST " ${OpenMP_VERBOSE_COMPILE_OPTIONS}") - endif() -+ set(_extra_flag "") -+ if(OpenMP_INCLUDE_DIR) -+ string(APPEND _extra_flag " -I${OpenMP_INCLUDE_DIR}") -+ endif() -+ if(OpenMP_LIB_DIR) -+ string(APPEND _extra_flag " -L${OpenMP_LIB_DIR}") -+ endif() -+ set(_need_extra FALSE) -+ - string(REGEX REPLACE "[-/=+]" "" OPENMP_PLAIN_FLAG "${OPENMP_FLAG}") - try_compile( OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG} - SOURCE_FROM_VAR "${_OPENMP_TEST_SRC_NAME}" _OPENMP_TEST_SRC_CONTENT -@@ -219,8 +255,23 @@ function(_OPENMP_GET_FLAGS LANG FLAG_MODE OPENMP_FLAG_ - OUTPUT_VARIABLE OpenMP_TRY_COMPILE_OUTPUT - ) - -+ # Might need that -I -L after all.. -+ if(NOT OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG}) -+ unset(OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG}) -+ try_compile( OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG} ${CMAKE_BINARY_DIR} ${_OPENMP_TEST_SRC} -+ CMAKE_FLAGS "-DCOMPILE_DEFINITIONS:STRING=${OPENMP_FLAGS_TEST} ${_extra_flag}" -+ LINK_LIBRARIES ${CMAKE_${LANG}_VERBOSE_FLAG} -+ OUTPUT_VARIABLE OpenMP_TRY_COMPILE_OUTPUT -+ ) -+ set(_need_extra TRUE) -+ endif() -+ - if(OpenMP_COMPILE_RESULT_${FLAG_MODE}_${OPENMP_PLAIN_FLAG}) -- set("${OPENMP_FLAG_VAR}" "${OPENMP_FLAG}" PARENT_SCOPE) -+ if(_need_extra) -+ set("${OPENMP_FLAG_VAR}" "${OPENMP_FLAG} ${_extra_flag}" PARENT_SCOPE) -+ else() -+ set("${OPENMP_FLAG_VAR}" "${OPENMP_FLAG}" PARENT_SCOPE) -+ endif() - - if(CMAKE_${LANG}_VERBOSE_FLAG) - unset(OpenMP_${LANG}_IMPLICIT_LIBRARIES) -@@ -603,9 +654,16 @@ foreach(LANG IN LISTS OpenMP_FINDLIST) - add_library(OpenMP::OpenMP_${LANG} INTERFACE IMPORTED) - endif() - if(OpenMP_${LANG}_FLAGS) -- separate_arguments(_OpenMP_${LANG}_OPTIONS NATIVE_COMMAND "${OpenMP_${LANG}_FLAGS}") -+ # All the options except -L.. -+ separate_arguments(_OpenMP_${LANG}_COMPILE_OPTIONS NATIVE_COMMAND "${OpenMP_${LANG}_FLAGS}") -+ list(FILTER _OpenMP_${LANG}_COMPILE_OPTIONS EXCLUDE REGEX "^-L/") -+ # All the options except -I.. -+ separate_arguments(_OpenMP_${LANG}_LINK_OPTIONS NATIVE_COMMAND "${OpenMP_${LANG}_FLAGS}") -+ list(FILTER _OpenMP_${LANG}_LINK_OPTIONS EXCLUDE REGEX "^-I/") - set_property(TARGET OpenMP::OpenMP_${LANG} PROPERTY -- INTERFACE_COMPILE_OPTIONS "$<$<COMPILE_LANGUAGE:${LANG}>:${_OpenMP_${LANG}_OPTIONS}>") -+ INTERFACE_COMPILE_OPTIONS "$<$<COMPILE_LANGUAGE:${LANG}>:${_OpenMP_${LANG}_COMPILE_OPTIONS}>") -+ set_property(TARGET OpenMP::OpenMP_${LANG} PROPERTY -+ INTERFACE_LINK_OPTIONS "$<$<COMPILE_LANGUAGE:${LANG}>:${_OpenMP_${LANG}_LINK_OPTIONS}>") - if(CMAKE_${LANG}_COMPILER_ID STREQUAL "Fujitsu" - OR ${CMAKE_${LANG}_COMPILER_ID} STREQUAL "IntelLLVM") - set_property(TARGET OpenMP::OpenMP_${LANG} PROPERTY