Link runtime libraries dynamically

Unreal Engine doesn't allow static runtime linking
https://wiki.unrealengine.com/Linking_Static_Libraries_Using_The_Build_System
This commit is contained in:
iFuSiiOnzZ 2018-07-30 18:59:42 +02:00
parent e908ff20c9
commit c983966c2a
5 changed files with 7 additions and 7 deletions

View File

@ -36,7 +36,7 @@ def get_libcarla_extensions():
libraries += ["boost_python"]
elif os.name == "nt":
pwd = os.path.dirname(os.path.realpath(__file__))
pylib = "libboost_python%d%d-vc141-mt-s-x64-1_68.lib" % (sys.version_info.major, sys.version_info.minor)
pylib = "libboost_python%d%d-vc141-mt-x64-1_68.lib" % (sys.version_info.major, sys.version_info.minor)
extra_link_args = [
'shlwapi.lib',
@ -44,7 +44,7 @@ def get_libcarla_extensions():
os.path.join(pwd, 'dependencies/lib', pylib)]
# https://docs.microsoft.com/es-es/cpp/porting/modifying-winver-and-win32-winnt
extra_compile_args = ['/DPYTHON3X', '/MT', '/DBOOST_PYTHON_STATIC_LIB','/DBOOST_ERROR_CODE_HEADER_ONLY', '/D_WIN32_WINNT=0x0501' ]
extra_compile_args = ['/DPYTHON3X', '/DBOOST_PYTHON_STATIC_LIB','/DBOOST_ERROR_CODE_HEADER_ONLY', '/D_WIN32_WINNT=0x0501' ]
extra_link_args += []
else:
raise NotImplementedError

View File

@ -80,13 +80,13 @@ cd "%LIBCARLA_VSPROJECT_PATH%"
rem Build libcarla server
rem
if %BUILD_SERVER% == true if not exist "%LIBCARLA_SERVER_INSTALL_PATH%" (
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Server -DCMAKE_CXX_FLAGS_RELEASE=/MT -DCMAKE_INSTALL_PREFIX=%LIBCARLA_SERVER_INSTALL_PATH% %ROOT_PATH%
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Server -DCMAKE_CXX_FLAGS_RELEASE=/MD -DCMAKE_INSTALL_PREFIX=%LIBCARLA_SERVER_INSTALL_PATH% %ROOT_PATH%
cmake --build . --config Release --target install
)
rem Build libcarla client
rem
if %BUILD_CLIENT% == true if not exist "%LIBCARLA_CLIENT_INSTALL_PATH%" (
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Client -DCMAKE_CXX_FLAGS_RELEASE=/MT -DCMAKE_INSTALL_PREFIX=%LIBCARLA_CLIENT_INSTALL_PATH% %ROOT_PATH%
cmake -G "Visual Studio 15 2017 Win64" -DCMAKE_BUILD_TYPE=Client -DCMAKE_CXX_FLAGS_RELEASE=/MD -DCMAKE_INSTALL_PREFIX=%LIBCARLA_CLIENT_INSTALL_PATH% %ROOT_PATH%
cmake --build . --config Release --target install
)

View File

@ -76,7 +76,7 @@ b2 -j8^
toolset=%B_TOOLSET%^
variant=release^
link=static^
runtime-link=static^
runtime-link=shared^
threading=multi^
--prefix="%B_INSTALL_DIR%"^
--libdir="%B_LIB_DIR%"^

View File

@ -59,7 +59,7 @@ cd "%GT_BUILD_DIR%"
echo %FILE_N% Generating build...
cmake .. -G "Visual Studio 15 2017 Win64"^
-DCMAKE_BUILD_TYPE=Release^
-DCMAKE_CXX_FLAGS_RELEASE=/MT^
-DCMAKE_CXX_FLAGS_RELEASE=/MD^
-DCMAKE_INSTALL_PREFIX=%GT_INSTALL_DIR%^
-DCMAKE_CXX_FLAGS=/D_SILENCE_TR1_NAMESPACE_DEPRECATION_WARNING^
%GT_SRC_DIR%

View File

@ -60,7 +60,7 @@ echo %FILE_N% Generating build...
cmake .. -G "Visual Studio 15 2017 Win64"^
-DCMAKE_BUILD_TYPE=Release^
-RPCLIB_BUILD_EXAMPLES=OFF^
-DCMAKE_CXX_FLAGS_RELEASE=/MT^
-DCMAKE_CXX_FLAGS_RELEASE=/MD^
-DCMAKE_INSTALL_PREFIX=%RPC_INSTALL_DIR%^
%RPC_SRC_DIR%
if errorlevel 1 goto error_cmake