Skip to content
Snippets Groups Projects

Apply clang-tidy on the source code

Files
532
+ 3
32
@@ -81,7 +81,6 @@ endif()
# [INCDIRS <include-directories>]
# [LIBRARIES <libraries>]
# [UIS <qt_uis>]
# [LINKOSI [shared|static]]
# [FOLDER <category>]
# [COMPONENT <sim|core|bin|module>])
#
@@ -93,7 +92,6 @@ endif()
# [INCDIRS <include-directories>]
# [LIBRARIES <libraries>]
# [UIS <qt_uis>]
# [LINKOSI [shared|static]]
# [FOLDER <category>]
# [COMPONENT <sim|core|bin|module>])
#
@@ -104,7 +102,6 @@ endif()
# [INCDIRS <include-directories>]
# [LIBRARIES <libraries>]
# [UIS <qt_uis>]
# [LINKOSI [shared|static]]
# [DEFAULT_MAIN]
# [SIMCORE_DEPS <dependencies>]
# [RESOURCES <directories>]
@@ -117,9 +114,8 @@ endif()
# SOURCES Source files
# HEADERS Header files
# UIS Qt UI files
# INCDIRS Additional include directories
# INCDIRS Additional private include directories
# LIBRARIES Additional libraries to link
# LINKOSI Shortcut for adding OSI include directories and libraries (incl. protobuf) as 'static' or 'shared' (default).
# DEFAULT_MAIN Links a simple main() implementation for running GTest
# SIMCORE_DEPS Adds dependencies on simulation core targets to a test
# RESOURCES List of directories to be copied to the test executable's location before test execution
@@ -139,13 +135,13 @@ endif()
# - Target property DEBUG_POSTFIX is set to CMAKE_DEBUG_POSTFIX
##
function(add_openpass_target)
cmake_parse_arguments(PARSED_ARG "DEFAULT_MAIN" "NAME;TYPE;LINKAGE;LINKOSI" "HEADERS;SOURCES;INCDIRS;LIBRARIES;UIS;SIMCORE_DEPS;RESOURCES;FOLDER;COMPONENT" ${ARGN})
cmake_parse_arguments(PARSED_ARG "DEFAULT_MAIN" "NAME;TYPE;LINKAGE" "HEADERS;SOURCES;INCDIRS;LIBRARIES;UIS;SIMCORE_DEPS;RESOURCES;FOLDER;COMPONENT" ${ARGN})
if(TARGET ${PARSED_ARG_NAME})
message(STATUS "Target '${PARSED_ARG_NAME}' already defined. Skipping.")
else()
# TODO: different categories of libraries can be placed in different directories
# note: different categories of libraries can be placed in different directories
# Core Components are installed in their own core directory as an example
if("${PARSED_ARG_COMPONENT}" STREQUAL "core")
set (DESTDIR ${SUBDIR_LIB_CORE})
@@ -275,28 +271,6 @@ function(add_openpass_target)
Boost::headers
)
# LINKOSI handling
# fallback to default if value is omitted
if("LINKOSI" IN_LIST PARSED_ARG_KEYWORDS_MISSING_VALUES)
set(PARSED_ARG_LINKOSI "shared")
endif()
if(DEFINED PARSED_ARG_LINKOSI)
# validate value
set(VALID_LINKOSI_VALUES "" "shared" "static")
if(NOT "${PARSED_ARG_LINKOSI}" IN_LIST VALID_LINKOSI_VALUES)
message(FATAL_ERROR "Invalid value for LINKOSI. Supported settings are '', 'shared' and 'static'")
endif()
# replace static with pic for library targets
if("${PARSED_ARG_TYPE}" STREQUAL "library" AND "${PARSED_ARG_LINKOSI}" STREQUAL "static")
set(PARSED_ARG_LINKOSI "pic")
endif()
target_link_libraries(${PARSED_ARG_NAME} open_simulation_interface::open_simulation_interface_${PARSED_ARG_LINKOSI})
endif()
target_compile_options(${PARSED_ARG_NAME} PRIVATE
$<$<CXX_COMPILER_ID:MSVC>:
-wd4251 -wd4335 -wd4250>)
@@ -312,9 +286,6 @@ function(add_openpass_target)
if(DEFINED PARSED_ARG_LIBRARIES)
list(APPEND DEPS ${PARSED_ARG_LIBRARIES})
endif()
if(DEFINED PARSED_ARG_LINKOSI)
list(APPEND DEPS open_simulation_interface::open_simulation_interface_${PARSED_ARG_LINKOSI} protobuf::libprotobuf)
endif()
message(DEBUG "Locating shared library test dependencies for ${PARSED_ARG_NAME}")
foreach(DEP IN LISTS DEPS)
Loading