forked from pieter3d/simview
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow for non vendored abseil and gtest, as required on some platforms,
fixes pieter3d#18
- Loading branch information
Showing
5 changed files
with
128 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: "github-actions" | ||
directory: "/" | ||
schedule: | ||
interval: "weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,29 +14,87 @@ jobs: | |
steps: | ||
|
||
- name: Cancel previous | ||
uses: styfle/cancel-workflow-action@0.9.1 | ||
uses: styfle/cancel-workflow-action@0.11.0 | ||
with: | ||
access_token: ${{ github.token }} | ||
|
||
- name: Install build dependencies for simview and surelog | ||
run: | | ||
sudo apt-get update -qq | ||
sudo apt install -y \ | ||
libunwind-dev \ | ||
build-essential \ | ||
cmake \ | ||
ninja-build \ | ||
g++ \ | ||
default-jre \ | ||
google-perftools \ | ||
python3 python3-dev python3-orderedmultidict python3-psutil \ | ||
libgoogle-perftools-dev \ | ||
uuid-dev | ||
- name: Checkout simview | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Use ccache | ||
uses: hendrikmuhs/[email protected] | ||
with: | ||
key: build-cache | ||
|
||
- name: Configure shell | ||
run: | | ||
echo 'PATH=/usr/lib/ccache:'"$PATH" >> $GITHUB_ENV | ||
echo 'PREFIX=${GITHUB_WORKSPACE}/surelog-install' >> $GITHUB_ENV | ||
- name: Show shell configuration | ||
run: | | ||
env | ||
- name: Build Surelog | ||
run: | | ||
git clone --recursive --branch v1.75 https://github.com/chipsalliance/Surelog.git | ||
(cd Surelog ; make install) | ||
- name: Build | ||
run: | | ||
cmake -B build -GNinja -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/surelog-install -DCMAKE_CXX_FLAGS="-Wall -W -Wextra -Werror" . | ||
ninja -C build | ||
- name: Test | ||
run: | | ||
ninja -C build test | ||
linux-build-nonvendored: | ||
name: Build and Test (No Vendored Dependencies) | ||
|
||
runs-on: ubuntu-latest | ||
steps: | ||
|
||
- name: Install build dependencies for simview and surelog | ||
run: | | ||
sudo apt-get update -qq | ||
sudo apt install -y libunwind-dev | ||
sudo apt install -y \ | ||
build-essential cmake ninja-build \ | ||
g++ default-jre \ | ||
libunwind-dev \ | ||
build-essential \ | ||
cmake \ | ||
ninja-build \ | ||
g++ \ | ||
default-jre \ | ||
google-perftools \ | ||
python3 python3-dev python3-orderedmultidict python3-psutil \ | ||
libgoogle-perftools-dev \ | ||
uuid-dev | ||
- name: Checkout simview | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Use ccache | ||
uses: hendrikmuhs/ccache-action@v1 | ||
uses: hendrikmuhs/ccache-action@v1.2 | ||
with: | ||
key: build-cache | ||
|
||
|
@@ -49,26 +107,35 @@ jobs: | |
run: | | ||
env | ||
- name: Install Abseil and GTest | ||
run: | | ||
git clone --depth 1 https://github.com/google/googletest.git | ||
cd googletest && cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DCMAKE_POSITION_INDEPENDENT_CODE=ON . && cmake --build build && sudo cmake --install build | ||
git clone --depth 1 --branch 20230802.1 https://github.com/abseil/abseil-cpp.git | ||
pushd abseil-cpp && cmake -B build -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=17 -DCMAKE_POSITION_INDEPENDENT_CODE=ON . && cmake --build build && sudo cmake --install build | ||
- name: Build Surelog | ||
run: | | ||
git clone --recursive https://github.com/chipsalliance/Surelog.git | ||
(cd Surelog ; make install) | ||
- name: Build | ||
run: | | ||
cmake -B build -GNinja -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/surelog-install -DCMAKE_CXX_FLAGS="-Wall -W -Wextra -Werror" . | ||
cmake -B build -GNinja -DCMAKE_PREFIX_PATH=${GITHUB_WORKSPACE}/surelog-install -DCMAKE_CXX_FLAGS="-Wall -W -Wextra -Werror" -DSIMVIEW_USE_HOST_GTEST=ON -DSIMVIEW_USE_HOST_ABSL=ON . | ||
ninja -C build | ||
- name: Test | ||
run: | | ||
ninja -C build test | ||
CodeFormatting: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,40 @@ | ||
find_package(Git QUIET) | ||
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git") | ||
# Update submodules as needed | ||
option(GIT_SUBMODULE "Check submodules during build" ON) | ||
if(GIT_SUBMODULE) | ||
message(STATUS "Submodule update") | ||
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
RESULT_VARIABLE GIT_SUBMOD_RESULT) | ||
if(NOT GIT_SUBMOD_RESULT EQUAL "0") | ||
message(FATAL_ERROR "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules") | ||
|
||
if(NOT SIMVIEW_USE_HOST_ABSL OR (SIMVIEW_BUILD_TESTS AND NOT SIMVIEW_USE_HOST_GTEST)) | ||
find_package(Git QUIET) | ||
if(GIT_FOUND AND EXISTS "${PROJECT_SOURCE_DIR}/.git") | ||
# Update submodules as needed | ||
option(GIT_SUBMODULE "Check submodules during build" ON) | ||
if(GIT_SUBMODULE) | ||
message(STATUS "Submodule update") | ||
execute_process(COMMAND ${GIT_EXECUTABLE} submodule update --init --recursive | ||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} | ||
RESULT_VARIABLE GIT_SUBMOD_RESULT) | ||
if(NOT GIT_SUBMOD_RESULT EQUAL "0") | ||
message(FATAL_ERROR "git submodule update --init failed with ${GIT_SUBMOD_RESULT}, please checkout submodules") | ||
endif() | ||
endif() | ||
endif() | ||
endif() | ||
|
||
# Abseil can trigger this warning at current version. | ||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-maybe-uninitialized") | ||
if(NOT SIMVIEW_USE_HOST_ABSL) | ||
# Abseil can trigger this warning at current version. | ||
set(CMAKE_CXX_FLAGS "-Wno-maybe-uninitialized") | ||
|
||
# Add all expected submodules. | ||
set(ABSL_PROPAGATE_CXX_STD ON) | ||
add_subdirectory(abseil-cpp EXCLUDE_FROM_ALL) | ||
else() | ||
find_package(absl CONFIG REQUIRED) | ||
set_target_properties(absl::flat_hash_map PROPERTIES IMPORTED_GLOBAL True) | ||
set_target_properties(absl::str_format PROPERTIES IMPORTED_GLOBAL True) | ||
set_target_properties(absl::time PROPERTIES IMPORTED_GLOBAL True) | ||
endif() | ||
|
||
if(SIMVIEW_BUILD_TESTS AND NOT SIMVIEW_USE_HOST_GTEST) | ||
add_subdirectory(googletest EXCLUDE_FROM_ALL) | ||
elseif(SIMVIEW_BUILD_TESTS) | ||
find_package(GTest CONFIG) | ||
set_target_properties(GTest::gtest_main PROPERTIES IMPORTED_GLOBAL True) | ||
endif() | ||
|
||
# Add all expected submodules. | ||
set(ABSL_PROPAGATE_CXX_STD ON) | ||
add_subdirectory(abseil-cpp EXCLUDE_FROM_ALL) | ||
add_subdirectory(googletest EXCLUDE_FROM_ALL) | ||
add_subdirectory(fst) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,8 @@ | ||
# Simplify testing definitions. | ||
macro(simview_add_test Name) | ||
add_executable(${Name} ${ARGN}) | ||
target_link_libraries(${Name} PRIVATE gtest_main) | ||
add_test(NAME ${Name} COMMAND ${Name}) | ||
if(SIMVIEW_BUILD_TESTS) | ||
add_executable(${Name} ${ARGN}) | ||
target_link_libraries(${Name} PRIVATE gtest_main) | ||
add_test(NAME ${Name} COMMAND ${Name}) | ||
endif() | ||
endmacro() |