-
Notifications
You must be signed in to change notification settings - Fork 12
Add github action to ensure build [VC2022] #146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
045f81e
ff29a3e
9e986d7
518e7c5
c640c64
14a5f61
1ce7ca1
d647858
795faa7
4973027
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| name: Build Linux | ||
|
|
||
| on: | ||
| push: | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-22.04] | ||
| architecture: ["x64"] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - name: Set up APT | ||
| if: ${{ matrix.os == 'ubuntu-20.04' || matrix.os == 'ubuntu-22.04' }} | ||
| run: | | ||
| sudo apt-get update -y | ||
| sudo apt-get -y install g++ cmake-data cmake ninja-build libzmq3-dev liblog4cxx-dev libboost-filesystem-dev libboost-system-dev libboost-thread-dev libboost-date-time-dev libboost-program-options-dev libcurl4-openssl-dev | ||
| - name: Install RapidJSON | ||
| run: | | ||
| set -e | ||
| git clone https://github.com/Tencent/rapidjson.git && mkdir rapidjson/build | ||
| cd rapidjson/build | ||
| # there are no stable version available | ||
| cmake .. -GNinja -DRAPIDJSON_HAS_STDSTRING=ON -DRAPIDJSON_BUILD_DOC=OFF -DRAPIDJSON_BUILD_EXAMPLES=OFF -DRAPIDJSON_BUILD_TESTS=OFF | ||
| ninja -j4 && sudo ninja install | ||
| cd ../.. | ||
| - name: Install | ||
| run: | | ||
| set -e | ||
| mkdir -p build | ||
| cd build | ||
| cmake .. -GNinja -DOPT_SAMPLES=OFF -DOPT_BUILD_TESTS=OFF | ||
| ninja -j4 && sudo ninja install | ||
| cd .. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,48 @@ | ||
| name: Build Windows | ||
|
|
||
| on: | ||
| push: | ||
|
|
||
| jobs: | ||
| build: | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| os: [windows-2022] | ||
| architecture: ["x64"] | ||
|
|
||
| steps: | ||
| - uses: actions/checkout@v3 | ||
| - uses: microsoft/[email protected] | ||
| - name: Set up Boost | ||
| run: | | ||
| choco install boost-msvc-14.3 -f -y | ||
| - name: Set up curl | ||
| run: | | ||
| curl -O -L https://curl.se/windows/dl-8.5.0_1/curl-8.5.0_1-win64-mingw.zip | ||
| 7z x -y curl-8.5.0_1-win64-mingw.zip | ||
| - name: Install RapidJSON | ||
| run: | | ||
| git clone https://github.com/Tencent/rapidjson.git && mkdir rapidjson\build | ||
| cd rapidjson\build | ||
| # there are no stable version available | ||
| # but take the last version without -targets.cmake | ||
| git checkout 516d0473949fdcf0a6dc9fbb40fa92b3b85db184 | ||
| cmake .. -G 'Visual Studio 17 2022' -A x64 -DRAPIDJSON_HAS_STDSTRING=ON -DRAPIDJSON_BUILD_DOC=OFF -DRAPIDJSON_BUILD_EXAMPLES=OFF -DRAPIDJSON_BUILD_TESTS=OFF | ||
| msbuild ALL_BUILD.vcxproj /p:Configuration=Release | ||
| cd ..\.. | ||
| - name: Install libzmq | ||
| run: | | ||
| git clone https://github.com/zeromq/libzmq.git && mkdir libzmq\build | ||
| cd libzmq\build | ||
| git checkout v4.3.5 | ||
| cmake .. -G 'Visual Studio 17 2022' -A x64 -DBUILD_TESTS=OFF | ||
| msbuild ALL_BUILD.vcxproj /p:Configuration=Release | ||
| cd ..\.. | ||
| - name: Install | ||
| run: | | ||
| mkdir -p build | ||
| cd build | ||
| cmake .. -G 'Visual Studio 17 2022' -A x64 -DCMAKE_CXX_STANDARD=17 "-DZeroMQ_DIR=${PWD}\..\libzmq\build" "-DCURL_INCLUDE_DIR=${PWD}\..\curl-8.5.0_1-win64-mingw\include" "-DCURL_LIBRARY=${PWD}\..\curl-8.5.0_1-win64-mingw\lib\libcurl.dll.a" -DCMAKE_CONFIGURATION_TYPES=Release -DOPT_SAMPLES=OFF -DOPT_BUILD_TESTS=OFF | ||
| msbuild ALL_BUILD.vcxproj /p:Configuration=Release | ||
| cd .. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -461,6 +461,7 @@ inline void LoadJsonValue(const rapidjson::GenericValue<Encoding, Allocator>& v, | |
| } | ||
| } | ||
|
|
||
| #ifndef _MSC_VER | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should we
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hemangandhi The thing is, there exists a branch which supports VC2010 https://github.com/mujin/controllerclientcpp/tree/savebackup and VC2010 does not support |
||
| template <typename Encoding=rapidjson::UTF8<>, typename Allocator=rapidjson::MemoryPoolAllocator<> > | ||
| inline void LoadJsonValue(const rapidjson::GenericValue<Encoding, Allocator>& v, uint64_t& t) { | ||
| if (v.IsUint64()) { | ||
|
|
@@ -486,6 +487,7 @@ inline void LoadJsonValue(const rapidjson::GenericValue<Encoding, Allocator>& v, | |
| throw MujinJSONException("Cannot convert json type " + GetJsonString(v) + " to Int64"); | ||
| } | ||
| } | ||
| #endif | ||
|
|
||
| template <typename Encoding=rapidjson::UTF8<>, typename Allocator=rapidjson::MemoryPoolAllocator<> > | ||
| inline void LoadJsonValue(const rapidjson::GenericValue<Encoding, Allocator>& v, double& t) { | ||
|
|
@@ -802,10 +804,12 @@ inline void SaveJsonValue(rapidjson::GenericValue<Encoding, Allocator>& v, const | |
| v.SetInt64(t); | ||
| } | ||
|
|
||
| #ifndef _MSC_VER | ||
| template <typename Encoding, typename Allocator, typename Allocator2> | ||
| inline void SaveJsonValue(rapidjson::GenericValue<Encoding, Allocator>& v, const int64_t& t, Allocator2& alloc) { | ||
| v.SetInt64(t); | ||
| } | ||
| #endif | ||
|
|
||
| template <typename Encoding, typename Allocator, typename Allocator2> | ||
| inline void SaveJsonValue(rapidjson::GenericValue<Encoding, Allocator>& v, const unsigned long long& t, Allocator2& alloc) { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're maintaining this approach, should we also get rid of the msvc_binaries?