Skip to content

Commit

Permalink
Fix wscript not finding library on platforms with 'lib64' folder in C…
Browse files Browse the repository at this point in the history
…Make install (#2)

* Patch: Fixed build path errors
  • Loading branch information
loglund authored Jun 27, 2024
1 parent 6bef607 commit 8f37957
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 8 deletions.
1 change: 1 addition & 0 deletions NEWS.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ every change, see the Git log..
Latest
------
* Major: Both CMake and Waf build systems are now supported on all platforms
* Patch: Fixed build path errors

1.1.0
-----
Expand Down
19 changes: 11 additions & 8 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ from waflib import Build, Errors, Logs
APPNAME = "srt"
VERSION = "1.1.0"


def build(bld):
bld.post_mode = Build.POST_LAZY

Expand All @@ -25,8 +26,13 @@ def build(bld):
# Declare the include directory for the external library
include_dir = install_dir.make_node("include")

# Declare the lib directory for the external library
lib_dir = install_dir.make_node("lib")
lib_dir = None

if install_dir.find_node("lib64"):
lib_dir = install_dir.make_node("lib64")
else:
# Declare the lib directory for the external library
lib_dir = install_dir.make_node("lib")

# build the external library through an external process
bld(
Expand Down Expand Up @@ -58,10 +64,9 @@ def build(bld):
def CMakeBuildTask(task):
CMAKE_BUILD_TYPE = "Release"
SRT_ENABLE_DEBUG = "OFF"
if task.env['stored_options']['cxx_debug']:
if task.env["stored_options"]["cxx_debug"]:
CMAKE_BUILD_TYPE = "Debug"
SRT_ENABLE_DEBUG = "ON"


# This is the directory where the external library will be installed the
# task.outputs[0] is the flag file that will be created once the external
Expand All @@ -87,13 +92,12 @@ def CMakeBuildTask(task):
if platform.system() == "Windows":
flags.append("-DCMAKE_POLICY_DEFAULT_CMP0091:STRING=NEW")
if CMAKE_BUILD_TYPE == "Debug":
flags.append("-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug")
flags.append("-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDebug")
elif CMAKE_BUILD_TYPE == "Release":
flags.append("-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded")
# For 32 bit builds we need to pass -A Win32 for cross compiling with mkspec
if task.env['DEST_CPU'] == 'x86':
if task.env["DEST_CPU"] == "x86":
flags.append("-A Win32")


# SRT cmake flags
flags += [
Expand All @@ -107,7 +111,6 @@ def CMakeBuildTask(task):
]
flags = " ".join(flags)


# Run all commands in the output directory
cwd = output_dir.abspath()

Expand Down

0 comments on commit 8f37957

Please sign in to comment.