X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=CMakeLists.txt;h=b13880cc9ef676140a66765d8a94332ba8afa45c;hb=e2c0690497a2db5659b3e138e4e106d70fee4aab;hp=a4ed121e67fdbe84aa8cf01011fc9c0b0814b25d;hpb=2efdde081e2d8d31ee65907a84d5623e819451e4;p=ric-plt%2Flib%2Frmr.git diff --git a/CMakeLists.txt b/CMakeLists.txt index a4ed121..b13880c 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,7 +1,7 @@ # #================================================================================== -# Copyright (c) 2019 Nokia -# Copyright (c) 2018-2019 AT&T Intellectual Property. +# Copyright (c) 2019-2021 Nokia +# Copyright (c) 2018-2021 AT&T Intellectual Property. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -33,6 +33,7 @@ # -DGPROF=1 Enable profiling compile time flags # -DSKIP_EXTERNALS=1 Do not use NNG submodule when building; uee installed packages # -DMAN_PREFIX= Supply a path where man pages are installed (default: /usr/share/man) +# -DOPT_LEVEL=n Set a custom optimisation level. # See ci/build_all for an example of how to build and test @@ -40,8 +41,8 @@ project( rmr LANGUAGES C ) cmake_minimum_required( VERSION 3.5 ) set( major_version "4" ) # should be automatically populated from git tag later, but until CI process sets a tag we use this -set( minor_version "4" ) -set( patch_level "5" ) +set( minor_version "8" ) +set( patch_level "2" ) set( install_root "${CMAKE_INSTALL_PREFIX}" ) set( install_inc "include/rmr" ) @@ -104,7 +105,7 @@ if( DEBUG ) # if set, we'll set debugging on in the compile message( "+++ debugging is being set to ${DEBUG}" ) else() set( debugging 0 ) - message( "+++ debugging is set to off" ) + message( "+++ debugging is set to off (use -DDEBUG=1 to enable)" ) endif() unset( DEBUG CACHE ) # we don't want this to persist @@ -240,11 +241,22 @@ if( GPROF ) # if set, we'll set profiling flag on compiles message( "+++ profiling is on" ) set( CMAKE_C_FLAGS "-pg " ) else() - message( "+++ profiling is off" ) + message( "+++ profiling is off (use -DGPROF=1 to enable" ) set( CMAKE_C_FLAGS "-g " ) endif() unset( GPROF CACHE ) # we don't want this to persist +if( DEFINED OPT_LEVEL ) + message( "+++ optimisation is forced to ${OPT_LEVEL}" ) + set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O${OPT_LEVEL} " ) +else() + message( "+++ optimisation will default (use -DOPT_LEVEL=n to force specific level, or disable)" ) +endif() +unset( OPT_LEVEL CACHE ) # no optimisation flage does NOT percist + +message( "+++ compiler flags: ${CMAKE_C_FLAGS}" ) + + # Include modules add_subdirectory( src/rmr/common ) if( BUILD_NNG )