Minor changes, introduce options for -Wall and -Werror.
This commit is contained in:
parent
60e1b9d7d4
commit
8c14d9ff4c
|
@ -0,0 +1,20 @@
|
||||||
|
if (ENABLE_WARNINGS_TO_ERRORS)
|
||||||
|
if (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
|
||||||
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
|
check_cxx_compiler_flag(-Werror HAS_WALL)
|
||||||
|
if (HAS_WALL)
|
||||||
|
add_compile_options (-Werror)
|
||||||
|
endif ()
|
||||||
|
else ()
|
||||||
|
check_cxx_compiler_flag(/WX HAS_WALL)
|
||||||
|
if (HAS_WALL)
|
||||||
|
add_compile_options (/WX)
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
else ()
|
||||||
|
check_cxx_compiler_flag(-Werror HAS_WALL)
|
||||||
|
if (HAS_WALL)
|
||||||
|
add_compile_options (-Werror)
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
endif ()
|
|
@ -79,3 +79,15 @@ option (
|
||||||
"Whether to clone dependencies instead of directly downloading a compressed archive."
|
"Whether to clone dependencies instead of directly downloading a compressed archive."
|
||||||
OFF
|
OFF
|
||||||
)
|
)
|
||||||
|
|
||||||
|
option (
|
||||||
|
ENABLE_ALL_WARNINGS
|
||||||
|
"Whether to emit extra build warnings."
|
||||||
|
ON
|
||||||
|
)
|
||||||
|
|
||||||
|
option (
|
||||||
|
ENABLE_WARNINGS_TO_ERRORS
|
||||||
|
"Whether to convert build warnings to errors."
|
||||||
|
OFF
|
||||||
|
)
|
|
@ -0,0 +1,20 @@
|
||||||
|
if (ENABLE_ALL_WARNINGS)
|
||||||
|
if (CMAKE_CXX_COMPILER_FRONTEND_VARIANT STREQUAL "MSVC")
|
||||||
|
if (CMAKE_CXX_COMPILER_ID STREQUAL "Clang")
|
||||||
|
check_cxx_compiler_flag(-Wall HAS_WALL)
|
||||||
|
if (HAS_WALL)
|
||||||
|
add_compile_options (-Wall)
|
||||||
|
endif ()
|
||||||
|
else ()
|
||||||
|
check_cxx_compiler_flag(/Wall HAS_WALL)
|
||||||
|
if (HAS_WALL)
|
||||||
|
add_compile_options (/Wall)
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
else ()
|
||||||
|
check_cxx_compiler_flag(-Wall HAS_WALL)
|
||||||
|
if (HAS_WALL)
|
||||||
|
add_compile_options (-Wall)
|
||||||
|
endif ()
|
||||||
|
endif ()
|
||||||
|
endif ()
|
|
@ -28,13 +28,16 @@ set (
|
||||||
|
|
||||||
project (
|
project (
|
||||||
CARLA
|
CARLA
|
||||||
VERSION ${CARLA_VERSION}
|
VERSION
|
||||||
|
${CARLA_VERSION}
|
||||||
LANGUAGES
|
LANGUAGES
|
||||||
C
|
C
|
||||||
CXX
|
CXX
|
||||||
ASM # This is required by some dependencies, such as LibPNG.
|
ASM # This is required by some dependencies, such as LibPNG.
|
||||||
DESCRIPTION "Open-source simulator for autonomous driving research."
|
DESCRIPTION
|
||||||
HOMEPAGE_URL https://carla.org
|
"Open-source simulator for autonomous driving research."
|
||||||
|
HOMEPAGE_URL
|
||||||
|
https://carla.org
|
||||||
)
|
)
|
||||||
|
|
||||||
set (CMAKE_CXX_STANDARD 20)
|
set (CMAKE_CXX_STANDARD 20)
|
||||||
|
@ -56,8 +59,9 @@ set (
|
||||||
include (CheckCCompilerFlag)
|
include (CheckCCompilerFlag)
|
||||||
include (CheckCXXCompilerFlag)
|
include (CheckCXXCompilerFlag)
|
||||||
include (CheckLinkerFlag)
|
include (CheckLinkerFlag)
|
||||||
|
|
||||||
include (${CARLA_WORKSPACE_PATH}/CMake/CarlaOptions.cmake)
|
include (${CARLA_WORKSPACE_PATH}/CMake/CarlaOptions.cmake)
|
||||||
|
include (${CARLA_WORKSPACE_PATH}/CMake/Warnings.cmake)
|
||||||
|
include (${CARLA_WORKSPACE_PATH}/CMake/Errors.cmake)
|
||||||
|
|
||||||
if (LINUX)
|
if (LINUX)
|
||||||
check_linker_flag (
|
check_linker_flag (
|
||||||
|
@ -120,12 +124,8 @@ else ()
|
||||||
list (APPEND CARLA_EXCEPTION_DEFINITIONS PUGIXML_NO_EXCEPTIONS)
|
list (APPEND CARLA_EXCEPTION_DEFINITIONS PUGIXML_NO_EXCEPTIONS)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
include (${CARLA_WORKSPACE_PATH}/CMake/CarlaDependencies.cmake)
|
include (${CARLA_WORKSPACE_PATH}/CMake/CarlaDependencies.cmake)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (BUILD_CARLA_CLIENT OR BUILD_CARLA_SERVER)
|
if (BUILD_CARLA_CLIENT OR BUILD_CARLA_SERVER)
|
||||||
add_subdirectory (LibCarla)
|
add_subdirectory (LibCarla)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
project (
|
project (
|
||||||
carla-python-api
|
carla-python-api
|
||||||
LANGUAGES CXX
|
VERSION
|
||||||
VERSION ${CARLA_VERSION}
|
${CARLA_VERSION}
|
||||||
|
LANGUAGES
|
||||||
|
CXX
|
||||||
|
DESCRIPTION
|
||||||
|
"Python API for communicating with the CARLA server."
|
||||||
)
|
)
|
||||||
|
|
||||||
set (PYTHON_API_PATH ${CARLA_WORKSPACE_PATH}/PythonAPI)
|
set (PYTHON_API_PATH ${CARLA_WORKSPACE_PATH}/PythonAPI)
|
||||||
|
|
|
@ -1,5 +1,11 @@
|
||||||
project (
|
project (
|
||||||
carla-ue
|
carla-unreal
|
||||||
|
VERSION
|
||||||
|
${CARLA_VERSION}
|
||||||
|
LANGUAGES
|
||||||
|
CXX
|
||||||
|
DESCRIPTION
|
||||||
|
"Open-source simulator for autonomous driving research."
|
||||||
)
|
)
|
||||||
|
|
||||||
set (
|
set (
|
||||||
|
@ -39,8 +45,6 @@ else ()
|
||||||
)
|
)
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
set (CMAKE_NINJA_FORCE_RESPONSE_FILE ON)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
add_custom_command (
|
add_custom_command (
|
||||||
|
@ -57,13 +61,13 @@ add_custom_command (
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target (
|
add_custom_target (
|
||||||
carla-ue-generate-project-files
|
carla-unreal-generate-project-files
|
||||||
DEPENDS
|
DEPENDS
|
||||||
${CARLA_UE_PATH}/CMakeLists.txt
|
${CARLA_UE_PATH}/CMakeLists.txt
|
||||||
)
|
)
|
||||||
|
|
||||||
add_dependencies (
|
add_dependencies (
|
||||||
carla-ue-generate-project-files
|
carla-unreal-generate-project-files
|
||||||
carla-server
|
carla-server
|
||||||
libsqlite3
|
libsqlite3
|
||||||
Boost::asio
|
Boost::asio
|
||||||
|
@ -85,7 +89,10 @@ if (CMAKE_TOOLCHAIN_FILE)
|
||||||
NORMALIZE
|
NORMALIZE
|
||||||
OUTPUT_VARIABLE TOOLCHAIN_FILE
|
OUTPUT_VARIABLE TOOLCHAIN_FILE
|
||||||
)
|
)
|
||||||
set (TOOLCHAIN_FILE_OPTION --toolchain=${TOOLCHAIN_FILE})
|
set (
|
||||||
|
TOOLCHAIN_FILE_OPTION
|
||||||
|
--toolchain=${TOOLCHAIN_FILE}
|
||||||
|
)
|
||||||
else ()
|
else ()
|
||||||
set (TOOLCHAIN_FILE_OPTION)
|
set (TOOLCHAIN_FILE_OPTION)
|
||||||
endif ()
|
endif ()
|
||||||
|
@ -94,7 +101,7 @@ endif ()
|
||||||
|
|
||||||
add_custom_command (
|
add_custom_command (
|
||||||
OUTPUT
|
OUTPUT
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/carla-ue-configure.stamp
|
${CMAKE_CURRENT_BINARY_DIR}/carla-unreal-configure.stamp
|
||||||
COMMENT
|
COMMENT
|
||||||
"Configuring Carla Unreal..."
|
"Configuring Carla Unreal..."
|
||||||
COMMAND
|
COMMAND
|
||||||
|
@ -104,27 +111,27 @@ add_custom_command (
|
||||||
${TOOLCHAIN_FILE_OPTION}
|
${TOOLCHAIN_FILE_OPTION}
|
||||||
COMMAND
|
COMMAND
|
||||||
${CMAKE_COMMAND}
|
${CMAKE_COMMAND}
|
||||||
-E touch carla-ue-configure.stamp
|
-E touch carla-unreal-configure.stamp
|
||||||
USES_TERMINAL
|
USES_TERMINAL
|
||||||
VERBATIM
|
VERBATIM
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target (
|
add_custom_target (
|
||||||
carla-ue-configure
|
carla-unreal-configure
|
||||||
DEPENDS
|
DEPENDS
|
||||||
carla-ue-configure.stamp
|
carla-unreal-configure.stamp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_dependencies (
|
add_dependencies (
|
||||||
carla-ue-configure
|
carla-unreal-configure
|
||||||
carla-ue-generate-project-files
|
carla-unreal-generate-project-files
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
add_custom_command (
|
add_custom_command (
|
||||||
OUTPUT
|
OUTPUT
|
||||||
${CMAKE_CURRENT_BINARY_DIR}/carla-ue.stamp
|
${CMAKE_CURRENT_BINARY_DIR}/carla-unreal.stamp
|
||||||
COMMENT
|
COMMENT
|
||||||
"Building Carla Unreal..."
|
"Building Carla Unreal..."
|
||||||
COMMAND
|
COMMAND
|
||||||
|
@ -133,58 +140,48 @@ add_custom_command (
|
||||||
--target CarlaUnrealEditor
|
--target CarlaUnrealEditor
|
||||||
COMMAND
|
COMMAND
|
||||||
${CMAKE_COMMAND}
|
${CMAKE_COMMAND}
|
||||||
-E touch carla-ue.stamp
|
-E touch carla-unreal.stamp
|
||||||
USES_TERMINAL
|
USES_TERMINAL
|
||||||
VERBATIM
|
VERBATIM
|
||||||
)
|
)
|
||||||
|
|
||||||
add_custom_target (
|
add_custom_target (
|
||||||
carla-ue
|
carla-unreal
|
||||||
DEPENDS
|
DEPENDS
|
||||||
carla-ue.stamp
|
carla-unreal.stamp
|
||||||
)
|
)
|
||||||
|
|
||||||
add_dependencies (
|
add_dependencies (
|
||||||
carla-ue
|
carla-unreal
|
||||||
carla-ue-configure
|
carla-unreal-configure
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (WIN32)
|
if (WIN32)
|
||||||
set (EXE_EXT .exe)
|
set (EXE_EXT .exe)
|
||||||
else ()
|
|
||||||
set (EXE_EXT)
|
|
||||||
endif ()
|
|
||||||
|
|
||||||
if (WIN32)
|
|
||||||
set (UE_SYSTEM_NAME Win64)
|
set (UE_SYSTEM_NAME Win64)
|
||||||
elseif (LINUX)
|
elseif (LINUX)
|
||||||
|
set (EXE_EXT)
|
||||||
set (UE_SYSTEM_NAME Linux)
|
set (UE_SYSTEM_NAME Linux)
|
||||||
|
elseif (APPLE)
|
||||||
|
set (EXE_EXT)
|
||||||
|
set (UE_SYSTEM_NAME Mac)
|
||||||
else ()
|
else ()
|
||||||
|
message (FATAL_ERROR "Unknown target system.")
|
||||||
endif ()
|
endif ()
|
||||||
|
|
||||||
add_custom_target (
|
set (
|
||||||
launch-only
|
UNREAL_EDITOR_PATH
|
||||||
COMMENT
|
${CARLA_UNREAL_ENGINE_PATH}/Engine/Binaries/${UE_SYSTEM_NAME}/UnrealEditor${EXE_EXT}
|
||||||
"Launching Carla Unreal..."
|
|
||||||
COMMAND
|
|
||||||
${CARLA_UNREAL_ENGINE_PATH}/Engine/Binaries/${UE_SYSTEM_NAME}/UnrealEditor${EXE_EXT}
|
|
||||||
${CARLA_UE_PROJECT_PATH}
|
|
||||||
-${CARLA_UNREAL_RHI}
|
|
||||||
${LAUNCH_ARGS}
|
|
||||||
USES_TERMINAL
|
|
||||||
VERBATIM
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
add_custom_target (
|
add_custom_target (
|
||||||
launch
|
launch
|
||||||
COMMENT
|
COMMENT
|
||||||
"Launching Carla Unreal..."
|
"Launching Carla Unreal..."
|
||||||
COMMAND
|
COMMAND
|
||||||
${CARLA_UNREAL_ENGINE_PATH}/Engine/Binaries/${UE_SYSTEM_NAME}/UnrealEditor${EXE_EXT}
|
${UNREAL_EDITOR_PATH}
|
||||||
${CARLA_UE_PROJECT_PATH}
|
${CARLA_UE_PROJECT_PATH}
|
||||||
-${CARLA_UNREAL_RHI}
|
-${CARLA_UNREAL_RHI}
|
||||||
${LAUNCH_ARGS}
|
${LAUNCH_ARGS}
|
||||||
|
@ -194,7 +191,7 @@ add_custom_target (
|
||||||
|
|
||||||
add_dependencies (
|
add_dependencies (
|
||||||
launch
|
launch
|
||||||
carla-ue
|
carla-unreal
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue