Merge pull request #1185 from adam-sim-dev/fix_issue_1184

For building shared libs with flang, use C linker instead of Fortran linker to avoid macOS-specific flags that CMake adds (tested CMake 4.2).
This commit is contained in:
langou
2026-01-20 09:14:32 -07:00
committed by GitHub
2 changed files with 11 additions and 0 deletions
+6
View File
@@ -152,6 +152,12 @@ add_library(${BLASLIB}
$<TARGET_OBJECTS:${BLASLIB}_obj>
$<$<BOOL:${BUILD_INDEX64_EXT_API}>: $<TARGET_OBJECTS:${BLASLIB}_64_obj>>)
# For flang, use C linker instead of Fortran linker to avoid macOS-specific flags
# that CMake adds (tested CMake 4.2).
if (CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang")
set_target_properties (${BLASLIB} PROPERTIES LINKER_LANGUAGE C)
endif()
set_target_properties(
${BLASLIB} PROPERTIES
VERSION ${LAPACK_VERSION}
+5
View File
@@ -578,6 +578,11 @@ add_library(${LAPACKLIB}
$<TARGET_OBJECTS:mod_files>
$<TARGET_OBJECTS:${LAPACKLIB}_obj>
$<$<BOOL:${BUILD_INDEX64_EXT_API}>: $<TARGET_OBJECTS:${LAPACKLIB}_64_obj>>)
# For flang, use C linker instead of Fortran linker to avoid macOS-specific flags
# that CMake adds (tested CMake 4.2).
if (CMAKE_Fortran_COMPILER_ID STREQUAL "LLVMFlang")
set_target_properties (${LAPACKLIB} PROPERTIES LINKER_LANGUAGE C)
endif()
set_target_properties(
${LAPACKLIB} PROPERTIES
VERSION ${LAPACK_VERSION}