1cmake_minimum_required(VERSION 3.12) 2 3project (renode-cores LANGUAGES C) 4 5add_subdirectory(tlib) 6 7# Add Renode sources to tlib target so that they get built as part of it 8 9if(NOT TARGET_ACTUAL_ARCH) 10 message(FATAL_ERROR "TARGET_ACTUAL_ARCH has to be set by tlib CMakeLists.txt!") 11endif() 12 13file (GLOB RENODE_SOURCES 14 "renode/*.c" 15 "renode/arch/${TARGET_ACTUAL_ARCH}/*.c" 16) 17 18target_sources(tlib PRIVATE 19 ${RENODE_SOURCES} 20) 21 22# Include directories with Renode headers when building tlib 23 24target_include_directories(tlib PRIVATE 25 renode/include 26) 27 28# Set tlib output filename 29 30set (ENDIAN_STR "le") 31if (TARGET_WORDS_BIGENDIAN) 32 set (ENDIAN_STR "be") 33endif() 34 35set_target_properties(tlib PROPERTIES 36 PREFIX "" 37 OUTPUT_NAME "translate-${TARGET_ARCH}-${ENDIAN_STR}" 38 SUFFIX ".so" 39) 40