project(CemuAsm C) if (WIN32) enable_language(C ASM_MASM) add_library(CemuAsm x64util_masm.asm) set_source_files_properties(x64util_masm.asm PROPERTIES LANGUAGE ASM_MASM) # workaround for cr flag being passed to LINK.exe which considers it an input file and thus fails # doesn't always seem to happen. The Windows CI builds were fine, but locally I would run into this problem # possibly related to https://gitlab.kitware.com/cmake/cmake/-/issues/18889 set(CMAKE_ASM_MASM_CREATE_STATIC_LIBRARY " /OUT: ") else() # NASM if (APPLE) set(CMAKE_ASM_NASM_COMPILE_OBJECT " -g -Fdwarf -f macho64 --prefix _ -o ") else() set(CMAKE_ASM_NASM_COMPILE_OBJECT " -g -Fdwarf -f elf64 -o ") endif() set(CMAKE_ASM_NASM_LINK_EXECUTABLE "ld -fPIC -o ") enable_language(C ASM_NASM) add_library(CemuAsm x64util_nasm.asm) set_source_files_properties(x64util_nasm.asm PROPERTIES LANGUAGE ASM_NASM) if (APPLE) set_target_properties(CemuAsm PROPERTIES NASM_OBJ_FORMAT macho64) else() set_target_properties(CemuAsm PROPERTIES NASM_OBJ_FORMAT elf64) endif() set_target_properties(CemuAsm PROPERTIES LINKER_LANGUAGE C) endif() set_property(TARGET CemuAsm PROPERTY MSVC_RUNTIME_LIBRARY "MultiThreaded$<$:Debug>")