Commit 714fdf98 authored by thomasl's avatar thomasl

fixing messages_xml.h in cmake, but remain an issue as te global variable...

fixing messages_xml.h in cmake, but remain an issue as te global variable messages_definition_xml comes the wrong way, so dependancies between files are wrong

git-svn-id: http://svn.eurecom.fr/openair4G/trunk@6699 818b1a75-f10b-46b9-bf7c-635c3b92a50f
parent d96c485a
......@@ -51,7 +51,10 @@ endif()
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS Debug Release RelWithDebInfo MinSizeRel)
#
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2 -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat -DCMAKER")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -msse4.2 -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat")
# set a flag for changes in the source code
# these changes are related to hardcoded path to include .h files
add_definitions("-DCMAKER")
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -ggdb -DMALLOC_CHECK_=3")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} -ggdb -DMALLOC_CHECK_=3 -O3")
......@@ -444,22 +447,6 @@ include_directories("${OPENAIRCN_DIR}/GTPV1-U/nw-gtpv1u/include")
##################################
#add_subdirectory (${OPENAIR_DIR} .)
# Generated code need to declare explicit dependancy
###############################################
set (ITTI_H ${ITTI_DIR}/intertask_interface_types.h)
add_custom_command (
OUTPUT ${OPENAIR_BIN_DIR}/messages.xml
COMMAND gccxml -fxml=${OPENAIR_BIN_DIR}/messages.xml ${ITTI_H} ${module_compiler_options}
#COMMAND rm ${ITTI_H}.tmp
)
add_custom_command (
OUTPUT ${OPENAIR_BIN_DIR}/messages_xml.h
COMMAND sed -e 's/ *//' -e 's/\"/\\\\\"/g' -e 's/^/\"/' -e 's/$$/\\\\n\"/' ${OPENAIR_BIN_DIR}/messages.xml > ${OPENAIR_BIN_DIR}/messages_xml.h
DEPENDS ${OPENAIR_BIN_DIR}/messages.xml
)
# define libraries
#add_library(MathFunctions mysqrt.cxx)
function(add_whole_dir dir lib_name)
......@@ -1141,22 +1128,57 @@ target_link_libraries (${myExe}
)
endforeach(myExe)
##################################################
# Generated specific cases is not regular code
###############################################
##################""
# itti symbolic debug print require to generate a specific include file
########################################
# retrieve the compiler options to send it to gccxml
get_directory_property( DirDefs COMPILE_DEFINITIONS )
foreach( d ${DirDefs} )
list(APPEND itti_compiler_options "-D${d}")
endforeach()
get_directory_property( DirDefs INCLUDE_DIRECTORIES )
foreach( d ${DirDefs} )
list(APPEND itti_compiler_options "-I${d}")
endforeach()
set (ITTI_H ${ITTI_DIR}/intertask_interface_types.h)
add_custom_command (
OUTPUT ${OPENAIR_BIN_DIR}/messages.xml
COMMAND gccxml ${itti_compiler_options} -fxml=${OPENAIR_BIN_DIR}/messages.xml ${ITTI_H}
DEPENDS ${S1AP_OAI_generated} ${RRC_FULL_DIR}/asn1_constants.h
)
add_custom_command (
OUTPUT ${OPENAIR_BIN_DIR}/messages_xml.h
COMMAND sed -e 's/ *//' -e 's/\"/\\\\\"/g' -e 's/^/\"/' -e 's/$$/\\\\n\"/' ${OPENAIR_BIN_DIR}/messages.xml > ${OPENAIR_BIN_DIR}/messages_xml.h
DEPENDS ${OPENAIR_BIN_DIR}/messages.xml ${RRC_FULL_DIR}/asn1_constants.h
)
################
# Kernel modules
###############
# Set compiler options for kernel modules
# we need to get out cmake to use the regular Linux Kernel process
# this is documented as https://www.kernel.org/doc/Documentation/kbuild/modules.txt
######################################
# Common to all modules
########################
# retrieve the compiler options to send it to gccxml
get_directory_property( DirDefs COMPILE_DEFINITIONS )
foreach( d ${DirDefs} )
if(NOT ${d} STREQUAL "USER_MODE")
set(module_compile_options "${module_compile_options} -D${d}")
list(APPEND itti_compiler_options "-I${d}")
endif()
endforeach()
get_directory_property( DirDefs INCLUDE_DIRECTORIES )
foreach( d ${DirDefs} )
set(module_compile_options "${module_compile_options} -I${d}")
set(module_cc_opt "${module_cc_opt} -I${d}")
endforeach()
EXECUTE_PROCESS(COMMAND uname -r
......@@ -1186,7 +1208,7 @@ endfunction(make_driver name dir src)
# nashmesh module
################
list(APPEND nasmesh_src device.c common.c ioctl.c classifier.c tool.c mesh.c)
set(module_compile_options "${module_compile_options} -DNAS_NETLINK")
set(module_cc_opt "${module_cc_opt} -DNAS_NETLINK")
make_driver(nasmesh ${OPENAIR2_DIR}/NAS/DRIVER/MESH ${nasmesh_src})
# Next module
......
src=${dir}
obj-m += ${name}.o
${name}-y := ${objs}
ccflags-y += ${module_compile_options}
${name}-y += ${objs}
ccflags-y += ${module_cc_opt}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment