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

Add SystemC 3.0.0 to CI and cleanup CI scripts #317

Merged
merged 4 commits into from
May 29, 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
17 changes: 2 additions & 15 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
strategy:
fail-fast: false
matrix:
systemc_version: [2.3.2, 2.3.3, 2.3.4]
systemc_version: [2.3.2, 2.3.3, 2.3.4, 3.0.0]
os:
- name: ubuntu
version: 20.04
Expand Down Expand Up @@ -116,16 +116,12 @@ jobs:
echo "NPROC=$(nproc)" >> ${GITHUB_ENV}
sudo apt-get update -y -qq
sudo apt-get install -y \
rapidjson-dev \
${{matrix.os.deps}}

- name: Setup Dependencies MacOS
if: matrix.os.name == 'macos'
run: |
echo "NPROC=$(sysctl -n hw.logicalcpu)" >> ${GITHUB_ENV}
brew install \
rapidjson \
${{matrix.os.deps}}

- name: Setup Dependencies Windows
if: matrix.os.name == 'windows'
Expand All @@ -134,15 +130,6 @@ jobs:
echo "C:\msys64\mingw64\bin" >> ${GITHUB_PATH}

choco install wget ${{matrix.os.deps}}

git clone https://github.com/Tencent/rapidjson.git ${{github.workspace}}/rapidjson
cd ${{github.workspace}}/rapidjson
git checkout v1.1.0
mkdir build
cd build
cmake ..
cmake --build . -- -j ${{env.NPROC}}
cmake --build . --target install

- name: Cache SystemC ${{matrix.systemc_version}} (${{matrix.os.cxx_compiler}})
id: cache-SystemC
Expand Down Expand Up @@ -183,7 +170,7 @@ jobs:
-DSYSTEMCCCI_BUILD_TESTS=ON ${{env.ESC}}
-DCMAKE_CXX_COMPILER=${{matrix.os.cxx_compiler}} ${{env.ESC}}
-DCMAKE_C_COMPILER=${{matrix.os.c_compiler}} ${{env.ESC}}
-DCMAKE_CXX_STANDARD=11 ${{env.ESC}}
-DCMAKE_CXX_STANDARD=${{matrix.systemc_version != '3.0.0' && '11' || '17'}} ${{env.ESC}}
-DCMAKE_PREFIX_PATH=${{env.SYSTEMC_HOME}}/lib/cmake/SystemCLanguage ${{env.ESC}}
-DCMAKE_INSTALL_PREFIX=${{env.CCI_HOME}} ${{env.ESC}}
../../..
Expand Down
12 changes: 0 additions & 12 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -100,12 +100,6 @@
# CMAKE_BUILD_TYPE Specifies the build type on single-configuration
# generators. (default: Release).
#
# CMAKE_CXX_STANDARD C++ standard to build all targets. Supported
# values are 98, 11, and 14. (default: 98)
#
# CMAKE_CXX_STANDARD_REQUIRED The with CMAKE_CXX_STANDARD selected C++ standard
# is a requirement. (default: ON)
#
# CMAKE_INSTALL_PREFIX Root directory of the SystemC libraries
# installation (defaults to $ENV{SYSTEMC_HOME}
# if set to an absolute path and otherwise to either
Expand Down Expand Up @@ -212,12 +206,6 @@ if (NOT CMAKE_BUILD_TYPE)
FORCE)
endif (NOT CMAKE_BUILD_TYPE)

set (CMAKE_CXX_STANDARD 11 CACHE STRING
"C++ standard to build all targets. Supported values are 98, 11, and 14.")
set (CMAKE_CXX_STANDARD_REQUIRED ON CACHE BOOL
"The with CMAKE_CXX_STANDARD selected C++ standard is a requirement.")
mark_as_advanced (CMAKE_CXX_STANDARD_REQUIRED)

if (NOT (WIN32 OR CYGWIN))
option (BUILD_SHARED_LIBS "Build shared libraries." ON)
else (NOT (WIN32 OR CYGWIN))
Expand Down
10 changes: 5 additions & 5 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,11 +99,6 @@ if ( NOT SystemCLanguage_FOUND AND NOT TARGET SystemC::systemc )
find_package(SystemCLanguage CONFIG REQUIRED)
ENDIF ()

set (CMAKE_CXX_STANDARD ${SystemC_CXX_STANDARD} CACHE STRING
"C++ standard to build all targets. Supported values are 98, 11, and 14.")
set (CMAKE_CXX_STANDARD_REQUIRED ${SystemC_CXX_STANDARD_REQUIRED} CACHE BOOL
"The with CMAKE_CXX_STANDARD selected C++ standard is a requirement.")

target_link_libraries(cci PUBLIC SystemC::systemc)

add_library (SystemC::cci ALIAS cci)
Expand All @@ -129,6 +124,11 @@ target_compile_options(
-Wall -Wextra -Wno-unused-parameter -Wno-unused-variable>
$<$<CXX_COMPILER_ID:MSVC>:/W3 /wd4244 /wd4267 /wd4996>)

target_compile_features(
cci
PUBLIC
cxx_std_11)

target_include_directories(cci
PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
Expand Down
Loading