From ca85fa4d1405d8a06ccfcda7e1e9f6bf57d17cfc Mon Sep 17 00:00:00 2001 From: Mudit Vats Date: Fri, 18 Dec 2020 09:11:34 -0700 Subject: [PATCH 1/9] Build Linux with VCPKG instead; previously explicitly cloning CPPRESTSDK and manually building. Now, VCPKG and CPPRESTSDK must be built before building RPC. See Build.md for build notes. --- Build.md | 100 ++++++++++++++++++++++++++++++++++++++ CMakeLists.txt | 59 +++------------------- CentOS7.md | 82 +++++++++++++++++++++++++++++++ MicroLMS/CMakeLists.txt | 15 ++---- MicroLMS/heci/HECILinux.c | 8 ++- 5 files changed, 200 insertions(+), 64 deletions(-) create mode 100644 Build.md create mode 100644 CentOS7.md diff --git a/Build.md b/Build.md new file mode 100644 index 0000000..175ed72 --- /dev/null +++ b/Build.md @@ -0,0 +1,100 @@ +# Remote Provisioning Client (RPC) + +RPC is an application which enables remote capabilities for AMT, such as as device activation. To accomplish this, RPC communicates with the RPS (Remote Provisioning Server). + +The steps below assume the following directory structure where **rpc** is the clone of this repository, **vcpkg** is a clone of the VCPKG tool source and **build** is the RPC build directory. Both vcpkg and build directories will be created in later steps. + +``` +\rpc + |__vcpkg + |__build +``` + +# Linux + +Steps below are for Ubuntu 18.04 and 20.04. + +## Dependencies + +``` +sudo apt install git cmake build-essential libboost-system-dev libboost-thread-dev libboost-random-dev libboost-regex-dev libboost-filesystem-dev libssl-dev zlib1g-dev +``` + +## Build C++ REST SDK + +Open a Terminal window. + +``` +git clone https://github.com/microsoft/vcpkg.git +cd vcpkg +./bootstrap-vcpkg.bat +./vcpkg install cpprestsdk[websockets] +``` + +## Build RPC + +Open a Terminal window. + +``` +mkdir build +cd build +cmake -DCMAKE_TOOLCHAIN_FILE=/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release .. +cmake --build . +``` + +To build debug: +``` +cmake -DCMAKE_TOOLCHAIN_FILE=/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug .. +cmake --build . +``` + +## Run RPC + +Open a Terminal window. + +``` +cd build +sudo ./rpc --url wss://localhost:8080 --cmd "-t activate --profile profile1" +``` + +Use --help for more options. + +# Windows + +Steps below are for Windows 10 and Visual Studio 2019 Professional. + +## Build C++ REST SDK + +Open an x64 Native Tools Command Prompt for Visual Studio 2019. + +``` +git clone https://github.com/microsoft/vcpkg.git +cd vcpkg +bootstrap-vcpkg.bat +vcpkg install cpprestsdk[websockets]:x64-windows-static +``` + +## Build RPC +Open an x64 Native Tools Command Prompt for Visual Studio 2019. +``` +mkdir build +cd build +cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_TOOLCHAIN_FILE=/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake .. +cmake --build . --config Release +``` + +To build debug: +``` +cmake --build . --config Debug +``` + +## Run RPC + +Open a Command Prompt as Administrator. + +``` +cd build\Release +rpc.exe --url wss://localhost:8080 --cmd "-t activate --profile profile1" +``` + +Use --help for more options. \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index d929b2b..f1a4c81 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -5,14 +5,10 @@ project (rpc VERSION 1.0.0) set (CMAKE_CXX_STANDARD 11) # RPC version info -configure_file(version.h.in - version.h) +configure_file(version.h.in version.h) include_directories(${PROJECT_BINARY_DIR}) -# TODO: figure out how to read the LMS version from repo like the main lms CMakeLists.txt -set (LMS_VERSION_STRING 1932.0.0.0) - -# Compiler settings [Obtained from CmakeLists.txt for lms] +# Common compiler settings string(APPEND CMAKE_CXX_FLAGS_DEBUG " -DDEBUG -D_DEBUG") string(APPEND CMAKE_C_FLAGS_DEBUG " -DDEBUG -D_DEBUG") @@ -31,7 +27,6 @@ if (UNIX) else (UNIX) add_definitions (/GS /sdl) set (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} /NXCompat /DynamicBase") - #add_definitions (/D UNICODE /D _UNICODE) add_definitions (/D UNICODE /D _UNICODE /D_NO_ASYNCRTIMP /D_ASYNCRT_EXPORT /D_NO_PPLXIMP /DWIN32 /DMBCS /D_USRDLL /DCPPREST_EXCLUDE_COMPRESSION /D_WINSOCK_DEPRECATED_NO_WARNINGS) add_compile_options ($<$:/O2>) add_compile_options (/MT$<$:d>) @@ -42,49 +37,10 @@ endif (UNIX) # Add MicroLMS directly to our build. This adds # the following targets: MicroLMS add_subdirectory(MicroLMS) -#add_dependencies(rpc MicroLMS) - -if (UNIX) - -# Find threads [unix it pthreads] -set(CMAKE_THREAD_PREFER_PTHREAD TRUE) -set(THREADS_PREFER_PTHREAD_FLAG TRUE) -find_package(Threads REQUIRED) - -# Find Boost -set(Boost_USE_STATIC_LIBS ON) -find_package(Boost COMPONENTS system REQUIRED) - -# Find OpenSSL -find_package(OpenSSL) - -# Find ZLIB -find_package(ZLIB) - -# Download and build CppRestSDK, If GIT_TAG is changed then need to delete cpprestsdk-prefix because UPDATE_COMMAND is set to "" -include(ExternalProject) -ExternalProject_Add(cpprestsdk - GIT_REPOSITORY https://github.com/Microsoft/cpprestsdk.git - GIT_TAG v2.10.16 - CMAKE_ARGS -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=0 -DBUILD_SAMPLES=OFF -DBUILD_TESTS=OFF -DCMAKE_INSTALL_PREFIX=/../../install - TEST_COMMAND "" - UPDATE_COMMAND "" -) -ExternalProject_Get_Property(cpprestsdk SOURCE_DIR) -set(CPPRESTSDK_LIBARIES ${SOURCE_DIR}/../../install/lib/) -set(CPPRESTSDK_INCLUDE_DIR ${SOURCE_DIR}/../../install/include/) - -add_library(cpprest INTERFACE) -target_link_libraries(cpprest INTERFACE ${CPPRESTSDK_LIBARIES}/libcpprest.a OpenSSL::SSL OpenSSL::Crypto ${Boost_LIBRARIES} Threads::Threads ZLIB::ZLIB) -target_include_directories(cpprest INTERFACE ${CPPRESTSDK_INCLUDE_DIR}) - -else (UNIX) # CppRestSDK find_package(cpprestsdk CONFIG REQUIRED) -endif (UNIX) - # ccu-poc add_executable (rpc info.h @@ -111,19 +67,20 @@ target_include_directories(rpc PUBLIC "MicroLMS/heci" ) -if (UNIX) +add_dependencies(rpc MicroLMS) -add_dependencies(rpc cpprestsdk) +if (UNIX) target_link_libraries (rpc PRIVATE MicroLMS - cpprest + cpprestsdk::cpprest + cpprestsdk::cpprestsdk_zlib_internal + cpprestsdk::cpprestsdk_boost_internal + cpprestsdk::cpprestsdk_openssl_internal ) else (UNIX) -add_dependencies(rpc MicroLMS ) - target_link_libraries (rpc PRIVATE MicroLMS cpprestsdk::cpprest diff --git a/CentOS7.md b/CentOS7.md new file mode 100644 index 0000000..1657ab1 --- /dev/null +++ b/CentOS7.md @@ -0,0 +1,82 @@ +# Remote Provisioning Client (RPC) + +RPC is an application which enables remote capabilities for AMT, such as as device activation. To accomplish this, RPC communicates with the RPS (Remote Provisioning Server). + +The steps below assume the following directory structure where **rpc** is the clone of this repository, **vcpkg** is a clone of the VCPKG tool source and **build** is the RPC build directory. Both vcpkg and build directories will be created in later steps. + +``` +\rpc + |__vcpkg + |__build +``` + +# Linux + +Steps below are for CentOS7. + +**The "export PATH=..." for CMake and "scl enable devtoolset-7 bash" must be executed in in the Terminal you are building from; i.e. these are temporary changes which only affect the current Terminal session.** + +## Dependencies + +### CMake +Download cmake-3.10.2-Linux-x86_64.sh from https://github.com/Kitware/CMake/releases/tag/v3.10.2. + +``` +./cmake-3.10.2-Linux-x86_64.sh +export PATH=/home/user/Downloads/cmake-3.10.2-Linux-x86_64/bin:$PATH +``` + +### GCC +Update GCC toolchain. + +``` +sudo yum install centos-release-scl +sudo yum install devtoolset-7 +scl enable devtoolset-7 bash +``` + +### Git +Update Git source control. +``` +rpm -U http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm \ + && yum install -y git +``` + +## Build C++ REST SDK + +Using a Terminal window with the PATH and devtoolset enabled per the Dependencies. + +``` +git clone https://github.com/microsoft/vcpkg.git +cd vcpkg +./bootstrap-vcpkg.bat +./vcpkg install cpprestsdk[websockets] +``` + +## Build RPC + +Using a Terminal window with the PATH and devtoolset enabled per the Dependencies. + +``` +mkdir build +cd build +cmake -DCMAKE_TOOLCHAIN_FILE=/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release .. +cmake --build . +``` + +To build debug: +``` +cmake -DCMAKE_TOOLCHAIN_FILE=/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug .. +cmake --build . +``` + +## Run RPC + +Open a Terminal window. + +``` +cd build +sudo ./rpc --url wss://localhost:8080 --cmd "-t activate --profile profile1" +``` + +Use --help for more options. diff --git a/MicroLMS/CMakeLists.txt b/MicroLMS/CMakeLists.txt index 263960c..4d93cc2 100644 --- a/MicroLMS/CMakeLists.txt +++ b/MicroLMS/CMakeLists.txt @@ -37,6 +37,10 @@ if (${BUILD_LIBRARY}) add_definitions(-D BUILD_LIBRARY) endif (${BUILD_LIBRARY}) +if (${NO_SELECT}) +add_definitions(-D NO_SELECT) +endif (${NO_SELECT}) + add_definitions( -D_POSIX ) else (UNIX) @@ -183,16 +187,5 @@ target_link_libraries ( endif (BUILD_LIBRARY) - - - - - - - - - - - endif (UNIX) diff --git a/MicroLMS/heci/HECILinux.c b/MicroLMS/heci/HECILinux.c index 4b97e32..08e6e2b 100644 --- a/MicroLMS/heci/HECILinux.c +++ b/MicroLMS/heci/HECILinux.c @@ -105,13 +105,17 @@ static ssize_t mei_recv_msg(struct mei *me, unsigned char *buffer, ssize_t len, static ssize_t mei_send_msg(struct mei *me, const unsigned char *buffer, ssize_t len, unsigned long timeout) { +#ifndef NO_SELECT struct timeval tv; +#endif ssize_t written; ssize_t rc; fd_set set; +#ifndef NO_SELECT tv.tv_sec = timeout / 1000; tv.tv_usec = (timeout % 1000) * 1000000; +#endif mei_msg(me, "call write length = %zd, cmd=%d\n", len, (int)buffer[0]); @@ -123,7 +127,7 @@ static ssize_t mei_send_msg(struct mei *me, const unsigned char *buffer, ssize_t mei_err(me, "write failed with status %zd %s\n", written, strerror(errno)); goto out; } - +#ifndef NO_SELECT FD_ZERO(&set); FD_SET(me->fd, &set); rc = select(me->fd + 1 , NULL, &set, NULL, &tv); @@ -136,7 +140,7 @@ static ssize_t mei_send_msg(struct mei *me, const unsigned char *buffer, ssize_t mei_err(me, "write failed on select with status %zd\n", rc); goto out; } - +#endif rc = written; out: sem_post(&(me->Lock)); From 0ecd6c99119754c749cc6cc4974d2f7c8e4b61ec Mon Sep 17 00:00:00 2001 From: Mudit Vats Date: Mon, 4 Jan 2021 14:38:40 -0700 Subject: [PATCH 2/9] Use -DNO_SELECT=ON to work around select behavior on older distros --- CentOS7.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CentOS7.md b/CentOS7.md index 1657ab1..abceb36 100644 --- a/CentOS7.md +++ b/CentOS7.md @@ -60,13 +60,13 @@ Using a Terminal window with the PATH and devtoolset enabled per the Dependencie ``` mkdir build cd build -cmake -DCMAKE_TOOLCHAIN_FILE=/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release .. +cmake -DCMAKE_TOOLCHAIN_FILE=/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release -DNO_SELECT=ON .. cmake --build . ``` To build debug: ``` -cmake -DCMAKE_TOOLCHAIN_FILE=/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug .. +cmake -DCMAKE_TOOLCHAIN_FILE=/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug -DNO_SELECT=ON .. cmake --build . ``` From 385ea2b9c3832f971333faeae4f8175610072aeb Mon Sep 17 00:00:00 2001 From: Mudit Vats Date: Tue, 5 Jan 2021 13:43:48 -0700 Subject: [PATCH 3/9] Build Git instead --- CentOS7.md | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/CentOS7.md b/CentOS7.md index abceb36..8f6035d 100644 --- a/CentOS7.md +++ b/CentOS7.md @@ -14,7 +14,7 @@ The steps below assume the following directory structure where **rpc** is the cl Steps below are for CentOS7. -**The "export PATH=..." for CMake and "scl enable devtoolset-7 bash" must be executed in in the Terminal you are building from; i.e. these are temporary changes which only affect the current Terminal session.** +**The "export PATH=..." (for CMake and Build Git), and "scl enable devtoolset-7 bash" (for GCC) must be executed in in the Terminal you are building from; i.e. these are temporary changes which only affect the current Terminal session.** ## Dependencies @@ -35,11 +35,14 @@ sudo yum install devtoolset-7 scl enable devtoolset-7 bash ``` -### Git -Update Git source control. +### Build Git +Build Git source control system. ``` -rpm -U http://opensource.wandisco.com/centos/7/git/x86_64/wandisco-git-release-7-2.noarch.rpm \ - && yum install -y git +sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-CPAN perl-devel +git clone https://github.com/git/git.git +make configure +make +export PATH=/home/user/Downloads/git:$PATH ``` ## Build C++ REST SDK From dbb825c49e2db317b9e8a00fdcf2025523e36569 Mon Sep 17 00:00:00 2001 From: Mudit Vats Date: Tue, 5 Jan 2021 13:44:43 -0700 Subject: [PATCH 4/9] Build Git instead --- CentOS7.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CentOS7.md b/CentOS7.md index 8f6035d..3c484cb 100644 --- a/CentOS7.md +++ b/CentOS7.md @@ -14,7 +14,7 @@ The steps below assume the following directory structure where **rpc** is the cl Steps below are for CentOS7. -**The "export PATH=..." (for CMake and Build Git), and "scl enable devtoolset-7 bash" (for GCC) must be executed in in the Terminal you are building from; i.e. these are temporary changes which only affect the current Terminal session.** +**The "export PATH=..." (for CMake and Git), and "scl enable devtoolset-7 bash" (for GCC) must be executed in in the Terminal you are building from; i.e. these are temporary changes which only affect the current Terminal session.** ## Dependencies @@ -35,7 +35,7 @@ sudo yum install devtoolset-7 scl enable devtoolset-7 bash ``` -### Build Git +### Git Build Git source control system. ``` sudo yum install curl-devel expat-devel gettext-devel openssl-devel zlib-devel perl-CPAN perl-devel From 53bc0c42da2640a2a5be5c1ccf5359e31f10bc5c Mon Sep 17 00:00:00 2001 From: Mudit Vats Date: Wed, 6 Jan 2021 13:58:23 -0700 Subject: [PATCH 5/9] Fix vcpkg boostrap command. Add CentOS8 build notes. --- Build.md | 5 +++-- CentOS7.md | 2 +- CentOS8.md | 63 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 67 insertions(+), 3 deletions(-) create mode 100644 CentOS8.md diff --git a/Build.md b/Build.md index 175ed72..3dce2d6 100644 --- a/Build.md +++ b/Build.md @@ -27,7 +27,7 @@ Open a Terminal window. ``` git clone https://github.com/microsoft/vcpkg.git cd vcpkg -./bootstrap-vcpkg.bat +./bootstrap-vcpkg.sh ./vcpkg install cpprestsdk[websockets] ``` @@ -97,4 +97,5 @@ cd build\Release rpc.exe --url wss://localhost:8080 --cmd "-t activate --profile profile1" ``` -Use --help for more options. \ No newline at end of file +Use --help for more options. + diff --git a/CentOS7.md b/CentOS7.md index 3c484cb..604b704 100644 --- a/CentOS7.md +++ b/CentOS7.md @@ -52,7 +52,7 @@ Using a Terminal window with the PATH and devtoolset enabled per the Dependencie ``` git clone https://github.com/microsoft/vcpkg.git cd vcpkg -./bootstrap-vcpkg.bat +./bootstrap-vcpkg.sh ./vcpkg install cpprestsdk[websockets] ``` diff --git a/CentOS8.md b/CentOS8.md new file mode 100644 index 0000000..499df56 --- /dev/null +++ b/CentOS8.md @@ -0,0 +1,63 @@ +# Remote Provisioning Client (RPC) + +RPC is an application which enables remote capabilities for AMT, such as as device activation. To accomplish this, RPC communicates with the RPS (Remote Provisioning Server). + +The steps below assume the following directory structure where **rpc** is the clone of this repository, **vcpkg** is a clone of the VCPKG tool source and **build** is the RPC build directory. Both vcpkg and build directories will be created in later steps. + +``` +\rpc + |__vcpkg + |__build +``` + +# Linux + +Steps below are for CentOS8. + +## Dependencies + +### CMake +Install CMake. + +``` +sudo yum install cmake +``` + +## Build C++ REST SDK + +Using a Terminal window with the PATH and devtoolset enabled per the Dependencies. + +``` +git clone https://github.com/microsoft/vcpkg.git +cd vcpkg +./bootstrap-vcpkg.sh +./vcpkg install cpprestsdk[websockets] +``` + +## Build RPC + +Using a Terminal window with the PATH and devtoolset enabled per the Dependencies. + +``` +mkdir build +cd build +cmake -DCMAKE_TOOLCHAIN_FILE=/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Release .. +cmake --build . +``` + +To build debug: +``` +cmake -DCMAKE_TOOLCHAIN_FILE=/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake -DCMAKE_BUILD_TYPE=Debug .. +cmake --build . +``` + +## Run RPC + +Open a Terminal window. + +``` +cd build +sudo ./rpc --url wss://localhost:8080 --cmd "-t activate --profile profile1" +``` + +Use --help for more options. From 8b4f3b00bb81ff619a837e35426348b3ac1ed45e Mon Sep 17 00:00:00 2001 From: Mudit Vats Date: Thu, 7 Jan 2021 15:49:48 -0700 Subject: [PATCH 6/9] Update dependencies --- Build.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Build.md b/Build.md index 3dce2d6..cd52bf8 100644 --- a/Build.md +++ b/Build.md @@ -17,7 +17,7 @@ Steps below are for Ubuntu 18.04 and 20.04. ## Dependencies ``` -sudo apt install git cmake build-essential libboost-system-dev libboost-thread-dev libboost-random-dev libboost-regex-dev libboost-filesystem-dev libssl-dev zlib1g-dev +sudo apt install git cmake build-essential curl zip unzip tar pkg-config ``` ## Build C++ REST SDK From 434c9a1cc243b2a8298393b6dd2a461d733034df Mon Sep 17 00:00:00 2001 From: Mudit Vats Date: Tue, 12 Jan 2021 14:03:32 -0700 Subject: [PATCH 7/9] Use latest vcpkg release --- Build.md | 2 +- CentOS7.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Build.md b/Build.md index cd52bf8..cef317c 100644 --- a/Build.md +++ b/Build.md @@ -25,7 +25,7 @@ sudo apt install git cmake build-essential curl zip unzip tar pkg-config Open a Terminal window. ``` -git clone https://github.com/microsoft/vcpkg.git +git clone -b 2020.11-1 https://github.com/microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg install cpprestsdk[websockets] diff --git a/CentOS7.md b/CentOS7.md index 604b704..79b8898 100644 --- a/CentOS7.md +++ b/CentOS7.md @@ -50,7 +50,7 @@ export PATH=/home/user/Downloads/git:$PATH Using a Terminal window with the PATH and devtoolset enabled per the Dependencies. ``` -git clone https://github.com/microsoft/vcpkg.git +git clone -b 2020.11-1 https://github.com/microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg install cpprestsdk[websockets] From aa68d7cfdb282fd407be585df4c39e9b3f58ea03 Mon Sep 17 00:00:00 2001 From: Mudit Vats Date: Tue, 12 Jan 2021 14:05:27 -0700 Subject: [PATCH 8/9] Use latest vcpkg release --- Build.md | 2 +- CentOS8.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Build.md b/Build.md index cef317c..be47cb0 100644 --- a/Build.md +++ b/Build.md @@ -68,7 +68,7 @@ Steps below are for Windows 10 and Visual Studio 2019 Professional. Open an x64 Native Tools Command Prompt for Visual Studio 2019. ``` -git clone https://github.com/microsoft/vcpkg.git +git clone -b 2020.11-1 https://github.com/microsoft/vcpkg.git cd vcpkg bootstrap-vcpkg.bat vcpkg install cpprestsdk[websockets]:x64-windows-static diff --git a/CentOS8.md b/CentOS8.md index 499df56..10d97f2 100644 --- a/CentOS8.md +++ b/CentOS8.md @@ -28,7 +28,7 @@ sudo yum install cmake Using a Terminal window with the PATH and devtoolset enabled per the Dependencies. ``` -git clone https://github.com/microsoft/vcpkg.git +git clone -b 2020.11-1 https://github.com/microsoft/vcpkg.git cd vcpkg ./bootstrap-vcpkg.sh ./vcpkg install cpprestsdk[websockets] From a32e1099136efd638ae3bd1ba46606b55fa0d339 Mon Sep 17 00:00:00 2001 From: trleasher-intel Date: Fri, 15 Jan 2021 09:23:37 -0700 Subject: [PATCH 9/9] Updates for using Vcpkg for both Linux and Windows --- .github/workflows/build.yml | 39 ++++++++++++++++++++++++------------- 1 file changed, 26 insertions(+), 13 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 190d4bf..a03cdf7 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -12,6 +12,7 @@ env: BUILD_TYPE: Release jobs: + build-windows: runs-on: windows-2019 steps: @@ -19,7 +20,7 @@ jobs: - name: Create Build Dir run: mkdir build - name: Clone - run: git clone --branch 2020.01 https://github.com/microsoft/vcpkg.git + run: git clone --branch 2020.11-1 https://github.com/microsoft/vcpkg.git - name: Build VCPKG run: cd vcpkg && bootstrap-vcpkg.bat shell: cmd @@ -27,11 +28,8 @@ jobs: run: ls - name: dir run: cd vcpkg && ls - - name: Integrate with VS - run: ${{ runner.workspace }}\rpc\vcpkg\vcpkg.exe integrate install - shell: cmd - name: Install C++ REST SDK - run: ${{ runner.workspace }}\rpc\vcpkg\vcpkg.exe install cpprestsdk:x64-windows-static + run: ${{ runner.workspace }}\rpc\vcpkg\vcpkg.exe install cpprestsdk[websockets]:x64-windows-static shell: cmd - name: dir run: ls && cd vcpkg && ls @@ -54,16 +52,31 @@ jobs: steps: - uses: actions/checkout@v2 - name: Install Dependencies - run: | - sudo apt install libboost-system-dev libboost-thread-dev libboost-random-dev libboost-regex-dev libboost-filesystem-dev libssl-dev zlib1g-dev -y - mkdir build - cd build - cmake -DCMAKE_BUILD_TYPE=Debug .. - cmake --build . - + run: sudo apt install git cmake build-essential curl zip unzip tar pkg-config + - name: Create Build Dir + run: mkdir build + - name: Clone + run: git clone --branch 2020.11-1 https://github.com/microsoft/vcpkg.git + - name: Build VCPKG + run: cd vcpkg && ./bootstrap-vcpkg.sh + shell: bash + - name: dir + run: ls + - name: dir + run: cd vcpkg && ls + - name: Install C++ REST SDK + run: ${{ runner.workspace }}/rpc/vcpkg/vcpkg install cpprestsdk[websockets] + shell: bash + - name: dir + run: ls && cd vcpkg && ls + shell: bash + - name: Prepare for build + run: cd build && cmake .. -DCMAKE_TOOLCHAIN_FILE=${{ runner.workspace }}/rpc/vcpkg/scripts/buildsystems/vcpkg.cmake + - name: Build RPC + run: cd build && cmake --build . --config Debug - name: GitHub Upload Release Artifacts uses: actions/upload-artifact@v2 with: name: RPC_Linux_${{ matrix.os }} path: | - build/rpc \ No newline at end of file + build/rpc