Error is.. well, an error. Unlike std::error_code, or etc, we use a string so that code can attach its own context. It's not perfect, but it's better than error categories, and that's good enough. A early idea for the api of kvm::VM is provided, but I'm not attached to it.
28 lines
1.0 KiB
CMake
28 lines
1.0 KiB
CMake
function(tv2hv_target target)
|
|
target_compile_definitions(${target} PRIVATE "$<$<CONFIG:DEBUG>:TV2HV_DEBUG>")
|
|
#target_include_directories(${target} PRIVATE ${PROJECT_SOURCE_DIR})
|
|
target_compile_features(${target} PRIVATE cxx_std_23)
|
|
target_include_directories(${target} PRIVATE ${PROJECT_SOURCE_DIR}/src ${CMAKE_CURRENT_BINARY_DIR})
|
|
endfunction()
|
|
|
|
function(_tv2hv_set_alternate_linker)
|
|
find_program(LINKER_EXECUTABLE ld.${TV2HV_LINKER} ${TV2HV_LINKER})
|
|
if(LINKER_EXECUTABLE)
|
|
message(STATUS "Using ${TV2HV_LINKER} as linker")
|
|
else()
|
|
message(FATAL_ERROR "Linker ${TV2HV_LINKER} does not exist on your system. Please specify one which does or omit this option from your configure command.")
|
|
endif()
|
|
endfunction()
|
|
|
|
|
|
# Set a default linker if the user never provided one.
|
|
# This defaults based on the detected compiler to the "best" linker possible
|
|
if(NOT TV2HV_LINKER AND "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
|
set(TV2HV_LINKER "lld")
|
|
elseif(NOT TV2HV_LINKER)
|
|
set(TV2HV_LINKER "bfd")
|
|
endif()
|
|
|
|
# Do the magic
|
|
_tv2hv_set_alternate_linker()
|