From 322c0ee7d8045682b9ad103deadc25e058e12844 Mon Sep 17 00:00:00 2001 From: charles <596147986@qq.com> Date: Tue, 9 Jun 2020 17:23:19 +1000 Subject: [PATCH 1/2] package for mac&&linux | add travis --- .travis.yml | 33 +++++++++++++++++++++++++++++++++ CMakeLists.txt | 12 ++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..4e39e9c --- /dev/null +++ b/.travis.yml @@ -0,0 +1,33 @@ +language: generic + +matrix: + include: + - os: linux + + dist: bionic + sudo: required + install: + - wget https://github.com/charles32110/SVF-Static-Lib/releases/download/V1.0.1/V1.0.1.tar.gz + - tar -xzvf V1.0.1.tar.gz + - export SVF=$PWD/SVF-Static-Lib + - wget https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz + - xz -d clang*.tar.xz + - tar -xvf clang*.tar + - export LLVM_DIR=$PWD/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04 + - os: osx + osx_image: xcode11.5 + install: + - wget https://github.com/charles32110/SVF-Static-Lib/releases/download/V1.0.1/V1.0.1.tar.gz + - tar -xzvf V1.0.1.tar.gz + - export SVF=$PWD/SVF-Static-Lib + - wget https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-apple-darwin.tar.xz + - tar -xzvf clang+llvm-10.0.0-x86_64-apple-darwin.tar.xz + - export LLVM_DIR=$PWD/clang+llvm-10.0.0-x86_64-apple-darwin + +before_script: + - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get update ; fi + - if [ "$TRAVIS_OS_NAME" = "linux" ]; then sudo apt-get install cmake gcc g++; fi + +script: + - cmake -DSVF_DIR=$SVF + - make \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index ff3e29f..b5ec728 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -29,9 +29,17 @@ Please set this to environment variable to point to the LLVM build directory\ (e.g. on linux: export LLVM_DIR=/path/to/llvm/build/dir)") endif() +if (UNIX AND NOT APPLE) + MESSAGE (STATUS "this is linux") + set(SVF_LIB "${SVF_DIR}/libsvf_static_lib.a") + set(LLVMCudd "${SVF_DIR}/libCudd.a") +elseif (APPLE) + MESSAGE (STATUS "this is MAC") + set(SVF_LIB "${SVF_DIR}/libSVFmac.a") + set(LLVMCudd "${SVF_DIR}/libCuddmac.a") +endif() set(SVF_HEADER "${SVF_DIR}/include") -set(SVF_LIB "${SVF_DIR}/libsvf_static_lib.a") -set(LLVMCudd "${SVF_DIR}/libCudd.a") + if (EXISTS "${SVF_HEADER}" AND EXISTS "${SVF_LIB}") message(STATUS "SVF_HEADER: ${SVF_HEADER}") message(STATUS "SVF_LIB: ${SVF_LIB}") From 3e99ef352d2391139c791ea6e18ec50bbde01b7e Mon Sep 17 00:00:00 2001 From: charles <596147986@qq.com> Date: Tue, 9 Jun 2020 17:50:39 +1000 Subject: [PATCH 2/2] fix name --- .travis.yml | 3 +-- CMakeLists.txt | 8 ++++---- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/.travis.yml b/.travis.yml index 4e39e9c..6691633 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,8 +11,7 @@ matrix: - tar -xzvf V1.0.1.tar.gz - export SVF=$PWD/SVF-Static-Lib - wget https://github.com/llvm/llvm-project/releases/download/llvmorg-10.0.0/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04.tar.xz - - xz -d clang*.tar.xz - - tar -xvf clang*.tar + - tar -xvf clang*.tar.xz - export LLVM_DIR=$PWD/clang+llvm-10.0.0-x86_64-linux-gnu-ubuntu-18.04 - os: osx osx_image: xcode11.5 diff --git a/CMakeLists.txt b/CMakeLists.txt index b5ec728..5ecf025 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -31,12 +31,12 @@ endif() if (UNIX AND NOT APPLE) MESSAGE (STATUS "this is linux") - set(SVF_LIB "${SVF_DIR}/libsvf_static_lib.a") - set(LLVMCudd "${SVF_DIR}/libCudd.a") + set(SVF_LIB "${SVF_DIR}/libsvf_ubuntu.a") + set(LLVMCudd "${SVF_DIR}/libCudd_ubuntu.a") elseif (APPLE) MESSAGE (STATUS "this is MAC") - set(SVF_LIB "${SVF_DIR}/libSVFmac.a") - set(LLVMCudd "${SVF_DIR}/libCuddmac.a") + set(SVF_LIB "${SVF_DIR}/libsvf_mac.a") + set(LLVMCudd "${SVF_DIR}/libCudd_mac.a") endif() set(SVF_HEADER "${SVF_DIR}/include")