Skip to content

Commit

Permalink
build dylib instead of framework for unreal
Browse files Browse the repository at this point in the history
  • Loading branch information
Luke Gehorsam committed Sep 4, 2022
1 parent 47ab002 commit d2b18f8
Showing 1 changed file with 21 additions and 13 deletions.
34 changes: 21 additions & 13 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ if(NAKAMA_SHARED_LIBRARY)
endif()


if(APPLE)
if(APPLE AND !UNREAL)
file(TOUCH ${CMAKE_BINARY_DIR}/dummy.h ${CMAKE_BINARY_DIR}/dummy.cpp)
set(DUMMY_CPP ${CMAKE_BINARY_DIR}/dummy.cpp)
set(DUMMY_H ${CMAKE_BINARY_DIR}/dummy.h)
Expand Down Expand Up @@ -286,19 +286,27 @@ endif()

add_library(nakama-sdk ${BUILD_MODE} ${NAKAMA_SDK_DEPS})


set_target_properties(nakama-sdk PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION A

# we deliberately dont list all real headers, because it is a can of worms. See:
# - https://gitlab.kitware.com/cmake/cmake/-/issues/16739
# - https://gitlab.kitware.com/cmake/cmake/-/issues/22760
# Probably can be removed when proper FILE_SET support lands: https://gitlab.kitware.com/cmake/cmake/-/issues/23386
PUBLIC_HEADER "${DUMMY_H}"
MACOSX_FRAMEWORK_IDENTIFIER com.heroiclabs.libnakama
VERSION ${LIBNAKAMA_VERSION}
SOVERSION ${LIBNAKAMA_SOVERSION}
)
VERSION ${LIBNAKAMA_VERSION}
SOVERSION ${LIBNAKAMA_SOVERSION}
)

### Unreal Engine does not recognize frameworks.

if (!UNREAL)
set_target_properties(nakama-sdk PROPERTIES
FRAMEWORK TRUE
FRAMEWORK_VERSION A

# we deliberately dont list all real headers, because it is a can of worms. See:
# - https://gitlab.kitware.com/cmake/cmake/-/issues/16739
# - https://gitlab.kitware.com/cmake/cmake/-/issues/22760
# Probably can be removed when proper FILE_SET support lands: https://gitlab.kitware.com/cmake/cmake/-/issues/23386
PUBLIC_HEADER "${DUMMY_H}"
MACOSX_FRAMEWORK_IDENTIFIER com.heroiclabs.libnakama
)
endif()

add_library(nakama::sdk ALIAS nakama-sdk)
target_link_libraries(nakama-sdk
Expand Down

0 comments on commit d2b18f8

Please sign in to comment.