Skip to content

Commit b03cd23

Browse files
egorshamshuraderzhavin3016
authored andcommitted
[CMake] Added build-presets.
[Sim] Removed extra function call. [CMake] Fixed install. Fixed bundle install gems. [CMake] Fixed new line.
1 parent 41eb9b5 commit b03cd23

6 files changed

Lines changed: 26 additions & 2 deletions

File tree

CMakeLists.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@ cmake_minimum_required(VERSION 3.22 FATAL_ERROR)
22

33
project(protea)
44

5+
6+
if(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)
7+
set_property(CACHE CMAKE_INSTALL_PREFIX
8+
PROPERTY VALUE "${CMAKE_BINARY_DIR}/install")
9+
endif()
10+
511
find_package(Ruby 3.4.8 EXACT REQUIRED)
612

713
include(cmake/Bundler.cmake)

CMakePresets.json

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,5 +28,17 @@
2828
"CMAKE_BUILD_TYPE": "Debug"
2929
}
3030
}
31+
],
32+
"buildPresets": [
33+
{
34+
"name": "Default-Release",
35+
"description": "Build Release configuration",
36+
"configurePreset": "Default-Release"
37+
},
38+
{
39+
"name": "Default-Debug",
40+
"description": "Build Debug configuration",
41+
"configurePreset": "Default-Debug"
42+
}
3143
]
3244
}

ci-extra/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ cmake -S . \
55
--preset "${PRESET_NAME}" -G Ninja
66

77
# Build
8-
cmake --build "build/${PRESET_NAME}" -j
8+
cmake --build --preset ${PRESET_NAME} --target install --parallel 12

cmake/Bundler.cmake

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ if (NOT DEFINED BUNDLE_PATH)
22
set(BUNDLE_PATH "bundle")
33
endif()
44

5+
execute_process(
6+
COMMAND ${BUNDLE_PATH} config set --local path ${CMAKE_BINARY_DIR}/bundle
7+
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
8+
)
9+
510
execute_process(
611
COMMAND ${BUNDLE_PATH} install
712
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}

lib/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,4 @@ add_custom_command(
66
COMMENT "Running ${PROJECT_NAME}"
77
)
88
add_custom_target(${PROJECT_NAME} DEPENDS IR.yaml)
9+
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/IR.yaml DESTINATION share/)

sim_lib/base_jit.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void JitEngine::step(CPU &cpu) {
3737
if (isa::isTerminator(inst->m_opc)) {
3838
break;
3939
}
40-
curAddr += getILen(inst->m_opc);
40+
curAddr += sizeof(isa::Word);
4141
}
4242
} else if (bbIt->second.num_exec >= kExecThreshold) [[likely]] {
4343
auto code = translate(bbIt->second);

0 commit comments

Comments
 (0)