cmake: refactor the architecture detection

This commit is contained in:
David Hrdlička
2021-08-29 03:37:07 +02:00
parent b9e07113ca
commit 44ccefb28a
6 changed files with 45 additions and 157 deletions

View File

@@ -16,16 +16,15 @@
if(DYNAREC)
add_library(dynarec OBJECT codegen.c codegen_ops.c)
if(CMAKE_TARGET_ARCHITECTURES STREQUAL "i386")
if(ARCH STREQUAL "i386")
target_sources(dynarec PRIVATE codegen_x86.c
codegen_accumulate_x86.c)
elseif(CMAKE_TARGET_ARCHITECTURES STREQUAL "x86_64")
elseif(ARCH STREQUAL "x86_64")
target_sources(dynarec PRIVATE codegen_x86-64.c
codegen_accumulate_x86-64.c)
else()
message(SEND_ERROR
"Dynarec is incompatible with target platform "
${CMAKE_TARGET_ARCHITECTURES})
"Dynarec is incompatible with target platform ${ARCH}")
endif()
target_link_libraries(86Box dynarec cgt)