Add boost toolset command line option.

This commit is contained in:
Marcel Pi 2023-12-20 11:28:14 +01:00
parent ff305d3b69
commit 14c49e3f43
1 changed files with 47 additions and 44 deletions

View File

@ -91,137 +91,141 @@ DEFAULT_C_STANDARD = 11
DEFAULT_CPP_STANDARD = 20 DEFAULT_CPP_STANDARD = 20
argp = argparse.ArgumentParser(description = __doc__) argp = argparse.ArgumentParser(description = __doc__)
def AddCommandLineFlag(name : str, help : str): def AddCLIFlag(name : str, help : str):
argp.add_argument(f'--{name}', action = 'store_true', help = help) argp.add_argument(f'--{name}', action = 'store_true', help = help)
def AddCommandLineStringFlag(name : str, default : str, help : str): def AddCLIStringOption(name : str, default : str, help : str):
argp.add_argument(f'--{name}', type = str, default = str(default), help = f'{help} (default = "{default}").') argp.add_argument(f'--{name}', type = str, default = str(default), help = f'{help} (default = "{default}").')
def AddCommandLineIntegerFlag(name : str, default : int, help : str): def ADDCLIIntOption(name : str, default : int, help : str):
argp.add_argument(f'--{name}', type = int, default = int(default), help = f'{help} (default = {default}).') argp.add_argument(f'--{name}', type = int, default = int(default), help = f'{help} (default = {default}).')
AddCommandLineFlag( AddCLIFlag(
'launch', 'launch',
'Build and open the CarlaUE4 project in the Unreal Engine editor.') 'Build and open the CarlaUE4 project in the Unreal Engine editor.')
AddCommandLineFlag( AddCLIFlag(
'launch-only', 'launch-only',
'Open the CARLA project in the Unreal Engine editor, skipping all build steps.') 'Open the CARLA project in the Unreal Engine editor, skipping all build steps.')
AddCommandLineFlag( AddCLIFlag(
'import', 'import',
f'Import maps and assets from "{WORKSPACE_PATH / "Import"}" into Unreal.') f'Import maps and assets from "{WORKSPACE_PATH / "Import"}" into Unreal.')
AddCommandLineFlag( AddCLIFlag(
'package', 'package',
'Build a packaged version of CARLA ready for distribution.') 'Build a packaged version of CARLA ready for distribution.')
AddCommandLineFlag( AddCLIFlag(
'docs', 'docs',
'Build the CARLA documentation, through Doxygen.') 'Build the CARLA documentation, through Doxygen.')
AddCommandLineFlag( AddCLIFlag(
'clean', 'clean',
'Delete all build files.') 'Delete all build files.')
AddCommandLineFlag( AddCLIFlag(
'rebuild', 'rebuild',
'Delete all build files and recompiles.') 'Delete all build files and recompiles.')
AddCommandLineFlag( AddCLIFlag(
'check-libcarla', 'check-libcarla',
'Run unit the test suites for LibCarla') 'Run unit the test suites for LibCarla')
AddCommandLineFlag( AddCLIFlag(
'check-python-api', 'check-python-api',
'Run unit the test suites for PythonAPI') 'Run unit the test suites for PythonAPI')
AddCommandLineFlag( AddCLIFlag(
'check', 'check',
'Run unit the test suites for LibCarla and PythonAPI') 'Run unit the test suites for LibCarla and PythonAPI')
AddCommandLineFlag( AddCLIFlag(
'carla-ue', 'carla-ue',
'Build the CARLA Unreal Engine plugin and project.') 'Build the CARLA Unreal Engine plugin and project.')
AddCommandLineFlag( AddCLIFlag(
'python-api', 'python-api',
'Build the CARLA Python API.') 'Build the CARLA Python API.')
AddCommandLineFlag( AddCLIFlag(
'libcarla-client', 'libcarla-client',
'Build the LibCarla Client module.') 'Build the LibCarla Client module.')
AddCommandLineFlag( AddCLIFlag(
'libcarla-server', 'libcarla-server',
'Build the LibCarla Server module.') 'Build the LibCarla Server module.')
AddCommandLineFlag( AddCLIFlag(
'update-deps', 'update-deps',
'Download all project dependencies.') 'Download all project dependencies.')
AddCommandLineFlag( AddCLIFlag(
'build-deps', 'build-deps',
'Build all project dependencies.') 'Build all project dependencies.')
AddCommandLineFlag( AddCLIFlag(
'configure-sequential', 'configure-sequential',
'Whether to disable parallelism in the configuration script.') 'Whether to disable parallelism in the configuration script.')
AddCommandLineFlag( AddCLIFlag(
'no-log', 'no-log',
'Whether to disable saving logs.') 'Whether to disable saving logs.')
AddCommandLineFlag( AddCLIFlag(
'pytorch', 'pytorch',
'Whether to enable PyTorch.') 'Whether to enable PyTorch.')
AddCommandLineFlag( AddCLIFlag(
'chrono', 'chrono',
'Whether to enable Chrono.') 'Whether to enable Chrono.')
AddCommandLineFlag( AddCLIFlag(
'carsim', 'carsim',
'Whether to enable CarSim') 'Whether to enable CarSim')
AddCommandLineFlag( AddCLIFlag(
'ros2', 'ros2',
'Whether to enable ROS2') 'Whether to enable ROS2')
AddCommandLineFlag( AddCLIFlag(
'unity-build', 'unity-build',
'Whether to enable Unity Build for Unreal Engine projects.') 'Whether to enable Unity Build for Unreal Engine projects.')
AddCommandLineFlag( AddCLIFlag(
'osm2odr', 'osm2odr',
'Whether to enable OSM2ODR.') 'Whether to enable OSM2ODR.')
AddCommandLineFlag( AddCLIFlag(
'osm-world-renderer', 'osm-world-renderer',
'Whether to enable OSM World Renderer.') 'Whether to enable OSM World Renderer.')
AddCommandLineFlag( AddCLIFlag(
'nv-omniverse', 'nv-omniverse',
'Whether to enable the NVIDIA Omniverse Plugin.') 'Whether to enable the NVIDIA Omniverse Plugin.')
AddCommandLineFlag( AddCLIFlag(
'march-native', 'march-native',
'Whether to add "-march=native" to C/C++ compile flags.') 'Whether to add "-march=native" to C/C++ compile flags.')
AddCommandLineFlag( AddCLIFlag(
'rss', 'rss',
'Whether to enable RSS.') 'Whether to enable RSS.')
AddCommandLineIntegerFlag( ADDCLIIntOption(
'parallelism', 'parallelism',
DEFAULT_PARALLELISM, DEFAULT_PARALLELISM,
'Set the configure/build parallelism.') 'Set the configure/build parallelism.')
AddCommandLineIntegerFlag( ADDCLIIntOption(
'c-standard', 'c-standard',
DEFAULT_C_STANDARD, DEFAULT_C_STANDARD,
'Set the target C standard.') 'Set the target C standard.')
AddCommandLineIntegerFlag( ADDCLIIntOption(
'cpp-standard', 'cpp-standard',
DEFAULT_CPP_STANDARD, DEFAULT_CPP_STANDARD,
'Set the target C++ standard.') 'Set the target C++ standard.')
AddCommandLineStringFlag( AddCLIStringOption(
'c-compiler', 'c-compiler',
DEFAULT_C_COMPILER, DEFAULT_C_COMPILER,
'Set the target C compiler.') 'Set the target C compiler.')
AddCommandLineStringFlag( AddCLIStringOption(
'cpp-compiler', 'cpp-compiler',
DEFAULT_CPP_COMPILER, DEFAULT_CPP_COMPILER,
'Set the target C++ compiler.') 'Set the target C++ compiler.')
AddCommandLineStringFlag( AddCLIStringOption(
'linker', 'linker',
DEFAULT_LINKER, DEFAULT_LINKER,
'Set the target linker.') 'Set the target linker.')
AddCommandLineStringFlag( AddCLIStringOption(
'ar', 'ar',
DEFAULT_LIB, DEFAULT_LIB,
'Set the target ar/lib tool.') 'Set the target ar/lib tool.')
AddCommandLineStringFlag( AddCLIStringOption(
'version', 'version',
FALLBACK_CARLA_VERSION_STRING, FALLBACK_CARLA_VERSION_STRING,
'Override the CARLA version.') 'Override the CARLA version.')
AddCommandLineStringFlag( AddCLIStringOption(
'generator', 'generator',
'Ninja', 'Ninja',
'Set the CMake generator.') 'Set the CMake generator.')
AddCommandLineStringFlag( AddCLIStringOption(
'build-path', 'build-path',
WORKSPACE_PATH / 'Build', WORKSPACE_PATH / 'Build',
'Set the CARLA build path.') 'Set the CARLA build path.')
AddCommandLineStringFlag( AddCLIStringOption(
'boost-toolset',
'msvc-14.3',
'Set the target boost toolset.')
AddCLIStringOption(
'ue-path', 'ue-path',
os.getenv( os.getenv(
'UNREAL_ENGINE_PATH', 'UNREAL_ENGINE_PATH',
@ -294,7 +298,7 @@ UNREAL_ENGINE_PATH = Path(ARGV.ue_path)
BOOST_VERSION = (1, 83, 0) BOOST_VERSION = (1, 83, 0)
BOOST_VERSION_MAJOR, BOOST_VERSION_MINOR, BOOST_VERSION_PATCH = BOOST_VERSION BOOST_VERSION_MAJOR, BOOST_VERSION_MINOR, BOOST_VERSION_PATCH = BOOST_VERSION
BOOST_VERSION_STRING = f'{BOOST_VERSION_MAJOR}.{BOOST_VERSION_MINOR}.{BOOST_VERSION_PATCH}' BOOST_VERSION_STRING = f'{BOOST_VERSION_MAJOR}.{BOOST_VERSION_MINOR}.{BOOST_VERSION_PATCH}'
BOOST_TOOLSET = 'msvc-14.3' BOOST_TOOLSET = ARGV.boost_toolset
BOOST_SOURCE_PATH = DEPENDENCIES_PATH / 'boost-source' BOOST_SOURCE_PATH = DEPENDENCIES_PATH / 'boost-source'
BOOST_BUILD_PATH = DEPENDENCIES_PATH / 'boost-build' BOOST_BUILD_PATH = DEPENDENCIES_PATH / 'boost-build'
BOOST_INSTALL_PATH = DEPENDENCIES_PATH / 'boost-install' BOOST_INSTALL_PATH = DEPENDENCIES_PATH / 'boost-install'
@ -909,7 +913,6 @@ def ConfigureSUMO():
def BuildDependencies( def BuildDependencies(
task_graph : TaskGraph): task_graph : TaskGraph):
task_graph.Execute()
# Configure: # Configure:
build_sqlite = task_graph.Add(Task('build-sqlite', [], BuildSQLite)) build_sqlite = task_graph.Add(Task('build-sqlite', [], BuildSQLite))
task_graph.Add(Task('configure-boost', [], ConfigureBoost)) task_graph.Add(Task('configure-boost', [], ConfigureBoost))