@@ -68,7 +68,8 @@ endif()
6868set (CMAKE_CONFIGURATION_TYPES "Debug;MinSizeRel" )
6969set (CMAKE_SUPPRESS_REGENERATION true ) ## for Xcode
7070
71- option (FORCE_DLL_IMPORT_EXPORT "Force exporting and importing of symbols regardless of the platform." OFF )
71+ option (FORCE_DLL_IMPORT_EXPORT "Force exporting and importing of symbols using __declspec mechanism regardless of the platform." OFF )
72+ option (FORCE_DLL_VISIBILITY "Force exporting symbols using visibility attribute regardless of the platform." OFF )
7273option (BUILD_APPLE_FRAMEWORK "Build frameworks instead of .dylib files for Apple." ON )
7374
7475set (NAKAMA_SDK_DEPS)
@@ -99,12 +100,18 @@ if(NOT MSVC)
99100 string (APPEND CMAKE_CXX_FLAGS " -fexceptions" )
100101endif ()
101102
103+ option (UNDEFINED_SANITIZER "Enable undefined sanitizer (broken on windows)" OFF )
102104option (ADDRESS_SANITIZER "Enable address sanitizer (broken on windows)" OFF )
103105
104106if (LOGS_ENABLED)
105107 add_compile_definitions (NLOGS_ENABLED)
106108endif (LOGS_ENABLED)
107109
110+ if (UNDEFINED_SANITIZER)
111+ add_compile_options (-fsanitize=undefined -O1)
112+ string (REPLACE /RTC1 "" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG} )
113+ endif ()
114+
108115if (ADDRESS_SANITIZER)
109116 add_compile_options (-fsanitize=address -O1 -fno-optimize-sibling-calls -fno-omit-frame-pointer)
110117 string (REPLACE /RTC1 "" CMAKE_CXX_FLAGS_DEBUG ${CMAKE_CXX_FLAGS_DEBUG} )
@@ -155,8 +162,6 @@ add_subdirectory(factory EXCLUDE_FROM_ALL)
155162
156163add_subdirectory (satori-cpp)
157164
158- include ("submodules/private/cmake/target-${VCPKG_TARGET_TRIPLET} .cmake" OPTIONAL )
159-
160165if (WITH_HTTP_CPPREST)
161166 set (HTTP_IMPL_LIB nakama::impl-http-cppRest)
162167 add_subdirectory (impl/httpCppRest EXCLUDE_FROM_ALL )
@@ -239,6 +244,8 @@ endif()
239244# defined target and not to fallback to '-lname' when target doesn't exist,
240245# thus failing at configure time, rather than at link time should we make mistake
241246# in build scripts
247+
248+
242249list (APPEND NAKAMA_SDK_DEPS
243250 nakama::sdk-core-misc
244251 nakama::sdk-core-rest
@@ -248,12 +255,20 @@ list(APPEND NAKAMA_SDK_DEPS
248255 nakama::sdk-rtclient-factory
249256 satori::client
250257)
258+
251259if (WITH_GRPC_CLIENT)
252260 list (APPEND NAKAMA_SDK_DEPS nakama::sdk-core-grpc)
253261endif ()
254262
255263add_library (nakama-sdk SHARED ${DUMMY_CPP} ${DUMMY_H} )
256264add_library (nakama::sdk ALIAS nakama-sdk)
265+
266+ if (BUILD_TESTING)
267+ add_subdirectory (test )
268+ endif ()
269+
270+ include ("submodules/private/cmake/target-${VCPKG_TARGET_TRIPLET} .cmake" OPTIONAL )
271+
257272target_link_libraries (nakama-sdk
258273 PUBLIC
259274 nakama::sdk-interface
@@ -281,12 +296,6 @@ if (APPLE)
281296 )
282297endif ()
283298
284- if (BUILD_TESTING)
285- # Make tests produce .exe in the same dir as our nakama-sdk.dll
286- set (CMAKE_RUNTIME_OUTPUT_DIRECTORY $<TARGET_FILE_DIR:nakama-sdk>)
287- add_subdirectory (test )
288- endif ()
289-
290299
291300if (ADDRESS_SANITIZER)
292301 if (MSVC )
0 commit comments