Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,14 @@ set(CMAKE_CXX_VISIBILITY_PRESET hidden)
set(CMAKE_VISIBILITY_INLINES_HIDDEN On)

option(CLOCK_SPEED_MHZ "The clock speed for the processor")
option(BUILD_PROFILER "Build profiling for the instruction handlers")

add_subdirectory(emulator)
add_subdirectory(emulator_app)

if (BUILD_PROFILER)
add_subdirectory(profiler)
endif()

enable_testing()
add_subdirectory(tests)
6 changes: 4 additions & 2 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,8 @@
"binaryDir": "${sourceDir}/build/unix-rel-ninja",
"inherits": ["unix-ninja", "rel", "conan-rel"],
"cacheVariables": {
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/unix-rel-ninja/install"
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/unix-rel-ninja/install",
"BUILD_PROFILER": true
}
},
{
Expand Down Expand Up @@ -130,7 +131,8 @@
"cacheVariables": {
"CMAKE_CXX_FLAGS": "-O0 --coverage -g -fsanitize=address",
"CMAKE_INSTALL_PREFIX": "${sourceDir}/build/unix-deb-ninja/install",
"CLOCK_SPEED_MHZ": "3.58"
"CLOCK_SPEED_MHZ": "3.58",
"BUILD_PROFILER": true
}
},
{
Expand Down
2 changes: 1 addition & 1 deletion conanfile.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[requires]
fmt/11.0.2
gtest/1.13.0
fmt/10.2.1
raylib/5.0

[generators]
Expand Down
10 changes: 9 additions & 1 deletion emulator/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

find_package(fmt REQUIRED)

add_library(emulator)
Expand All @@ -14,3 +13,12 @@ if (CLOCK_SPEED_MHZ)
endif()

target_link_libraries(emulator PRIVATE fmt::fmt)
if(BUILD_PROFILER)
message(STATUS "Building profiler")
target_link_libraries(emulator PRIVATE profiler)
target_compile_definitions(emulator PRIVATE BUILD_PROFILER=)
else()
message(STATUS "Profiler not build")
endif()

target_link_libraries(emulator PRIVATE fmt::fmt)
Loading