Skip to content

Commit

Permalink
fix macos build
Browse files Browse the repository at this point in the history
  • Loading branch information
3ddelano committed Jun 5, 2024
1 parent be521f1 commit 2546f97
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 9 deletions.
15 changes: 10 additions & 5 deletions SConstruct
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def extract_eos_android_libraries():
os.remove(zip_file)


def on_complete(target, source, env):
def on_complete(_target, _source, _env):
if platform == "windows":
shutil.rmtree(plugin_bin_folder + "/windows/x64", ignore_errors=True)
shutil.copytree(eos_sdk_folder + "Bin/x64", plugin_bin_folder + "/windows/x64")
Expand All @@ -55,8 +55,12 @@ def on_complete(target, source, env):
copy_file(eos_sdk_folder + "Bin/libEOSSDK-Linux-Shipping.so", plugin_bin_folder + "/linux/libEOSSDK-Linux-Shipping.so")

elif platform == "macos":
copy_file(eos_sdk_folder + "Bin/libEOSSDK-Mac-Shipping.dylib", plugin_bin_folder + "/macos/libEOSSDK-Mac-Shipping.dylib")

framework_folder = plugin_bin_folder + f"/macos/{lib_name}.{platform}.framework"
# Copies EOS dylib inside framework folder
copy_file(eos_sdk_folder + "Bin/libEOSSDK-Mac-Shipping.dylib", framework_folder + f"/libEOSSDK-Mac-Shipping.dylib")
lib_path = f"{framework_folder}/{lib_name}.{platform}.{target}"
print(f"Updating libEOSSDK-Mac-Shipping.dylib path in {lib_path}")
os.system(f"install_name_tool -change @rpath/libEOSSDK-Mac-Shipping.dylib @loader_path/libEOSSDK-Mac-Shipping.dylib {lib_path}")

# For reference:
# - CCFLAGS are compilation flags shared between C and C++
Expand All @@ -71,6 +75,7 @@ def on_complete(target, source, env):
env.Append(CPPPATH=["src/", eos_sdk_folder + "Include/"])
sources = Glob("src/*.cpp")
platform = env["platform"]
target = env['target']

env.Append(LIBPATH=[eos_sdk_folder + "Lib/"])
env.Append(LIBPATH=[eos_sdk_folder + "Bin/"])
Expand Down Expand Up @@ -101,11 +106,11 @@ elif env["platform"] == "android":

if env["platform"] == "macos":
library = env.SharedLibrary(
f"{plugin_bin_folder}/macos/{lib_name}.{env['platform']}.{env['target']}.framework/{lib_name}.{env['platform']}.{env['target']}",
f"{plugin_bin_folder}/macos/{lib_name}.{platform}.{target}.framework/{lib_name}.{platform}.{target}",
source=sources,)
else:
library = env.SharedLibrary(
f"{plugin_bin_folder}/{env['platform']}/{lib_name}{env['suffix']}{env['SHLIBSUFFIX']}",
f"{plugin_bin_folder}/{platform}/{lib_name}{env['suffix']}{env['SHLIBSUFFIX']}",
source=sources,
)

Expand Down
6 changes: 3 additions & 3 deletions sample/Main.gd
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,9 @@ func _on_tab_pressed():
# test_sessions_interface()
# test_titlestorage_interface()
# test_user_info_interface()
#test_rtc_interface()
#test_anticheat_server_interface()
test_anticheat_client_interface()
# test_rtc_interface()
# test_anticheat_server_interface()
# test_anticheat_client_interface()

func test_auth_interface():
print("--- Auth: get_logged_in_accounts_count: ", EOS.Auth.AuthInterface.get_logged_in_accounts_count())
Expand Down
2 changes: 1 addition & 1 deletion sample/scenes/LogsView/LogsView.gd
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ func _ready() -> void:

func _on_platform_create():
# Set logging categories and level
var res: EOS.Result = EOS.Logging.set_log_level(EOS.Logging.LogCategory.AntiCheat, EOS.Logging.LogLevel.VeryVerbose)
var res: EOS.Result = EOS.Logging.set_log_level(EOS.Logging.LogCategory.AllCategories, EOS.Logging.LogLevel.Info)
if res != EOS.Result.Success:
print("Failed to set log level: ", EOS.result_str(res))

Expand Down

0 comments on commit 2546f97

Please sign in to comment.