Added CCI to build and support of conan.io
This commit is contained in:
parent
e3235e8fda
commit
27b1e268c0
17
.cproject
17
.cproject
@ -22,7 +22,7 @@
|
||||
<folderInfo id="cdt.managedbuild.config.gnu.macosx.exe.debug.133691581." name="/" resourcePath="">
|
||||
<toolChain id="cdt.managedbuild.toolchain.gnu.macosx.exe.debug.500082514" name="MacOSX GCC" superClass="cdt.managedbuild.toolchain.gnu.macosx.exe.debug">
|
||||
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF;org.eclipse.cdt.core.GNU_ELF" id="cdt.managedbuild.target.gnu.platform.macosx.exe.debug.493103663" name="Debug Platform" superClass="cdt.managedbuild.target.gnu.platform.macosx.exe.debug"/>
|
||||
<builder buildPath="${workspace_loc:/sc-components-test/build}" id="cdt.managedbuild.target.gnu.builder.base.214255941" keepEnvironmentInBuildfile="true" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
|
||||
<builder arguments="VERBOSE=1" buildPath="${workspace_loc:/sc-components-test/build}" command="make" id="cdt.managedbuild.target.gnu.builder.base.214255941" keepEnvironmentInBuildfile="true" managedBuildOn="false" name="Gnu Make Builder" superClass="cdt.managedbuild.target.gnu.builder.base"/>
|
||||
<tool id="cdt.managedbuild.tool.macosx.c.linker.macosx.exe.debug.1022976995" name="MacOS X C Linker" superClass="cdt.managedbuild.tool.macosx.c.linker.macosx.exe.debug"/>
|
||||
<tool command="c++" id="cdt.managedbuild.tool.macosx.cpp.linker.macosx.exe.debug.1153644061" name="MacOS X C++ Linker" superClass="cdt.managedbuild.tool.macosx.cpp.linker.macosx.exe.debug">
|
||||
<option id="macosx.cpp.link.option.paths.33338975" name="Library search path (-L)" superClass="macosx.cpp.link.option.paths" useByScannerDiscovery="false" valueType="libPaths">
|
||||
@ -190,21 +190,6 @@
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="clean" path="build" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildTarget>clean</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
<target name="clangformat" path="build" targetID="org.eclipse.cdt.build.MakeTargetBuilder">
|
||||
<buildCommand>make</buildCommand>
|
||||
<buildArguments/>
|
||||
<buildTarget>clangformat</buildTarget>
|
||||
<stopOnError>true</stopOnError>
|
||||
<useDefaultCommand>true</useDefaultCommand>
|
||||
<runAllBuilders>true</runAllBuilders>
|
||||
</target>
|
||||
</buildTargets>
|
||||
</storageModule>
|
||||
</cproject>
|
||||
|
@ -5,7 +5,7 @@
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-16163395060831900" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="65496988555952" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
@ -16,7 +16,7 @@
|
||||
<provider copy-of="extension" id="org.eclipse.cdt.ui.UserLanguageSettingsProvider"/>
|
||||
<provider-reference id="org.eclipse.cdt.core.ReferencedProjectsLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider-reference id="org.eclipse.cdt.managedbuilder.core.MBSLanguageSettingsProvider" ref="shared-provider"/>
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="-3074061603538710" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<provider class="org.eclipse.cdt.managedbuilder.language.settings.providers.GCCBuiltinSpecsDetector" console="false" env-hash="45958858344554155" id="org.eclipse.cdt.managedbuilder.core.GCCBuiltinSpecsDetector" keep-relative-paths="false" name="CDT GCC Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD "${INPUTS}"" prefer-non-shared="true">
|
||||
<language-scope id="org.eclipse.cdt.core.gcc"/>
|
||||
<language-scope id="org.eclipse.cdt.core.g++"/>
|
||||
</provider>
|
||||
|
@ -1,7 +1,7 @@
|
||||
cmake_minimum_required(VERSION 2.8.12)
|
||||
cmake_minimum_required(VERSION 3.3)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake ${CMAKE_CURRENT_SOURCE_DIR}/sc-components/cmake)
|
||||
|
||||
include(cmake/GitFunctions.cmake)
|
||||
include(GitFunctions)
|
||||
get_branch_from_git()
|
||||
|
||||
### set the directory names of the submodules
|
||||
@ -13,10 +13,15 @@ set(GIT_SUBMODULE_DIR_sc-components .)
|
||||
set(GIT_SUBMODULE_BRANCH_sc-components ${GIT_BRANCH})
|
||||
|
||||
include(GNUInstallDirs)
|
||||
include(cmake/Submodules.cmake)
|
||||
include(Submodules)
|
||||
include(Conan)
|
||||
|
||||
#enable_testing()
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||
set(warnings "-Wall -Wextra -Werror")
|
||||
set(CMAKE_CXX_FLAG_RELEASE "-O2 -DNDEBUG")
|
||||
@ -27,6 +32,8 @@ elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
|
||||
set(warnings "/W4 /WX /EHsc")
|
||||
endif()
|
||||
|
||||
setup_conan()
|
||||
|
||||
# This line finds the boost lib and headers.
|
||||
set(Boost_NO_BOOST_CMAKE ON) # Don't do a find_package in config mode before searching for a regular boost install.
|
||||
find_package(Boost COMPONENTS program_options system thread REQUIRED)
|
||||
@ -36,16 +43,22 @@ find_package(SystemC)
|
||||
if(SystemC_FOUND)
|
||||
add_definitions(-DWITH_SYSTEMC)
|
||||
include_directories(${SystemC_INCLUDE_DIRS})
|
||||
link_directories(${SystemC_LIBRARY_DIRS}
|
||||
)
|
||||
link_directories(${SystemC_LIBRARY_DIRS})
|
||||
else()
|
||||
message( FATAL_ERROR "SystemC library not found." )
|
||||
endif()
|
||||
|
||||
if(CCI_FOUND)
|
||||
include_directories(${CCI_INCLUDE_DIRS})
|
||||
link_directories(${CCI_LIBRARY_DIRS})
|
||||
else()
|
||||
message( FATAL_ERROR "SystemC CCI library not found." )
|
||||
endif()
|
||||
|
||||
if(SCV_FOUND)
|
||||
add_definitions(-DWITH_SCV)
|
||||
link_directories(${SCV_LIBRARY_DIRS})
|
||||
endif(SCV_FOUND)
|
||||
endif()
|
||||
|
||||
set(PROJECT_3PARTY_DIRS external sr_report sr_signal)
|
||||
include(sc-components/cmake/clang-format.cmake)
|
||||
|
45
cmake/Conan.cmake
Normal file
45
cmake/Conan.cmake
Normal file
@ -0,0 +1,45 @@
|
||||
macro(setup_conan)
|
||||
find_program(conan conan)
|
||||
if(NOT EXISTS ${conan})
|
||||
message(FATAL_ERROR "Conan is required. Please see README.md")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(${CMAKE_HOST_SYSTEM_NAME} STREQUAL Darwin)
|
||||
set(os Macos)
|
||||
else()
|
||||
set(os ${CMAKE_HOST_SYSTEM_NAME})
|
||||
endif()
|
||||
|
||||
if(${CMAKE_CXX_COMPILER_ID} STREQUAL GNU)
|
||||
set(compiler gcc)
|
||||
elseif(${CMAKE_CXX_COMPILER_ID} STREQUAL AppleClang)
|
||||
set(compiler apple-clang)
|
||||
else()
|
||||
message(FATAL_ERROR "Unknown compiler: ${CMAKE_CXX_COMPILER_ID}")
|
||||
endif()
|
||||
|
||||
string(SUBSTRING ${CMAKE_CXX_COMPILER_VERSION} 0 3 compiler_version)
|
||||
|
||||
set(conanfile ${CMAKE_SOURCE_DIR}/conanfile.txt)
|
||||
set(conanfile_cmake ${CMAKE_BINARY_DIR}/conanbuildinfo.cmake)
|
||||
set(compiler_libcxx libstdc++11)
|
||||
|
||||
if("${CMAKE_BUILD_TYPE}" STREQUAL "")
|
||||
set(CONAN_BUILD_TYPE Debug)
|
||||
elseif("${CMAKE_BUILD_TYPE}" STREQUAL "RelWithDebInfo")
|
||||
set(CONAN_BUILD_TYPE Release)
|
||||
else()
|
||||
set(CONAN_BUILD_TYPE ${CMAKE_BUILD_TYPE})
|
||||
endif()
|
||||
|
||||
execute_process(COMMAND ${conan} install --build=missing
|
||||
-s build_type=${CONAN_BUILD_TYPE} -s compiler.libcxx=${compiler_libcxx}
|
||||
${CMAKE_SOURCE_DIR} RESULT_VARIABLE return_code)
|
||||
if(NOT ${return_code} EQUAL 0)
|
||||
message(FATAL_ERROR "conan install command failed.")
|
||||
endif()
|
||||
|
||||
include(${conanfile_cmake})
|
||||
conan_basic_setup(TARGETS)
|
||||
endmacro()
|
16
conanfile.txt
Normal file
16
conanfile.txt
Normal file
@ -0,0 +1,16 @@
|
||||
[requires]
|
||||
gsl_microsoft/20180102@bincrafters/stable
|
||||
spdlog/0.16.3@bincrafters/stable
|
||||
SystemC/2.3.2@minres/stable
|
||||
SystemCVerification/2.0.1@minres/stable
|
||||
SystemC-CCI/0.9.0@minres/stable
|
||||
|
||||
[generators]
|
||||
cmake
|
||||
txt
|
||||
|
||||
[options]
|
||||
SystemC:stdcxx=14
|
||||
SystemC:shared=True
|
||||
SystemCVerification:stdcxx=14
|
||||
SystemC-CCI:stdcxx=14
|
@ -1,7 +1,6 @@
|
||||
cmake_minimum_required (VERSION 2.8.12)
|
||||
cmake_minimum_required(VERSION 3.3)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/../cmake) # main (top) cmake dir
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/cmake) # project specific cmake dir
|
||||
set(CMAKE_CXX_STANDARD 11) # compromise, SystemC does not compile with C++14
|
||||
|
||||
project (sc-components)
|
||||
|
||||
@ -32,6 +31,7 @@ endif(ZLIB_FOUND)
|
||||
|
||||
if(SCV_FOUND)
|
||||
add_definitions(-DWITH_SCV)
|
||||
include_directories(${SCV_INCLUDE_DIRS})
|
||||
link_directories(${SCV_LIBRARY_DIRS})
|
||||
add_subdirectory(transaction_recording)
|
||||
endif(SCV_FOUND)
|
||||
|
@ -1,4 +1,4 @@
|
||||
cmake_minimum_required (VERSION 2.8.12)
|
||||
cmake_minimum_required(VERSION 3.3)
|
||||
# Add executable called "transaction_recording" that is built from the source files
|
||||
# "scv_tr_recording_example.cpp". The extensions are automatically found.
|
||||
add_executable (transaction_recording scv_tr_recording_example.cpp)
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit f1c733dc2caed17742feca32a275eb21d15a4c8d
|
||||
Subproject commit d4653d028cec23a4d2ab63f1c213ac627393c7cf
|
Loading…
Reference in New Issue
Block a user