From e44ac5b84cbb428105ab9d7a60cadd6ed6ff1ae4 Mon Sep 17 00:00:00 2001 From: Merry Date: Sat, 17 Jul 2021 21:18:01 +0100 Subject: [PATCH] CMakeLists: Allow building on arm64 --- src/dynarmic/CMakeLists.txt | 12 ++++++++---- tests/CMakeLists.txt | 25 +++++++++++++++--------- tests/{cpu_info.cpp => x64_cpu_info.cpp} | 0 3 files changed, 24 insertions(+), 13 deletions(-) rename tests/{cpu_info.cpp => x64_cpu_info.cpp} (100%) diff --git a/src/dynarmic/CMakeLists.txt b/src/dynarmic/CMakeLists.txt index 6fc5a8cf..82d73f60 100644 --- a/src/dynarmic/CMakeLists.txt +++ b/src/dynarmic/CMakeLists.txt @@ -55,8 +55,6 @@ add_library(dynarmic common/u128.cpp common/u128.h common/variant_util.h - common/x64_disassemble.cpp - common/x64_disassemble.h frontend/A32/a32_types.cpp frontend/A32/a32_types.h frontend/A64/a64_types.cpp @@ -257,6 +255,12 @@ if ("A64" IN_LIST DYNARMIC_FRONTENDS) endif() if (ARCHITECTURE STREQUAL "x86_64") + target_link_libraries(dynarmic + PRIVATE + $ + $ + ) + target_sources(dynarmic PRIVATE backend/x64/abi.cpp backend/x64/abi.h @@ -300,6 +304,8 @@ if (ARCHITECTURE STREQUAL "x86_64") backend/x64/stack_layout.h common/spin_lock_x64.cpp common/spin_lock_x64.h + common/x64_disassemble.cpp + common/x64_disassemble.h ) if ("A32" IN_LIST DYNARMIC_FRONTENDS) @@ -383,8 +389,6 @@ target_link_libraries(dynarmic $ $ tsl::robin_map - $ - $ "$<$:${llvm_libs}>" ) if (DYNARMIC_ENABLE_CPU_FEATURE_DETECTION) diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 94be83e2..9bf28da7 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -9,7 +9,6 @@ add_executable(dynarmic_tests A32/testenv.h A64/a64.cpp A64/testenv.h - cpu_info.cpp decoder_tests.cpp fp/FPToFixed.cpp fp/FPValue.cpp @@ -19,13 +18,6 @@ add_executable(dynarmic_tests rand_int.h ) -if (NOT MSVC) - target_sources(dynarmic_tests PRIVATE - rsqrt_test.cpp - rsqrt_test_fn.s - ) -endif() - if (DYNARMIC_TESTS_USE_UNICORN) target_sources(dynarmic_tests PRIVATE A32/fuzz_arm.cpp @@ -43,6 +35,21 @@ if (DYNARMIC_TESTS_USE_UNICORN) target_link_libraries(dynarmic_tests PRIVATE Unicorn::Unicorn) endif() +if (ARCHITECTURE STREQUAL "x86_64") + target_link_libraries(dynarmic_tests PRIVATE xbyak) + + target_sources(dynarmic_tests PRIVATE + x64_cpu_info.cpp + ) + + if (NOT MSVC) + target_sources(dynarmic_tests PRIVATE + rsqrt_test.cpp + rsqrt_test_fn.s + ) + endif() +endif() + add_executable(dynarmic_print_info print_info.cpp ) @@ -51,7 +58,7 @@ include(CreateDirectoryGroups) create_target_directory_groups(dynarmic_tests) create_target_directory_groups(dynarmic_print_info) -target_link_libraries(dynarmic_tests PRIVATE dynarmic boost catch fmt xbyak) +target_link_libraries(dynarmic_tests PRIVATE dynarmic boost catch fmt) target_include_directories(dynarmic_tests PRIVATE . ../src) target_compile_options(dynarmic_tests PRIVATE ${DYNARMIC_CXX_FLAGS}) target_compile_definitions(dynarmic_tests PRIVATE FMT_USE_USER_DEFINED_LITERALS=1 CATCH_CONFIG_ENABLE_BENCHMARKING=1) diff --git a/tests/cpu_info.cpp b/tests/x64_cpu_info.cpp similarity index 100% rename from tests/cpu_info.cpp rename to tests/x64_cpu_info.cpp