early-access version 2853
This commit is contained in:
13
externals/vcpkg/ports/ampl-mp/disable-matlab-mex.patch
vendored
Executable file
13
externals/vcpkg/ports/ampl-mp/disable-matlab-mex.patch
vendored
Executable file
@@ -0,0 +1,13 @@
|
||||
diff --git a/src/asl/CMakeLists.txt b/src/asl/CMakeLists.txt
|
||||
index b7d7ecf..c31a032 100644
|
||||
--- a/src/asl/CMakeLists.txt
|
||||
+++ b/src/asl/CMakeLists.txt
|
||||
@@ -59,7 +59,7 @@ endif ()
|
||||
|
||||
target_link_libraries(aslmp ${CMAKE_DL_LIBS})
|
||||
|
||||
-find_package(MATLAB)
|
||||
+set(MATLAB_FOUND)
|
||||
if (MATLAB_FOUND AND MATLAB_BUILD)
|
||||
set(matlab_asl asl)
|
||||
if (MSVC)
|
||||
45
externals/vcpkg/ports/ampl-mp/fix-arm-build.patch
vendored
Executable file
45
externals/vcpkg/ports/ampl-mp/fix-arm-build.patch
vendored
Executable file
@@ -0,0 +1,45 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 92089a3..d4c6762 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -240,4 +240,4 @@
|
||||
set(MP_EXPR_INFO_FILE ${MP_SOURCE_DIR}/src/expr-info.cc)
|
||||
-add_executable(gen-expr-info EXCLUDE_FROM_ALL
|
||||
+add_executable(gen-expr-info
|
||||
src/gen-expr-info.cc $<TARGET_OBJECTS:format>)
|
||||
if (MINGW)
|
||||
@@ -257,9 +257,15 @@ if (CMAKE_CROSSCOMPILING)
|
||||
COMMAND ${CMAKE_COMMAND} -E echo
|
||||
"warning: cannot re-generate ${MP_EXPR_INFO_FILE}")
|
||||
else ()
|
||||
+ if (ARITHCHK_EXEC)
|
||||
+ add_custom_command(OUTPUT ${MP_EXPR_INFO_FILE}
|
||||
+ COMMAND ${WINE} ${ARITHCHK_EXEC} ${MP_EXPR_INFO_FILE}
|
||||
+ DEPENDS gen-expr-info)
|
||||
+ else()
|
||||
add_custom_command(OUTPUT ${MP_EXPR_INFO_FILE}
|
||||
COMMAND ${WINE} $<TARGET_FILE:gen-expr-info> ${MP_EXPR_INFO_FILE}
|
||||
DEPENDS gen-expr-info)
|
||||
+ endif()
|
||||
endif ()
|
||||
|
||||
add_prefix(MP_HEADERS include/mp/
|
||||
@@ -359,3 +365,4 @@ endif()
|
||||
install(DIRECTORY include/mp DESTINATION include)
|
||||
install(TARGETS mp DESTINATION lib RUNTIME DESTINATION bin)
|
||||
install(FILES LICENSE.rst DESTINATION share/mp)
|
||||
+install(TARGETS gen-expr-info RUNTIME DESTINATION bin)
|
||||
\ No newline at end of file
|
||||
diff --git a/src/amplsig/CMakeLists.txt b/src/amplsig/CMakeLists.txt
|
||||
index 81312e9..f44c847 100644
|
||||
--- a/src/amplsig/CMakeLists.txt
|
||||
+++ b/src/amplsig/CMakeLists.txt
|
||||
@@ -14,6 +14,6 @@ find_library(WS2_32_LIBRARY Ws2_32
|
||||
PATHS ${WIN_LIBRARY_DIR} NO_DEFAULT_PATH)
|
||||
if (WS2_32_LIBRARY)
|
||||
add_ampl_library(amplsig amplsig.cc)
|
||||
- message(WS2_32_LIBRARY ${WS2_32_LIBRARY})
|
||||
- target_link_libraries(amplsig mp ${WS2_32_LIBRARY})
|
||||
+ message(WS2_32_LIBRARY ws2_32)
|
||||
+ target_link_libraries(amplsig mp ws2_32)
|
||||
endif ()
|
||||
42
externals/vcpkg/ports/ampl-mp/fix-build.patch
vendored
Executable file
42
externals/vcpkg/ports/ampl-mp/fix-build.patch
vendored
Executable file
@@ -0,0 +1,42 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 904cfb1..13f11cb 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -61,6 +61,8 @@ set_cache(BUILD "" STRING
|
||||
if (BUILD)
|
||||
if (BUILD STREQUAL all)
|
||||
set(MP_MODULES all)
|
||||
+ elseif (BUILD STREQUAL no)
|
||||
+ set(MP_MODULES)
|
||||
else ()
|
||||
string(REGEX MATCHALL "[^,]+" MP_MODULES "${BUILD}")
|
||||
endif ()
|
||||
@@ -200,7 +202,7 @@ function (add_mp_library name)
|
||||
add_dependencies(${name} ${add_mp_library_DEPENDS})
|
||||
endif ()
|
||||
# Add library linked with dynamic runtime.
|
||||
- if (MSVC)
|
||||
+ if (0)
|
||||
add_library(${name}-dynrt ${libtype} EXCLUDE_FROM_ALL
|
||||
${add_mp_library_UNPARSED_ARGUMENTS} ${dynrt-objects})
|
||||
target_compile_options(${name}-dynrt PUBLIC /MD$<$<CONFIG:Debug>:d>)
|
||||
@@ -308,16 +310,17 @@ if (RT_LIBRARY)
|
||||
target_link_libraries(mp ${RT_LIBRARY})
|
||||
endif ()
|
||||
|
||||
+if (MP_VARIADIC_TEMPLATES)
|
||||
# Check if variadic templates are working and not affected by GCC bug 39653:
|
||||
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=39653
|
||||
check_cxx_source_compiles("
|
||||
template <class T, class ...Types>
|
||||
struct S { typedef typename S<Types...>::type type; };
|
||||
int main() {}" MP_VARIADIC_TEMPLATES)
|
||||
-
|
||||
-if (MP_VARIADIC_TEMPLATES)
|
||||
+ if (MP_VARIADIC_TEMPLATES)
|
||||
add_executable(nl-example src/nl-example.cc)
|
||||
target_link_libraries(nl-example mp)
|
||||
+ endif()
|
||||
endif ()
|
||||
|
||||
add_subdirectory(doc)
|
||||
28
externals/vcpkg/ports/ampl-mp/fix-dependency-asl.patch
vendored
Executable file
28
externals/vcpkg/ports/ampl-mp/fix-dependency-asl.patch
vendored
Executable file
@@ -0,0 +1,28 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index 13f11cb..92089a3 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -323,9 +323,9 @@ check_cxx_source_compiles("
|
||||
endif()
|
||||
endif ()
|
||||
|
||||
+find_package(unofficial-asl CONFIG REQUIRED)
|
||||
add_subdirectory(doc)
|
||||
add_subdirectory(src/amplsig)
|
||||
-add_subdirectory(src/asl)
|
||||
add_subdirectory(src/cp)
|
||||
add_subdirectory(solvers)
|
||||
|
||||
diff --git a/src/cp/cp.cc b/src/cp/cp.cc
|
||||
index d4adc35..ca8f35b 100644
|
||||
--- a/src/cp/cp.cc
|
||||
+++ b/src/cp/cp.cc
|
||||
@@ -24,7 +24,7 @@
|
||||
#include <cstring>
|
||||
#include <limits>
|
||||
#include "mp/format.h"
|
||||
-#include "funcadd.h"
|
||||
+#include <asl/funcadd.h>
|
||||
|
||||
namespace {
|
||||
void error(arglist *al, const char *message) {
|
||||
23
externals/vcpkg/ports/ampl-mp/install-targets.patch
vendored
Executable file
23
externals/vcpkg/ports/ampl-mp/install-targets.patch
vendored
Executable file
@@ -0,0 +1,23 @@
|
||||
diff --git a/CMakeLists.txt b/CMakeLists.txt
|
||||
index d4c6762..c7b15b6 100644
|
||||
--- a/CMakeLists.txt
|
||||
+++ b/CMakeLists.txt
|
||||
@@ -197,7 +197,7 @@ function (add_mp_library name)
|
||||
target_compile_definitions(${name}
|
||||
PUBLIC ${add_mp_library_COMPILE_DEFINITIONS})
|
||||
target_include_directories(${name}
|
||||
- PUBLIC ${add_mp_library_INCLUDE_DIRECTORIES})
|
||||
+ PUBLIC $<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/${add_mp_library_INCLUDE_DIRECTORIES}> $<INSTALL_INTERFACE:include>)
|
||||
if (add_mp_library_DEPENDS)
|
||||
add_dependencies(${name} ${add_mp_library_DEPENDS})
|
||||
endif ()
|
||||
@@ -363,6 +363,7 @@ if(BUILD_TESTING)
|
||||
endif()
|
||||
|
||||
install(DIRECTORY include/mp DESTINATION include)
|
||||
-install(TARGETS mp DESTINATION lib RUNTIME DESTINATION bin)
|
||||
+install(TARGETS mp EXPORT unofficial-mp-config DESTINATION lib RUNTIME DESTINATION bin)
|
||||
install(FILES LICENSE.rst DESTINATION share/mp)
|
||||
+install(EXPORT unofficial-mp-config DESTINATION share/unofficial-mp)
|
||||
install(TARGETS gen-expr-info RUNTIME DESTINATION bin)
|
||||
\ No newline at end of file
|
||||
50
externals/vcpkg/ports/ampl-mp/portfile.cmake
vendored
Executable file
50
externals/vcpkg/ports/ampl-mp/portfile.cmake
vendored
Executable file
@@ -0,0 +1,50 @@
|
||||
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
|
||||
|
||||
vcpkg_from_github(
|
||||
OUT_SOURCE_PATH SOURCE_PATH
|
||||
REPO ampl/mp
|
||||
REF bb7d616605dd23e4a453a834b0fc8c0a2a71b5aa
|
||||
SHA512 558321f700a2ffe9d13f29f7c034825f5644a49c55da8490160d7ee8303484de5f9a636783387cc108bd238cdc3d2afa6b28cafecce73ee7893d792f5293712a
|
||||
HEAD_REF master
|
||||
PATCHES
|
||||
disable-matlab-mex.patch
|
||||
fix-build.patch
|
||||
fix-dependency-asl.patch
|
||||
fix-arm-build.patch # https://github.com/ampl/mp/issues/115
|
||||
install-targets.patch
|
||||
)
|
||||
|
||||
if (NOT TARGET_TRIPLET STREQUAL HOST_TRIPLET)
|
||||
set(ARITHCHK_EXEC ${CURRENT_HOST_INSTALLED_DIR}/tools/${PORT}/gen-expr-info${VCPKG_HOST_EXECUTABLE_SUFFIX})
|
||||
if (NOT EXISTS "${ARITHCHK_EXEC}")
|
||||
message(FATAL_ERROR "Expected ${ARITHCHK_EXEC} to exist.")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
vcpkg_configure_cmake(
|
||||
SOURCE_PATH ${SOURCE_PATH}
|
||||
PREFER_NINJA
|
||||
OPTIONS
|
||||
-DBUILD=no
|
||||
-DBUILD_TESTING=OFF
|
||||
-DMP_VARIADIC_TEMPLATES=OFF
|
||||
-DARITHCHK_EXEC=${ARITHCHK_EXEC}
|
||||
)
|
||||
|
||||
vcpkg_install_cmake()
|
||||
|
||||
vcpkg_copy_pdbs()
|
||||
|
||||
vcpkg_copy_tools(TOOL_NAMES gen-expr-info AUTO_CLEAN)
|
||||
|
||||
vcpkg_fixup_cmake_targets(CONFIG_PATH share/unofficial-mp TARGET_PATH share/unofficial-mp)
|
||||
|
||||
file(REMOVE_RECURSE
|
||||
${CURRENT_PACKAGES_DIR}/debug/include
|
||||
${CURRENT_PACKAGES_DIR}/debug/share
|
||||
# remove amplsig.dll and cp.dll, see https://github.com/ampl/mp/issues/130
|
||||
${CURRENT_PACKAGES_DIR}/debug/bin
|
||||
${CURRENT_PACKAGES_DIR}/bin
|
||||
)
|
||||
|
||||
configure_file(${SOURCE_PATH}/LICENSE.rst ${CURRENT_PACKAGES_DIR}/share/${PORT}/copyright COPYONLY)
|
||||
15
externals/vcpkg/ports/ampl-mp/vcpkg.json
vendored
Executable file
15
externals/vcpkg/ports/ampl-mp/vcpkg.json
vendored
Executable file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"name": "ampl-mp",
|
||||
"version-date": "2020-11-11",
|
||||
"port-version": 3,
|
||||
"description": "An open-source library for mathematical programming",
|
||||
"homepage": "https://github.com/ampl/mp",
|
||||
"supports": "!uwp",
|
||||
"dependencies": [
|
||||
"ampl-asl",
|
||||
{
|
||||
"name": "ampl-mp",
|
||||
"host": true
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user