X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=CMakeLists.txt;h=0c5ce967dc3544c8d1d345678029054d3b00cabe;hb=HEAD;hp=94834ba3c1b6895af0233471b11d0e5894a527ad;hpb=cc314e0c526a0ed0ce9295e490b3f2bb29c3332c;p=ric-plt%2Flib%2Frmr.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 94834ba..0c5ce96 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 "2" ) -set( patch_level "3" ) +set( minor_version "9" ) +set( patch_level "4" ) 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 )