From bcbb2f3699917646092b9bf4e45835158ba12650 Mon Sep 17 00:00:00 2001 From: Andy Dill Date: Thu, 15 Oct 2020 13:22:00 -0700 Subject: [PATCH] build RelWithDebInfo so we can install / archive PDBs --- build.py | 10 +++++----- src/CMakeLists.txt | 9 +++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/build.py b/build.py index 215d3586..7fc7bb93 100755 --- a/build.py +++ b/build.py @@ -78,11 +78,11 @@ def unity(ctx): if sys.platform.startswith('win'): LIBRARY_NAME = 'discord-rpc.dll' - BUILD_64_BASE_PATH = os.path.join(SCRIPT_PATH, 'builds', 'win64-dynamic', 'src', 'Release') + BUILD_64_BASE_PATH = os.path.join(SCRIPT_PATH, 'builds', 'win64-dynamic', 'src', 'RelWithDebInfo') UNITY_64_DLL_PATH = os.path.join(UNITY_PROJECT_PATH, 'x86_64') BUILDS.append({BUILD_64_BASE_PATH: UNITY_64_DLL_PATH}) - BUILD_32_BASE_PATH = os.path.join(SCRIPT_PATH, 'builds', 'win32-dynamic', 'src', 'Release') + BUILD_32_BASE_PATH = os.path.join(SCRIPT_PATH, 'builds', 'win32-dynamic', 'src', 'RelWithDebInfo') UNITY_32_DLL_PATH = os.path.join(UNITY_PROJECT_PATH, 'x86') BUILDS.append({BUILD_32_BASE_PATH: UNITY_32_DLL_PATH}) @@ -127,11 +127,11 @@ def unreal(ctx): if sys.platform.startswith('win'): LIBRARY_NAME = 'discord-rpc.lib' - BUILD_64_BASE_PATH = os.path.join(SCRIPT_PATH, 'builds', 'win64-dynamic', 'src', 'Release') + BUILD_64_BASE_PATH = os.path.join(SCRIPT_PATH, 'builds', 'win64-dynamic', 'src', 'RelWithDebInfo') UNREAL_64_DLL_PATH = os.path.join(UNREAL_PROJECT_PATH, 'Source', 'ThirdParty', 'DiscordRpcLibrary', 'Win64') BUILDS.append({BUILD_64_BASE_PATH: UNREAL_64_DLL_PATH}) - BUILD_32_BASE_PATH = os.path.join(SCRIPT_PATH, 'builds', 'win32-dynamic', 'src', 'Release') + BUILD_32_BASE_PATH = os.path.join(SCRIPT_PATH, 'builds', 'win32-dynamic', 'src', 'RelWithDebInfo') UNREAL_32_DLL_PATH = os.path.join(UNREAL_PROJECT_PATH, 'Source', 'ThirdParty', 'DiscordRpcLibrary', 'Win32') BUILDS.append({BUILD_32_BASE_PATH: UNREAL_32_DLL_PATH}) @@ -177,7 +177,7 @@ def build_lib(build_name, generator, options, just_release): subprocess.check_call(initial_cmake) if not just_release: subprocess.check_call(['cmake', '--build', '.', '--config', 'Debug']) - subprocess.check_call(['cmake', '--build', '.', '--config', 'Release', '--target', 'install']) + subprocess.check_call(['cmake', '--build', '.', '--config', 'RelWithDebInfo', '--target', 'install']) @cli.command() diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 290d7611..0f66d6d5 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -145,3 +145,12 @@ install( "../include/discord_register.h" DESTINATION "include" ) + +if (${BUILD_SHARED_LIBS}) + if(WIN32) + install( + FILES $ + DESTINATION "bin" + OPTIONAL) + endif(WIN32) +endif(${BUILD_SHARED_LIBS})