aboutsummaryrefslogtreecommitdiffstats
path: root/math/lean4/files/patch-src_CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'math/lean4/files/patch-src_CMakeLists.txt')
-rw-r--r--math/lean4/files/patch-src_CMakeLists.txt17
1 files changed, 14 insertions, 3 deletions
diff --git a/math/lean4/files/patch-src_CMakeLists.txt b/math/lean4/files/patch-src_CMakeLists.txt
index d7658e68a521..d71c117b8802 100644
--- a/math/lean4/files/patch-src_CMakeLists.txt
+++ b/math/lean4/files/patch-src_CMakeLists.txt
@@ -1,6 +1,6 @@
---- src/CMakeLists.txt.orig 2025-05-07 10:26:21 UTC
+--- src/CMakeLists.txt.orig 2025-11-18 02:29:21 UTC
+++ src/CMakeLists.txt
-@@ -472,6 +472,16 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
+@@ -473,6 +473,17 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "Linux")
string(APPEND TOOLCHAIN_SHARED_LINKER_FLAGS " -Wl,-rpath=\\$$ORIGIN/..:\\$$ORIGIN")
string(APPEND LAKESHARED_LINKER_FLAGS " -Wl,--whole-archive ${CMAKE_BINARY_DIR}/lib/lean/libLake.a.export -Wl,--no-whole-archive")
string(APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,-rpath=$ORIGIN/../lib:$ORIGIN/../lib/lean")
@@ -14,10 +14,21 @@
+ string(APPEND TOOLCHAIN_SHARED_LINKER_FLAGS " -Wl,-rpath=\\$$ORIGIN/..:\\$$ORIGIN")
+ string(APPEND LAKESHARED_LINKER_FLAGS " -Wl,--whole-archive ${CMAKE_BINARY_DIR}/lib/lean/libLake.a.export -Wl,--no-whole-archive")
+ string(APPEND CMAKE_EXE_LINKER_FLAGS " -Wl,-rpath=$ORIGIN/../lib:$ORIGIN/../lib/lean")
++ set(LEAN_EXTRA_LAKEFILE_TOML "weakLeancArgs = [\"-fPIC\"]")
elseif(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
string(APPEND CMAKE_CXX_FLAGS " -ftls-model=initial-exec")
string(APPEND INIT_SHARED_LINKER_FLAGS " -install_name @rpath/libInit_shared.dylib")
-@@ -801,7 +811,7 @@ endif()
+@@ -586,6 +597,9 @@ string(APPEND LEANC_OPTS " -I${CMAKE_BINARY_DIR}/inclu
+ # Lean code only needs this one include
+ string(APPEND LEANC_OPTS " -I${CMAKE_BINARY_DIR}/include")
+
++# Include extra flags (e.g., -fPIC on FreeBSD)
++string(APPEND LEANC_OPTS " ${LEANC_EXTRA_FLAGS}")
++
+ # Use CMake profile C++ flags for building Lean libraries, but do not embed in `leanc`
+ string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
+ string(APPEND LEANC_OPTS " ${CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE}}")
+@@ -814,7 +828,7 @@ endif()
file(CREATE_LINK ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR}/src/lean RESULT _IGNORE_RES SYMBOLIC)
endif()