Skip to content

Commit

Permalink
fix archiving on xcode
Browse files Browse the repository at this point in the history
  • Loading branch information
leemaguire committed Jul 19, 2024
1 parent 5ec1bda commit 333d9b1
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ NEXT-RELEASE Release notes (YYYY-MM-DD)
### Fixed
* Using the `==` operator in a type safe query for a nullable string property would return the incorrect result when algined storage was disabled.
* Fix compilation issue when building with Bionic due to use of std::tuple (since 2.1.0).
* Archiving on Xcode would fail due to duplicated alias' when aligned storage was enabled.

### Enhancements
* Add ability to use `managed<std::map<std::string, T>>` in type safe queries when comparing a value for a key. e.g.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,5 +44,8 @@ int main()

@TYPE_INFO_QUERY_DECLS@

static char arch_key[] = {'a','r','c','h','_','k','e','y','_',KEY};
required += 1;

return required;
}
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
file(STRINGS ${BRIDGE_TYPE_INFO_BIN} compiled_string_literals REGEX "^REALM_TYPE_INFO")
file(STRINGS ${BRIDGE_TYPE_INFO_BIN} compiled_string_literals REGEX "^(REALM_TYPE_INFO|arch_key_)")

set(regex_realm "REALM_TYPE_INFO:(.+)\\[0*(.*),0*(.*)\\]")
set(regex_arch "^arch_key_(.+)")

set(regex "REALM_TYPE_INFO:(.+)\\[0*(.*),0*(.*)\\]")
set(BRIDGE_TYPE_DECLS "")
set(BRIDGE_TYPE_DECLS_TYPES "")
set(BRIDGE_TYPE_DECLS_REQUIRES_ELSE_IF OFF)

foreach(i ${compiled_string_literals})
if("${i}" MATCHES "${regex}")
set(BRIDGE_TYPE_DECLS "${BRIDGE_TYPE_DECLS} using ${CMAKE_MATCH_1} = std::aligned_storage<${CMAKE_MATCH_2}, ${CMAKE_MATCH_3}>::type;\n")
message(STATUS "${i}")
if("${i}" MATCHES "${regex_realm}")
set(BRIDGE_TYPE_DECLS_TYPES "${BRIDGE_TYPE_DECLS_TYPES} using ${CMAKE_MATCH_1} = std::aligned_storage<${CMAKE_MATCH_2}, ${CMAKE_MATCH_3}>::type;\n")
elseif("${i}" MATCHES "${regex_arch}")
if(BRIDGE_TYPE_DECLS_REQUIRES_ELSE_IF)
set(BRIDGE_TYPE_DECLS "${BRIDGE_TYPE_DECLS}#elif defined(${CMAKE_MATCH_1})\n${BRIDGE_TYPE_DECLS_TYPES}")
else()
set(BRIDGE_TYPE_DECLS "#if defined(${CMAKE_MATCH_1})\n${BRIDGE_TYPE_DECLS_TYPES}")
endif()
set(BRIDGE_TYPE_DECLS_REQUIRES_ELSE_IF ON)
set(BRIDGE_TYPE_DECLS_TYPES "")
else()
message(FATAL_ERROR "Unrecognized type info string: " ${h})
message(FATAL_ERROR "Unrecognized type info string: ${i}")
endif()
endforeach()

set(BRIDGE_TYPE_DECLS "${BRIDGE_TYPE_DECLS}#endif")

configure_file(${SOURCE_DIR}/bridge_types.hpp.in ${BINARY_DIR}/bridge_types.hpp)

0 comments on commit 333d9b1

Please sign in to comment.