ProfinetConnector/profinet_stack/osal/cmake/Linux.cmake
2022-12-08 16:18:07 +03:00

58 lines
1.3 KiB
CMake

#********************************************************************
# _ _ _
# _ __ | |_ _ | | __ _ | |__ ___
# | '__|| __|(_)| | / _` || '_ \ / __|
# | | | |_ _ | || (_| || |_) |\__ \
# |_| \__|(_)|_| \__,_||_.__/ |___/
#
# www.rt-labs.com
# Copyright 2017 rt-labs AB, Sweden.
#
# This software is licensed under the terms of the BSD 3-clause
# license. See the file LICENSE distributed with this software for
# full license information.
#*******************************************************************/
find_package(Threads)
option (USE_SCHED_FIFO
"Use SCHED_FIFO policy. May require extra privileges to run"
OFF)
target_sources(${LIB_NAME} PRIVATE
src/linux/osal.c
src/linux/osal_log.c
)
target_compile_options(${LIB_NAME}
PRIVATE
-Wall
-Wextra
-Werror
-Wno-unused-parameter
$<$<BOOL:${USE_SCHED_FIFO}>:-DUSE_SCHED_FIFO>
INTERFACE
$<$<CONFIG:Coverage>:--coverage>
)
target_include_directories(${LIB_NAME} PUBLIC
$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/src/linux>
)
target_link_libraries(${LIB_NAME} PUBLIC
Threads::Threads
rt
INTERFACE
$<$<CONFIG:Coverage>:--coverage>
)
install(FILES
src/linux/sys/osal_cc.h
src/linux/sys/osal_sys.h
DESTINATION ${INSTALL_PATH_INC}/sys
)
if (BUILD_TESTING)
set(GOOGLE_TEST_INDIVIDUAL TRUE)
endif()