134 lines
3.9 KiB
Diff
134 lines
3.9 KiB
Diff
--- zimpl/CMakeLists.txt.orig 2023-08-08 06:33:21.000000000 -0600
|
|
+++ zimpl/CMakeLists.txt 2023-11-15 21:04:39.935423110 -0700
|
|
@@ -41,8 +41,6 @@ endif()
|
|
|
|
# use C99 standard
|
|
set(CMAKE_C_STANDARD 99)
|
|
-set(CMAKE_C_VISIBILITY_PRESET hidden)
|
|
-set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
|
|
|
|
option(ZLIB "use ZLIB" ON)
|
|
option(SANITIZE_ADDRESS "should the address sanitizer be enabled in debug mode if available" OFF)
|
|
--- zimpl/src/CMakeLists.txt.orig 2023-08-08 06:33:23.000000000 -0600
|
|
+++ zimpl/src/CMakeLists.txt 2023-11-15 21:04:39.936423097 -0700
|
|
@@ -118,12 +118,10 @@ if(MSVC)
|
|
endif()
|
|
|
|
#create zimpl with pic
|
|
-add_library(libzimpl-pic STATIC ${libsources})
|
|
-set_target_properties(libzimpl-pic PROPERTIES POSITION_INDEPENDENT_CODE on)
|
|
-target_link_libraries(libzimpl-pic ${libs})
|
|
-
|
|
-#create zimpl without pic
|
|
-add_library(libzimpl STATIC ${libsources})
|
|
+add_library(libzimpl SHARED ${libsources})
|
|
+set_target_properties(libzimpl PROPERTIES
|
|
+ POSITION_INDEPENDENT_CODE on
|
|
+ VERSION 0.0.0 SOVERSION 0)
|
|
target_link_libraries(libzimpl ${libs})
|
|
|
|
#create zimpl binary
|
|
@@ -140,21 +138,18 @@ endif()
|
|
set_target_properties(libzimpl PROPERTIES
|
|
OUTPUT_NAME "zimpl")
|
|
|
|
-set_target_properties(libzimpl-pic PROPERTIES
|
|
- OUTPUT_NAME "zimpl-pic")
|
|
-
|
|
# install the header files of zimpl
|
|
install(FILES ${headers} DESTINATION include/zimpl)
|
|
|
|
# install the binary and the library to appropriate locations and add them to an export group
|
|
-install(TARGETS libzimpl zimpl libzimpl-pic EXPORT zimpl-targets
|
|
+install(TARGETS libzimpl zimpl EXPORT zimpl-targets
|
|
LIBRARY DESTINATION lib
|
|
ARCHIVE DESTINATION lib
|
|
RUNTIME DESTINATION bin
|
|
INCLUDES DESTINATION include)
|
|
|
|
# Add library targets to the build-tree export set
|
|
-export(TARGETS libzimpl libzimpl-pic
|
|
+export(TARGETS libzimpl
|
|
FILE "${CMAKE_BINARY_DIR}/zimpl-targets.cmake")
|
|
|
|
#configure the config file for the build tree
|
|
--- zimpl/src/zimpl/zimpllib.c.orig 2023-08-08 06:33:23.000000000 -0600
|
|
+++ zimpl/src/zimpl/zimpllib.c 2023-11-15 21:04:39.936423097 -0700
|
|
@@ -456,3 +456,66 @@ bool zpl_read_with_args(char** argv, int
|
|
|
|
return ret;
|
|
}
|
|
+
|
|
+// Dummy weak definitions to avoid unresolved symbols
|
|
+Lps * __attribute__((weak)) xlp_alloc(char const* name, bool need_startval, void* user_data)
|
|
+{
|
|
+ abort();
|
|
+}
|
|
+
|
|
+void __attribute__((weak)) xlp_free(Lps* lp)
|
|
+{
|
|
+ abort();
|
|
+}
|
|
+
|
|
+bool __attribute__((weak)) xlp_conname_exists(Lps const* lp, char const* conname)
|
|
+{
|
|
+ abort();
|
|
+}
|
|
+
|
|
+bool __attribute__((weak)) xlp_addcon_term(Lps* lp, char const* name, ConType type,
|
|
+ Numb const* lhs, Numb const* rhs, unsigned int flags, Term const* term)
|
|
+{
|
|
+ abort();
|
|
+}
|
|
+
|
|
+Var* __attribute__((weak)) xlp_addvar(Lps* lp, char const* name, VarClass usevarclass,
|
|
+ Bound const* lower, Bound const* upper, Numb const* priority, Numb const* startval)
|
|
+{
|
|
+ abort();
|
|
+}
|
|
+
|
|
+int __attribute__((weak)) xlp_addsos_term(Lps* lp, char const* name, SosType type, Numb const* priority, Term const* term)
|
|
+{
|
|
+ abort();
|
|
+}
|
|
+
|
|
+char const* __attribute__((weak)) xlp_getvarname(Lps const* lp, Var const* var)
|
|
+{
|
|
+ abort();
|
|
+}
|
|
+
|
|
+VarClass __attribute__((weak)) xlp_getclass(Lps const* lp, Var const* var)
|
|
+{
|
|
+ abort();
|
|
+}
|
|
+
|
|
+Bound* __attribute__((weak)) xlp_getlower(Lps const* lp, Var const* var)
|
|
+{
|
|
+ abort();
|
|
+}
|
|
+
|
|
+Bound* __attribute__((weak)) xlp_getupper(Lps const* lp, Var const* var)
|
|
+{
|
|
+ abort();
|
|
+}
|
|
+
|
|
+bool __attribute__((weak)) xlp_setobj(Lps* lp, char const* name, bool minimize)
|
|
+{
|
|
+ abort();
|
|
+}
|
|
+
|
|
+void __attribute__((weak)) xlp_addtoobj(Lps* lp, Term const* term)
|
|
+{
|
|
+ abort();
|
|
+}
|
|
--- zimpl/zimpl-config.cmake.in.orig 2023-08-08 06:33:23.000000000 -0600
|
|
+++ zimpl/zimpl-config.cmake.in 2023-11-15 21:04:39.936423097 -0700
|
|
@@ -3,7 +3,7 @@ if(NOT TARGET libzimpl)
|
|
endif()
|
|
|
|
set(ZIMPL_LIBRARIES libzimpl)
|
|
-set(ZIMPL_PIC_LIBRARIES libzimpl-pic)
|
|
+set(ZIMPL_PIC_LIBRARIES libzimpl)
|
|
set(ZIMPL_INCLUDE_DIRS "@CONF_INCLUDE_DIRS@")
|
|
set(ZIMPL_FOUND TRUE)
|
|
|