Skip to content

Commit

Permalink
fix build: fix macos embedded config
Browse files Browse the repository at this point in the history
Tests: протестировано CI

Pull Request resolved: <#790>
commit_hash:4d92b7701dade356ce76263219f8516ff9d449fd
  • Loading branch information
fdr400 committed Dec 15, 2024
1 parent 638ece5 commit 097ed1f
Showing 1 changed file with 20 additions and 9 deletions.
29 changes: 20 additions & 9 deletions cmake/embedded_config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,32 @@ set(TEMPLATE "
#include <userver/utils/resources.hpp>
#if defined(__APPLE__)
#define APPLE_PREFIX \"_\"
#else
#define APPLE_PREFIX \"\"
#endif
__asm__(
#if defined(__APPLE__)
\".const_data\"
\".const_data\\n\"
\".global _@NAME@_start\\n\"
\".global _@NAME@_end\\n\"
\".global _@NAME@_size\\n\"
#else
\".section .rodata\"
\".section .rodata\\n\"
#endif
\".balign 16\\n\"
APPLE_PREFIX \"@NAME@_begin:\\n\"
R\"(
.align 16
@NAME@_begin:
.incbin \"${FILEPATH}\"
@NAME@_end:
.byte 0
@NAME@_size:
.int @NAME@_end - @NAME@_begin
)\");
)\"
\".balign 1\\n\"
APPLE_PREFIX \"@NAME@_end:\\n\"
\".byte 0\\n\"
APPLE_PREFIX \"@NAME@_size:\\n\"
\".int \" APPLE_PREFIX \"@NAME@_end - \" APPLE_PREFIX \"@NAME@_begin\\n\"
);
extern \"C\" const char @NAME@_begin[];
extern \"C\" const char @NAME@_end;
Expand Down

0 comments on commit 097ed1f

Please sign in to comment.