From 714fdf985ca412ac0e57d2c2121e73c9e547bda8 Mon Sep 17 00:00:00 2001 From: thomasl <thomasl@eurecom.fr> Date: Thu, 5 Mar 2015 19:53:25 +0000 Subject: [PATCH] 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 --- cmake_targets/CMakeLists.txt | 72 +++++++++++++++++++++++------------- cmake_targets/Kbuild.cmake | 4 +- 2 files changed, 49 insertions(+), 27 deletions(-) diff --git a/cmake_targets/CMakeLists.txt b/cmake_targets/CMakeLists.txt index 305ca31dfb..e98872daae 100644 --- a/cmake_targets/CMakeLists.txt +++ b/cmake_targets/CMakeLists.txt @@ -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,27 +1128,62 @@ 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 - OUTPUT_VARIABLE os_release - OUTPUT_STRIP_TRAILING_WHITESPACE) + OUTPUT_VARIABLE os_release + OUTPUT_STRIP_TRAILING_WHITESPACE) SET(module_build_path /lib/modules/${os_release}/build) message("Kernel build path = ${module_build_path}") @@ -1186,9 +1208,9 @@ 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 #################### diff --git a/cmake_targets/Kbuild.cmake b/cmake_targets/Kbuild.cmake index 6c3e228a1e..7403cd04df 100644 --- a/cmake_targets/Kbuild.cmake +++ b/cmake_targets/Kbuild.cmake @@ -1,4 +1,4 @@ src=${dir} obj-m += ${name}.o -${name}-y := ${objs} -ccflags-y += ${module_compile_options} +${name}-y += ${objs} +ccflags-y += ${module_cc_opt} -- GitLab