diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index af1e9aee..1705b8e1 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -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 @@ -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' @@ -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 @@ -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}} ../../.. diff --git a/CMakeLists.txt b/CMakeLists.txt index 83583e7d..aedf2099 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 @@ -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)) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 56bf444c..c328f898 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -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) @@ -129,6 +124,11 @@ target_compile_options( -Wall -Wextra -Wno-unused-parameter -Wno-unused-variable> $<$:/W3 /wd4244 /wd4267 /wd4996>) +target_compile_features( + cci + PUBLIC + cxx_std_11) + target_include_directories(cci PUBLIC $