mirror of
https://github.com/zebrajr/ladybird.git
synced 2025-12-06 00:19:53 +01:00
LibCore+Meta: Un-break Swift build on Linux
LibCore's list of ignored header files for Swift was missing the Apple only files on non-Apple platforms. Additionally, any generic glue code cannot use -fobjc-arc, so we need to rely on -fblocks only.
This commit is contained in:
parent
01ac48b36f
commit
89ecc75ed8
|
|
@ -122,12 +122,20 @@ if (ENABLE_SWIFT)
|
|||
else()
|
||||
list(APPEND SWIFT_EXCLUDE_HEADERS "EventLoopImplementationWindows.h")
|
||||
endif()
|
||||
if (NOT APPLE)
|
||||
list(APPEND SWIFT_EXCLUDE_HEADERS
|
||||
IOSurface.h
|
||||
MachPort.h
|
||||
MachMessageTypes.h
|
||||
ProcessStatisticsMach.h
|
||||
)
|
||||
endif()
|
||||
|
||||
generate_clang_module_map(LibCore EXCLUDE_FILES ${SWIFT_EXCLUDE_HEADERS})
|
||||
target_sources(LibCore PRIVATE
|
||||
EventSwift.mm
|
||||
EventLoopExecutor.swift)
|
||||
set_source_files_properties(EventSwift.mm PRIVATE PROPERTIES COMPILE_FLAGS -fobjc-arc)
|
||||
set_source_files_properties(EventSwift.mm PRIVATE PROPERTIES COMPILE_FLAGS -fblocks)
|
||||
target_link_libraries(LibCore PRIVATE AK)
|
||||
add_swift_target_properties(LibCore LAGOM_LIBRARIES AK)
|
||||
endif()
|
||||
|
|
|
|||
|
|
@ -7,16 +7,10 @@
|
|||
#include <LibCore/EventLoop.h>
|
||||
#include <LibCore/EventSwift.h>
|
||||
|
||||
#if !__has_feature(objc_arc)
|
||||
# error "This file requires ARC"
|
||||
#endif
|
||||
|
||||
namespace Core {
|
||||
void deferred_invoke_block(EventLoop& event_loop, void (^invokee)(void))
|
||||
{
|
||||
event_loop.deferred_invoke([invokee = move(invokee)] {
|
||||
invokee();
|
||||
});
|
||||
event_loop.deferred_invoke(invokee);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -104,6 +104,9 @@ function(_setup_swift_paths)
|
|||
NO_DEFAULT_PATH)
|
||||
add_link_options("$<$<LINK_LANGUAGE:Swift>:${SWIFT_SWIFTRT_FILE}>")
|
||||
endif()
|
||||
|
||||
# FIXME: Re-enable SIL verification after https://github.com/swiftlang/swift/issues/80065 is fixed
|
||||
add_compile_options("SHELL:$<$<COMPILE_LANGUAGE:Swift>:-Xfrontend -sil-verify-none>")
|
||||
endfunction()
|
||||
|
||||
_setup_swift_paths()
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user