Files
FEX-Emu--FEX/Source/Windows/CMakeLists.txt
T
Jacek Caban ec0a2a8671 Use -print-libgcc-file-name to get the compiler-rt file name
Avoid hardcoding the file name. Upstream Clang currently expects the aarch64 variant of
compiler-rt. Changing this to use arm64ec in the file name could be problematic in the future,
if the MinGW toolchain gains support for ARM64X. Querying Clang for the correct file name is
the most forward-compatible approach.
2025-05-16 11:24:57 +02:00

36 lines
1.1 KiB
CMake

function(build_implib name)
set(name_ex ${name}_ex)
add_custom_target(${name_ex}lib ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/lib${name_ex}.a)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lib${name_ex}.a
COMMAND ${CMAKE_DLLTOOL} -d ${CMAKE_CURRENT_SOURCE_DIR}/Defs/${name}.def -k -l lib${name_ex}.a
COMMENT "Building lib${name_ex}.a"
)
add_library(${name_ex} SHARED IMPORTED)
set_property(TARGET ${name_ex} PROPERTY IMPORTED_IMPLIB ${CMAKE_CURRENT_BINARY_DIR}/lib${name_ex}.a)
add_dependencies(${name_ex} ${name_ex}lib)
endfunction()
function(patch_library_wine target)
add_custom_command(
TARGET ${target} POST_BUILD
COMMAND dd bs=32 count=1 seek=2 conv=notrunc if=${CMAKE_SOURCE_DIR}/Source/Windows/wine_builtin.bin of=$<TARGET_FILE:${target}>
)
endfunction()
execute_process(COMMAND ${CMAKE_CXX_COMPILER} ${CMAKE_CXX_FLAGS} -print-libgcc-file-name
OUTPUT_VARIABLE LIBGCC_PATH
OUTPUT_STRIP_TRAILING_WHITESPACE)
build_implib(ntdll)
build_implib(wow64)
add_subdirectory(Common)
if (_M_ARM_64EC)
add_subdirectory(ARM64EC)
elseif (_M_ARM_64)
add_subdirectory(WOW64)
endif()