mirror of
https://github.com/dingusdev/dingusppc.git
synced 2025-01-21 23:29:51 +00:00
Clean up build scripts.
This commit is contained in:
parent
101a8d33b0
commit
0118b347f3
@ -83,13 +83,6 @@ add_subdirectory("${PROJECT_SOURCE_DIR}/machines/")
|
||||
add_subdirectory("${PROJECT_SOURCE_DIR}/utils/")
|
||||
add_subdirectory("${PROJECT_SOURCE_DIR}/thirdparty/loguru/")
|
||||
|
||||
#set(BUILD_EXAMPLE_PROGRAMS OFF CACHE BOOL "Build libsoundio example programs")
|
||||
#set(BUILD_TESTS OFF CACHE BOOL "Build libsoundio tests")
|
||||
#set(BUILD_DYNAMIC_LIBS ON CACHE BOOL "Build libsoundio dynamic libs")
|
||||
#set(BUILD_STATIC_LIBS ON CACHE BOOL "Build libsoundio static libs")
|
||||
|
||||
#add_subdirectory("${PROJECT_SOURCE_DIR}/thirdparty/libsoundio")
|
||||
|
||||
set(BUILD_TESTS OFF CACHE BOOL "Build Cubeb tests")
|
||||
set(BUILD_SHARED_LIBS OFF CACHE BOOL "Build shared libraries")
|
||||
set(BUILD_TOOLS OFF CACHE BOOL "Build Cubeb tools")
|
||||
@ -107,15 +100,12 @@ include_directories("${PROJECT_SOURCE_DIR}"
|
||||
"${PROJECT_SOURCE_DIR}/thirdparty/loguru/"
|
||||
"${PROJECT_SOURCE_DIR}/thirdparty/CLI11/"
|
||||
"${PROJECT_SOURCE_DIR}/thirdparty/cubeb/include")
|
||||
# ${LIBSOUNDIO_HEADERS})
|
||||
|
||||
file(GLOB SOURCES "${PROJECT_SOURCE_DIR}/*.cpp"
|
||||
"${PROJECT_SOURCE_DIR}/*.c"
|
||||
"${PROJECT_SOURCE_DIR}/*.hpp"
|
||||
"${PROJECT_SOURCE_DIR}/*.h")
|
||||
|
||||
#get_directory_property(LIBSOUNDIO_LIBS DIRECTORY thirdparty/libsoundio DEFINITION LIBSOUNDIO_LIBS)
|
||||
|
||||
file(GLOB TEST_SOURCES "${PROJECT_SOURCE_DIR}/cpu/ppc/test/*.cpp")
|
||||
|
||||
add_executable(dingusppc ${SOURCES} $<TARGET_OBJECTS:core>
|
||||
@ -127,15 +117,14 @@ add_executable(dingusppc ${SOURCES} $<TARGET_OBJECTS:core>
|
||||
$<TARGET_OBJECTS:loguru>)
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries(dingusppc PRIVATE SDL2::SDL2 SDL2::SDL2main cubeb)
|
||||
target_link_libraries(dingusppc PRIVATE SDL2::SDL2 SDL2::SDL2main cubeb)
|
||||
else()
|
||||
#target_link_libraries(dingusppc libsoundio_static ${LIBSOUNDIO_LIBS} ${SDL2_LIBRARIES})
|
||||
target_link_libraries(dingusppc cubeb ${SDL2_LIBRARIES} ${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
||||
target_include_directories(dingusppc PRIVATE ${CLI11_ROOT})
|
||||
target_link_libraries(dingusppc PRIVATE SDL2::SDL2 SDL2::SDL2main cubeb
|
||||
${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif()
|
||||
|
||||
if (DPPC_68K_DEBUGGER)
|
||||
target_link_libraries(dingusppc capstone)
|
||||
target_link_libraries(dingusppc PRIVATE capstone)
|
||||
endif()
|
||||
|
||||
if (DPPC_BUILD_PPC_TESTS)
|
||||
@ -148,15 +137,14 @@ if (DPPC_BUILD_PPC_TESTS)
|
||||
$<TARGET_OBJECTS:loguru>)
|
||||
|
||||
if (WIN32)
|
||||
target_link_libraries(testppc SDL2::SDL2 SDL2::SDL2main cubeb)
|
||||
target_link_libraries(testppc PRIVATE SDL2::SDL2 SDL2::SDL2main cubeb)
|
||||
else()
|
||||
#target_link_libraries(testppc libsoundio_static ${LIBSOUNDIO_LIBS} ${SDL2_LIBRARIES})
|
||||
target_link_libraries(testppc cubeb ${SDL2_LIBRARIES} ${CMAKE_DL_LIBS}
|
||||
${CMAKE_THREAD_LIBS_INIT})
|
||||
target_link_libraries(testppc PRIVATE SDL2::SDL2 SDL2::SDL2main cubeb
|
||||
${CMAKE_DL_LIBS} ${CMAKE_THREAD_LIBS_INIT})
|
||||
endif()
|
||||
|
||||
if (DPPC_68K_DEBUGGER)
|
||||
target_link_libraries(testppc capstone-static)
|
||||
target_link_libraries(testppc PRIVATE capstone)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
@ -170,11 +158,11 @@ if (DPPC_BUILD_BENCHMARKS)
|
||||
$<TARGET_OBJECTS:utils>
|
||||
$<TARGET_OBJECTS:loguru>)
|
||||
|
||||
target_link_libraries(bench1 cubeb ${SDL2_LIBRARIES} ${CMAKE_DL_LIBS}
|
||||
target_link_libraries(bench1 PRIVATE cubeb SDL2::SDL2 SDL2::SDL2main ${CMAKE_DL_LIBS}
|
||||
${CMAKE_THREAD_LIBS_INIT})
|
||||
|
||||
if (DPPC_68K_DEBUGGER)
|
||||
target_link_libraries(bench1 capstone-static)
|
||||
target_link_libraries(bench1 PRIVATE capstone)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
@ -23,7 +23,7 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
#include <chrono>
|
||||
#include "cpu/ppc/ppcemu.h"
|
||||
#include "cpu/ppc/ppcmmu.h"
|
||||
#include "devices/mpc106.h"
|
||||
#include "devices/memctrl/mpc106.h"
|
||||
#include <thirdparty/loguru/loguru.hpp>
|
||||
|
||||
uint32_t cs_code[] = {
|
||||
@ -59,17 +59,19 @@ int main(int argc, char** argv) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
ppc_cpu_init(grackle_obj, PPC_VER::MPC750);
|
||||
constexpr uint64_t tbr_freq = 16705000;
|
||||
|
||||
ppc_cpu_init(grackle_obj, PPC_VER::MPC750, tbr_freq);
|
||||
|
||||
/* load executable code into RAM at address 0 */
|
||||
for (i = 0; i < sizeof(cs_code); i++) {
|
||||
mem_write_dword(i*4, cs_code[i]);
|
||||
mmu_write_vmem<uint32_t>(i*4, cs_code[i]);
|
||||
}
|
||||
|
||||
srand(0xCAFEBABE);
|
||||
|
||||
for (i = 0; i < 32768; i++) {
|
||||
mem_write_byte(0x1000+i, rand() % 256);
|
||||
mmu_write_vmem<uint8_t>(0x1000+i, rand() % 256);
|
||||
}
|
||||
|
||||
/* prepare benchmark code execution */
|
||||
|
Loading…
x
Reference in New Issue
Block a user