Arrange so that onnx-optimizer uses our own ONNX build, and links against the shared libraries of ONNX. diff --git a/CMakeLists.txt b/CMakeLists.txt index 00633856..76a73853 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -27,8 +27,6 @@ if(NOT ONNX_OPT_USE_SYSTEM_PROTOBUF) endif() -set(ONNX_ROOT ${PROJECT_SOURCE_DIR}/third_party/onnx) -add_subdirectory_if_no_target(${ONNX_ROOT} ${ONNX_TARGET_NAME}) file(READ "${PROJECT_SOURCE_DIR}/VERSION_NUMBER" ONNX_OPTIMIZER_VERSION) string(STRIP "${ONNX_OPTIMIZER_VERSION}" ONNX_OPTIMIZER_VERSION) @@ -41,14 +39,14 @@ file(GLOB onnx_opt_srcs "onnxoptimizer/*.cc" list(REMOVE_ITEM onnx_opt_srcs "${PROJECT_SOURCE_DIR}/onnxoptimizer/cpp2py_export.cc") onnxopt_add_library(onnx_optimizer ${onnx_opt_srcs}) -target_link_libraries(onnx_optimizer PUBLIC ${ONNX_TARGET_NAME}) +target_link_libraries(onnx_optimizer PUBLIC ${ONNX_TARGET_NAME} onnx_proto) target_include_directories(onnx_optimizer PUBLIC $ $ ) onnxopt_add_executable(onnx_optimizer_exec examples/onnx_optimizer_exec.cpp) -target_link_libraries(onnx_optimizer_exec onnx_optimizer) +target_link_libraries(onnx_optimizer_exec onnx_optimizer onnx_proto) file(GLOB onnx_opt_c_api_srcs "onnxoptimizer/c_api/*.cc" @@ -116,7 +114,8 @@ if(BUILD_ONNX_PYTHON) PRIVATE "-Wl,--whole-archive" $ "-Wl,--no-whole-archive") set_target_properties(onnx_opt_cpp2py_export - PROPERTIES LINK_FLAGS "-Wl,--exclude-libs,ALL") + PROPERTIES LINK_FLAGS "-Wl,--exclude-libs,ALL,-rpath=${CMAKE_INSTALL_PREFIX}/lib") + endif() target_link_libraries(onnx_opt_cpp2py_export PRIVATE onnx_optimizer) diff --git a/cmake/utils.cmake b/cmake/utils.cmake index 6cca9f36..8e39d5c4 100644 --- a/cmake/utils.cmake +++ b/cmake/utils.cmake @@ -1,4 +1,4 @@ -include(${PROJECT_SOURCE_DIR}/third_party/onnx/cmake/Utils.cmake) +include(${ONNX_ROOT}/cmake/Utils.cmake) # Poor man's FetchContent function(add_subdirectory_if_no_target dir target) 8c35297596a25e63c2565ac284'>cve.scm
AgeCommit message (Expand)Author
2019-10-23cve: Rewrite to read the JSON feed instead of the XML feed....The XML feed was discontinued on Oct. 16th, 2019: <https://nvd.nist.gov/General/News/XML-Vulnerability-Feed-Retirement-Phase-3> * guix/cve.scm (string->date*): New procedure. (<cve-item>, <cve>, <cve-reference>): New record types. (cpe-match->cve-configuration, configuration-data->cve-configurations) (json->cve-items, version-matches?): New procedures. (yearly-feed-uri): Change URL to refer to JSON feed. (cpe->product-alist, %parse-vulnerability-feed) (xml->vulnerabilities): Remove. (cve-configuration->package-list, merge-package-lists) (cve-item->vulnerability, json->vulnerabilities): New procedures. (write-cache): Use 'json->vulnerabilities' instead of 'xml->vulnerabilities', and remove 'parameterize'. (vulnerabilities->lookup-proc): Use 'version-matches?' when VERSION is true. * tests/cve.scm (%sample): Use 'tests/cve-sample.json'. (%expected-vulnerabilities): Rewrite accordingly. ("json->cve-items", "cve-item-published-date") ("json->vulnerabilities"): New tests. ("xml->vulnerabilities"): Remove. ("vulnerabilities->lookup-proc"): Adjust to new vulnerabilities. * tests/cve-sample.json: New file. * tests/cve-sample.xml: Remove. * Makefile.am (EXTRA_DIST): Adjust accordingly. * doc/guix.texi (Invoking guix lint): Update nist.gov URLs. Ludovic Courtès
2019-10-20tests: Avoid now-deprecated 'make-struct'....* tests/cve.scm (vulnerability): Use 'make-struct/no-tail' instead of 'make-struct', which is deprecated. * tests/lint.scm ("cve: one vulnerability") ("cve: one patched vulnerability") ("cve: known safe from vulnerability") ("cve: vulnerability fixed in replacement version") ("cve: patched vulnerability in replacement"): Likewise. Ludovic Courtès