updates CMakeLists.txt and adds build config

This commit is contained in:
Eyck Jentzsch 2025-03-14 08:52:46 +01:00
parent 140c2d67b1
commit 5d78cdf4df
2 changed files with 72 additions and 6 deletions

View File

@ -128,7 +128,7 @@
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.base.1336041151.1605951382" name="RelWithDebInfo" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=" parent="org.eclipse.cdt.build.core.emptycfg">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.base.1336041151.1605951382" name="RelWithDebInfo" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="cdt.managedbuild.toolchain.gnu.base.1336041151.1605951382." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.base.1009994445" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.GNU_ELF" id="cdt.managedbuild.target.gnu.platform.base.1023431687" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
@ -175,6 +175,65 @@
</defs>
</storageModule>
</cconfiguration>
<cconfiguration id="cdt.managedbuild.toolchain.gnu.base.1336041151.1605951382.761803221">
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="cdt.managedbuild.toolchain.gnu.base.1336041151.1605951382.761803221" moduleId="org.eclipse.cdt.core.settings" name="RelWithDebInfo4Prof">
<externalSettings/>
<extensions>
<extension id="org.eclipse.cdt.core.GNU_ELF" point="org.eclipse.cdt.core.BinaryParser"/>
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
</extensions>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<configuration artifactName="${ProjName}" buildProperties="" description="" id="cdt.managedbuild.toolchain.gnu.base.1336041151.1605951382.761803221" name="RelWithDebInfo4Prof" optionalBuildProperties="org.eclipse.cdt.docker.launcher.containerbuild.property.selectedvolumes=,org.eclipse.cdt.docker.launcher.containerbuild.property.volumes=" parent="org.eclipse.cdt.build.core.emptycfg">
<folderInfo id="cdt.managedbuild.toolchain.gnu.base.1336041151.1605951382.761803221." name="/" resourcePath="">
<toolChain id="cdt.managedbuild.toolchain.gnu.base.1676282966" name="Linux GCC" superClass="cdt.managedbuild.toolchain.gnu.base">
<targetPlatform archList="all" binaryParser="org.eclipse.cdt.core.GNU_ELF" id="cdt.managedbuild.target.gnu.platform.base.199403809" name="Debug Platform" osList="linux,hpux,aix,qnx" superClass="cdt.managedbuild.target.gnu.platform.base"/>
<builder buildPath="/TGC-ISS/_build/Debug" id="cmake4eclipse.mbs.builder.1047317958" keepEnvironmentInBuildfile="false" name="CMake Builder" parallelBuildOn="true" parallelizationNumber="unlimited" superClass="cmake4eclipse.mbs.builder"/>
<tool id="cdt.managedbuild.tool.gnu.archiver.base.1763962491" name="GCC Archiver" superClass="cdt.managedbuild.tool.gnu.archiver.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.compiler.base.300429051" name="GCC C++ Compiler" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.base">
<option IS_BUILTIN_EMPTY="false" IS_VALUE_EMPTY="false" id="gnu.cpp.compiler.option.preprocessor.def.934487129" name="Defined symbols (-D)" superClass="gnu.cpp.compiler.option.preprocessor.def" useByScannerDiscovery="false" valueType="definedSymbols">
<listOptionValue builtIn="false" value="CWR_SYSTEMC=1"/>
</option>
<inputType id="cdt.managedbuild.tool.gnu.cpp.compiler.input.1430696020" superClass="cdt.managedbuild.tool.gnu.cpp.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.compiler.base.9511508" name="GCC C Compiler" superClass="cdt.managedbuild.tool.gnu.c.compiler.base">
<inputType id="cdt.managedbuild.tool.gnu.c.compiler.input.695529941" superClass="cdt.managedbuild.tool.gnu.c.compiler.input"/>
</tool>
<tool id="cdt.managedbuild.tool.gnu.c.linker.base.1813114373" name="GCC C Linker" superClass="cdt.managedbuild.tool.gnu.c.linker.base"/>
<tool id="cdt.managedbuild.tool.gnu.cpp.linker.base.1557756316" name="GCC C++ Linker" superClass="cdt.managedbuild.tool.gnu.cpp.linker.base">
<inputType id="cdt.managedbuild.tool.gnu.cpp.linker.input.536309197" superClass="cdt.managedbuild.tool.gnu.cpp.linker.input">
<additionalInput kind="additionalinputdependency" paths="$(USER_OBJS)"/>
<additionalInput kind="additionalinput" paths="$(LIBS)"/>
</inputType>
</tool>
<tool id="cdt.managedbuild.tool.gnu.assembler.base.587229911" name="GCC Assembler" superClass="cdt.managedbuild.tool.gnu.assembler.base">
<inputType id="cdt.managedbuild.tool.gnu.assembler.input.1060210827" superClass="cdt.managedbuild.tool.gnu.assembler.input"/>
</tool>
</toolChain>
</folderInfo>
</configuration>
</storageModule>
<storageModule moduleId="org.eclipse.cdt.core.externalSettings"/>
<storageModule buildDir="build/${ConfigName}" moduleId="de.marw.cdt.cmake.core.settings">
<options/>
<defs>
<def name="CMAKE_BUILD_TYPE" type="STRING" val="${ConfigName}"/>
</defs>
</storageModule>
<storageModule buildDir="build/${ConfigName}" dirtyTs="1727093289061" moduleId="de.marw.cmake4eclipse.mbs.settings">
<options/>
<defs>
<def name="CMAKE_BUILD_TYPE" type="STRING" val="RelWithDebInfo"/>
<def name="CMAKE_INSTALL_PREFIX" type="FILEPATH" val="${ProjDirPath}/install"/>
<def name="WITH_TCC" type="BOOL" val="ON"/>
<def name="FW_BUILD" type="BOOL" val="ON"/>
<def name="ENABLE_CLANG_TIDY" type="BOOL" val="ON"/>
<def name="ENABLE_GPROF" type="BOOL" val="ON"/>
</defs>
</storageModule>
</cconfiguration>
</storageModule>
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
<project id="TGC-ISS.null.449389099" name="TGC-ISS"/>

View File

@ -11,6 +11,7 @@ if(CMAKE_PROJECT_NAME STREQUAL "TGC-ISS")
set(CORE_NAME TGC5C CACHE STRING "The core to build the ISS for" )
option(BUILD_COMMON_FW "Enable the automatic download and build of some firmware to run on the ISS" OFF)
option(ENABLE_SANITIZER "Enable address sanitizer" OFF)
option(ENABLE_GRPOF "Enable gprof instrumentation" OFF)
option(ENABLE_CLANG_TIDY "Add clang-tidy and clang-format automatically to builds" OFF)
option(WITH_TCC "Build TCC backend" OFF)
option(WITH_LLVM "Build LLVM backend" OFF)
@ -40,10 +41,16 @@ if(CMAKE_PROJECT_NAME STREQUAL "TGC-ISS")
set(warnings "/W4 /WX /EHsc")
endif()
if(ENABLE_SANITIZER)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fsanitize=address")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fsanitize=address")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fsanitize=address")
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -fsanitize=address")
list(APPEND CMAKE_C_FLAGS "-fsanitize=address")
list(APPEND CMAKE_CXX_FLAGS "-fsanitize=address")
list(APPEND CMAKE_EXE_LINKER_FLAGS "-fsanitize=address")
list(APPEND CMAKE_SHARED_LINKER_FLAGS "-fsanitize=address")
endif()
if(ENABLE_GPROF)
list(APPEND CMAKE_C_FLAGS "-pg")
list(APPEND CMAKE_CXX_FLAGS "-pg")
list(APPEND CMAKE_EXE_LINKER_FLAGS "-pg")
list(APPEND CMAKE_SHARED_LINKER_FLAGS "-pg")
endif()
include(GNUInstallDirs)
include(ConanInline)
@ -213,7 +220,7 @@ if(CMAKE_PROJECT_NAME STREQUAL "TGC-ISS")
FetchContent_Declare(
riscvfw
GIT_REPOSITORY https://git.minres.com/Firmware/Firmwares.git
GIT_TAG main
GIT_TAG develop
GIT_SHALLOW OFF
UPDATE_DISCONNECTED ON
)