fix_w3264_masm.patch 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. diff --git a/configure_options.cmake b/configure_options.cmake
  2. index 849231c..ceb6539 100644
  3. --- a/configure_options.cmake
  4. +++ b/configure_options.cmake
  5. @@ -79,6 +79,7 @@ elseif(TARGET_PLATFORM STREQUAL X86_64)
  6. elseif(TARGET_PLATFORM MATCHES X86.*)
  7. if(MSVC)
  8. list(APPEND WIN_ASSEMBLY_LIST src/x86/sysv_intel.S)
  9. + set (CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
  10. enable_language(ASM_MASM)
  11. else()
  12. list(APPEND SOURCES_LIST src/x86/sysv.S)
  13. @@ -329,13 +330,17 @@ foreach(ASM_PATH IN LISTS WIN_ASSEMBLY_LIST)
  14. set_source_files_properties("${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm" PROPERTIES GENERATED TRUE)
  15. - add_custom_command(
  16. - COMMAND "${CMAKE_ASM_MASM_COMPILER}" /Fo "${CMAKE_CURRENT_BINARY_DIR}/${ASM_FILENAME}.obj" "${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm"
  17. - DEPENDS ${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm
  18. - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ASM_FILENAME}.obj
  19. - COMMENT "Assembling ${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm")
  20. + if(TARGET_PLATFORM MATCHES X86.*)
  21. + list(APPEND SOURCES_LIST ${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm)
  22. + else()
  23. + add_custom_command(
  24. + COMMAND "${CMAKE_ASM_MASM_COMPILER}" /Fo "${CMAKE_CURRENT_BINARY_DIR}/${ASM_FILENAME}.obj" "${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm"
  25. + DEPENDS ${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm
  26. + OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${ASM_FILENAME}.obj
  27. + COMMENT "Assembling ${CMAKE_BINARY_DIR}/${ASM_FILENAME}.asm")
  28. - set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${ASM_FILENAME}.obj PROPERTIES EXTERNAL_OBJECT TRUE)
  29. + set_source_files_properties(${CMAKE_CURRENT_BINARY_DIR}/${ASM_FILENAME}.obj PROPERTIES EXTERNAL_OBJECT TRUE)
  30. - list(APPEND OBJECTS_LIST ${CMAKE_CURRENT_BINARY_DIR}/${ASM_FILENAME}.obj)
  31. + list(APPEND OBJECTS_LIST ${CMAKE_CURRENT_BINARY_DIR}/${ASM_FILENAME}.obj)
  32. + endif()
  33. endforeach()