Refactor CMakeLists and GitLab CI/CD pipeline
- Remove nested minimum required to supress warnings. - Declare SystemC as system library to supress warnings in headers. - Add a BUILD_SHARED_LIBS option - Remove hardcoded STATIC in various add_library calls to honor the BUILD_SHARED_LIBS option - Remove _deps/ directory from the build directory in GitLab pipeline - Remove *.tdb files after test stage in pipeline - Set Ninja as the default generator for the dev preset and re-enable colored diagnostics
This commit is contained in:
@@ -14,6 +14,7 @@ build:
|
|||||||
after_script:
|
after_script:
|
||||||
- find . -name "*.o" -type f -delete
|
- find . -name "*.o" -type f -delete
|
||||||
- find . -name "*.a" -type f -delete
|
- find . -name "*.a" -type f -delete
|
||||||
|
- rm -r build/coverage/_deps
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- build/coverage
|
- build/coverage
|
||||||
@@ -26,6 +27,8 @@ test:
|
|||||||
script:
|
script:
|
||||||
- cd build/coverage
|
- cd build/coverage
|
||||||
- ctest --output-on-failure -j$(nproc)
|
- ctest --output-on-failure -j$(nproc)
|
||||||
|
after_script:
|
||||||
|
- find . -name "*.tdb" -type f -delete
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
- build/coverage
|
- build/coverage
|
||||||
|
|||||||
@@ -89,6 +89,8 @@ set(DRAMSYS_RESOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/configs")
|
|||||||
set(DRAMSYS_EXTENSIONS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extensions")
|
set(DRAMSYS_EXTENSIONS_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extensions")
|
||||||
|
|
||||||
### Build options ###
|
### Build options ###
|
||||||
|
option(BUILD_SHARED_LIBS "Build shared libraries" OFF)
|
||||||
|
|
||||||
option(DRAMSYS_BUILD_TESTS "Build DRAMSys unit tests" OFF)
|
option(DRAMSYS_BUILD_TESTS "Build DRAMSys unit tests" OFF)
|
||||||
option(DRAMSYS_BUILD_BENCHMARKS "Build DRAMSys benchmarks" OFF)
|
option(DRAMSYS_BUILD_BENCHMARKS "Build DRAMSys benchmarks" OFF)
|
||||||
option(DRAMSYS_VERBOSE_CMAKE_OUTPUT "Show detailed CMake output" OFF)
|
option(DRAMSYS_VERBOSE_CMAKE_OUTPUT "Show detailed CMake output" OFF)
|
||||||
@@ -156,6 +158,9 @@ if (NOT TARGET SystemC::systemc)
|
|||||||
FetchContent_MakeAvailable(systemc)
|
FetchContent_MakeAvailable(systemc)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
# Set include directories to SYSTEM to suppress warnings
|
||||||
|
set_target_properties(systemc PROPERTIES SYSTEM TRUE)
|
||||||
|
|
||||||
### DRAMPower ###
|
### DRAMPower ###
|
||||||
if (DRAMSYS_WITH_DRAMPOWER)
|
if (DRAMSYS_WITH_DRAMPOWER)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "dev",
|
"name": "dev",
|
||||||
"generator": "Unix Makefiles",
|
"generator": "Ninja",
|
||||||
"binaryDir": "${sourceDir}/build",
|
"binaryDir": "${sourceDir}/build",
|
||||||
"inherits": [
|
"inherits": [
|
||||||
"dev-mode",
|
"dev-mode",
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
],
|
],
|
||||||
"cacheVariables": {
|
"cacheVariables": {
|
||||||
"CMAKE_BUILD_TYPE": "Debug",
|
"CMAKE_BUILD_TYPE": "Debug",
|
||||||
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic"
|
"CMAKE_CXX_FLAGS": "-Wall -Wextra -Wpedantic -fdiagnostics-color=always"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -35,8 +35,6 @@
|
|||||||
### benches_dramsys ###
|
### benches_dramsys ###
|
||||||
###############################################
|
###############################################
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.1.0)
|
|
||||||
|
|
||||||
project(benches_dramsys)
|
project(benches_dramsys)
|
||||||
|
|
||||||
add_executable(${PROJECT_NAME}
|
add_executable(${PROJECT_NAME}
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ project(DRAMSys_Configuration)
|
|||||||
file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS *.cpp)
|
file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS *.cpp)
|
||||||
file(GLOB_RECURSE HEADER_FILES CONFIGURE_DEPENDS *.h;*.hpp)
|
file(GLOB_RECURSE HEADER_FILES CONFIGURE_DEPENDS *.h;*.hpp)
|
||||||
|
|
||||||
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES} ${HEADER_FILES})
|
add_library(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES})
|
||||||
|
|
||||||
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ project(DRAMSys_libdramsys)
|
|||||||
file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS *.cpp)
|
file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS *.cpp)
|
||||||
file(GLOB_RECURSE HEADER_FILES CONFIGURE_DEPENDS *.h;*.hpp)
|
file(GLOB_RECURSE HEADER_FILES CONFIGURE_DEPENDS *.h;*.hpp)
|
||||||
|
|
||||||
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES} ${HEADER_FILES})
|
add_library(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES})
|
||||||
|
|
||||||
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ file(GLOB_RECURSE HEADER_FILES CONFIGURE_DEPENDS *.h;*.hpp)
|
|||||||
|
|
||||||
list(FILTER SOURCE_FILES EXCLUDE REGEX "main.cpp")
|
list(FILTER SOURCE_FILES EXCLUDE REGEX "main.cpp")
|
||||||
|
|
||||||
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES} ${HEADER_FILES})
|
add_library(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES})
|
||||||
|
|
||||||
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ project(DRAMSys_Util)
|
|||||||
file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS *.cpp)
|
file(GLOB_RECURSE SOURCE_FILES CONFIGURE_DEPENDS *.cpp)
|
||||||
file(GLOB_RECURSE HEADER_FILES CONFIGURE_DEPENDS *.h;*.hpp)
|
file(GLOB_RECURSE HEADER_FILES CONFIGURE_DEPENDS *.h;*.hpp)
|
||||||
|
|
||||||
add_library(${PROJECT_NAME} STATIC ${SOURCE_FILES} ${HEADER_FILES})
|
add_library(${PROJECT_NAME} ${SOURCE_FILES} ${HEADER_FILES})
|
||||||
|
|
||||||
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
target_include_directories(${PROJECT_NAME} PUBLIC ${CMAKE_CURRENT_SOURCE_DIR})
|
||||||
|
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
### tests_configuration ###
|
### tests_configuration ###
|
||||||
###############################################
|
###############################################
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.1.0)
|
|
||||||
|
|
||||||
project(tests_configuration)
|
project(tests_configuration)
|
||||||
|
|
||||||
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/test_configuration.cpp)
|
add_executable(${PROJECT_NAME} ${CMAKE_CURRENT_SOURCE_DIR}/test_configuration.cpp)
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
### tests_dramsys ###
|
### tests_dramsys ###
|
||||||
###############################################
|
###############################################
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.1.0)
|
|
||||||
|
|
||||||
project(tests_dramsys)
|
project(tests_dramsys)
|
||||||
|
|
||||||
file(GLOB_RECURSE SOURCE_FILES *.cpp)
|
file(GLOB_RECURSE SOURCE_FILES *.cpp)
|
||||||
|
|||||||
@@ -35,8 +35,6 @@
|
|||||||
### tests_regression ###
|
### tests_regression ###
|
||||||
###############################################
|
###############################################
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.1.0)
|
|
||||||
|
|
||||||
project(tests_regression)
|
project(tests_regression)
|
||||||
|
|
||||||
find_program(SqlDiff sqldiff)
|
find_program(SqlDiff sqldiff)
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
### tests_simulator ###
|
### tests_simulator ###
|
||||||
###############################################
|
###############################################
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.1.0)
|
|
||||||
|
|
||||||
project(tests_simulator)
|
project(tests_simulator)
|
||||||
|
|
||||||
add_executable(${PROJECT_NAME}
|
add_executable(${PROJECT_NAME}
|
||||||
|
|||||||
@@ -2,8 +2,6 @@
|
|||||||
### tests_util ###
|
### tests_util ###
|
||||||
###############################################
|
###############################################
|
||||||
|
|
||||||
cmake_minimum_required(VERSION 3.1.0)
|
|
||||||
|
|
||||||
project(tests_util)
|
project(tests_util)
|
||||||
|
|
||||||
file(GLOB_RECURSE SOURCE_FILES *.cpp)
|
file(GLOB_RECURSE SOURCE_FILES *.cpp)
|
||||||
|
|||||||
Reference in New Issue
Block a user