Skip to content
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

Build capicxx-someip-runtime on Windows #43

Merged
merged 1 commit into from
May 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
88 changes: 68 additions & 20 deletions .github/workflows/makefile.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,39 +7,31 @@ on:
branches: ["master"]

jobs:
build:
build_on_ubuntu_22_04:
runs-on: [ubuntu-22.04]

steps:
- name: "Checkout"
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: "Checkout capicxx-core-runtime"
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: COVESA/capicxx-core-runtime
path: "capicxx-core-runtime"

- name: "Checkout vsomeip"
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
repository: COVESA/vsomeip
path: "vsomeip"

- name: "Install googletest"
run: |
sudo apt-get install libgtest-dev
cd /usr/src/gtest
sudo cmake CMakeLists.txt
sudo make
sudo cp lib/*.a /usr/lib
sudo ln -s /usr/lib/libgtest.a /usr/local/lib/libgtest.a
sudo ln -s /usr/lib/libgtest_main.a /usr/local/lib/libgtest_main.a

- name: "Build capicxx-core-runtime"
run: |
cmake -S capicxx-core-runtime -B build-core-runtime -D CMAKE_INSTALL_PREFIX=install
cmake --build build-core-runtime --target install
- name: "Checkout googletest"
uses: actions/checkout@v4
with:
repository: google/googletest
ref: v1.14.0
path: "googletest"

- name: Ubuntu - Install boost 1.83.0 with gcc and x86
uses: MarkusJx/[email protected]
Expand All @@ -52,14 +44,70 @@ jobs:
arch: x86
cache: true

- name: "Build capicxx-core-runtime"
run: |
cmake -S capicxx-core-runtime -B build-core-runtime -D CMAKE_INSTALL_PREFIX=install
cmake --build build-core-runtime --target install

- name: "Build vsomeip"
run: |
cmake -S vsomeip -B vsomeip -D GTEST_ROOT=/usr/src/googletest -D BOOST_ROOT=/home/runner/boost/boost/ -D CMAKE_PREFIX_PATH=install -D CMAKE_INSTALL_PREFIX=install
cmake -S vsomeip -B vsomeip -D GTEST_ROOT=${{ github.workspace }}/googletest -D BOOST_ROOT=/home/runner/boost/boost/ -D CMAKE_PREFIX_PATH=install -D CMAKE_INSTALL_PREFIX=install
cmake --build vsomeip
cmake --install vsomeip --strip

- name: "Build capicxx-someip-runtime"
run: |
cmake -S . -B build-someip-runtime -D GTEST_ROOT=/usr/src/googletest -D CMAKE_PREFIX_PATH=install -D CMAKE_INSTALL_PREFIX=install
cmake --build build-someip-runtime
cmake --install build-someip-runtime --strip

build_on_windows_latest:
runs-on: windows-latest

steps:
- name: "Checkout"
uses: actions/checkout@v4

- name: "Checkout capicxx-core-runtime"
uses: actions/checkout@v4
with:
repository: COVESA/capicxx-core-runtime
path: "capicxx-core-runtime"

- name: "Checkout vsomeip"
uses: actions/checkout@v4
with:
repository: COVESA/vsomeip
path: "vsomeip"

- name: "Checkout googletest"
uses: actions/checkout@v4
with:
repository: google/googletest
ref: v1.14.0
path: "googletest"

- name: Windows - Install boost 1.83.0 with gcc and x86
uses: MarkusJx/[email protected]
id: windows-gcc-1_83-x86
with:
boost_version: 1.83.0
platform: windows
boost_install_dir: C:\runner
toolset: msvc
arch: x86
cache: true

- name: "Build capicxx-core-runtime"
run: |
cmake -S capicxx-core-runtime -B build-core-runtime -D BOOST_ROOT=C:\runner\boost -DCMAKE_INSTALL_PREFIX=${{ runner.workspace }}\install
cmake --build build-core-runtime --target install

- name: "Build vsomeip"
run: |
cmake -S vsomeip -B build-vsomeip -D GTEST_ROOT=${{ github.workspace }}\googletest -D BOOST_ROOT=C:\runner\boost -D CMAKE_INSTALL_PREFIX=${{ runner.workspace }}\install
cmake --build build-vsomeip --target install

- name: "Build capicxx-someip-runtime"
run: |
cmake -B build-someip-runtime -D GTEST_ROOT=${{ github.workspace }}\googletest -D BOOST_ROOT=C:\runner\boost -D CMAKE_PREFIX_PATH=${{ runner.workspace }}\install .
cmake --build build-someip-runtime
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ else()
MESSAGE( STATUS "Boost was not found!")
endif()
include_directories( ${Boost_INCLUDE_DIR} )
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_CRT_SECURE_NO_WARNINGS /wd4503")
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /std:c++17 -D_CRT_SECURE_NO_WARNINGS /wd4503")
link_directories(${Boost_LIBRARY_DIR})
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -Wextra -Wformat -Wformat-security -Wconversion -fexceptions -fstrict-aliasing -fstack-protector -fasynchronous-unwind-tables -fno-omit-frame-pointer -DCOMMONAPI_INTERNAL_COMPILATION -D_GLIBCXX_USE_NANOSLEEP -DBOOST_LOG_DYN_LINK -pthread -fvisibility=hidden")
Expand Down
4 changes: 4 additions & 0 deletions include/CommonAPI/SomeIP/OutputStream.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -568,7 +568,11 @@ class OutputStream: public CommonAPI::OutputStream<OutputStream> {
byte_t raw[sizeof(Type_)];
} value;
value.typed = _value;
#ifndef _WIN32
if ((__BYTE_ORDER == __LITTLE_ENDIAN) != isLittleEndian_) {
#else
if (!isLittleEndian_) {
#endif
byte_t reordered[sizeof(Type_)];
byte_t *source = &value.raw[sizeof(Type_) - 1];
byte_t *target = reordered;
Expand Down
Loading