Skip to content

Commit

Permalink
use smallcase for cmake function calls
Browse files Browse the repository at this point in the history
  • Loading branch information
anujkaliaiitd committed Apr 21, 2019
1 parent efb62c9 commit ec4ac54
Showing 1 changed file with 43 additions and 43 deletions.
86 changes: 43 additions & 43 deletions CMakeLists.txt
Expand Up @@ -38,82 +38,82 @@ cmake_dependent_option(LTO "Use link time optimization" ON "PERF" OFF)

# Parse the user-exposed options
if(PERF)
MESSAGE(STATUS "Compilation optimized for performance.")
SET(DEBUG OFF)
SET(TESTING OFF)
message(STATUS "Compilation optimized for performance.")
set(DEBUG OFF)
set(TESTING OFF)
else(PERF)
MESSAGE(STATUS "Compilation not optimized for performance.")
SET(DEBUG ON)
SET(TESTING ON)
message(STATUS "Compilation not optimized for performance.")
set(DEBUG ON)
set(TESTING ON)
endif(PERF)

# Profile-guided optimization
if(PGO STREQUAL "generate")
MESSAGE(STATUS "Profile-guided optimization (generate mode) is enabled. Performance will be low.")
message(STATUS "Profile-guided optimization (generate mode) is enabled. Performance will be low.")
add_definitions(-fprofile-generate)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-generate")
SET(COMPILE_ERPC_LIB OFF)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-generate")
set(COMPILE_ERPC_LIB OFF)
elseif(PGO STREQUAL "use")
MESSAGE(STATUS "Profile-guided optimization (use mode) is enabled.")
message(STATUS "Profile-guided optimization (use mode) is enabled.")
add_definitions(-fprofile-use -fprofile-correction)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-use -fprofile-correction")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fprofile-use -fprofile-correction")
elseif(PGO STREQUAL "none")
MESSAGE(STATUS "Profile-guided optimization is disabled.")
message(STATUS "Profile-guided optimization is disabled.")
endif()

# Logging level
if(LOG_LEVEL STREQUAL "none")
MESSAGE(STATUS "Logging level = none.")
message(STATUS "Logging level = none.")
add_definitions(-DERPC_LOG_LEVEL=0)
elseif(LOG_LEVEL STREQUAL "error")
MESSAGE(STATUS "Logging level = error.")
message(STATUS "Logging level = error.")
add_definitions(-DERPC_LOG_LEVEL=1)
elseif(LOG_LEVEL STREQUAL "warn")
MESSAGE(STATUS "Logging level = warn.")
message(STATUS "Logging level = warn.")
add_definitions(-DERPC_LOG_LEVEL=2)
elseif(LOG_LEVEL STREQUAL "info")
MESSAGE(STATUS "Logging level = info.")
message(STATUS "Logging level = info.")
add_definitions(-DERPC_LOG_LEVEL=3)
elseif(LOG_LEVEL STREQUAL "reorder")
MESSAGE(STATUS "Logging level = reorder. Warning: Performance will be low.")
message(STATUS "Logging level = reorder. Warning: Performance will be low.")
add_definitions(-DERPC_LOG_LEVEL=4)
elseif(LOG_LEVEL STREQUAL "trace")
MESSAGE(STATUS "Logging level = trace. Warning: Performance will be low.")
message(STATUS "Logging level = trace. Warning: Performance will be low.")
add_definitions(-DERPC_LOG_LEVEL=5)
elseif(LOG_LEVEL STREQUAL "cc")
MESSAGE(STATUS "Logging level = cc. Warning: Performance will be low.")
message(STATUS "Logging level = cc. Warning: Performance will be low.")
add_definitions(-DERPC_LOG_LEVEL=6)
else()
MESSAGE(STATUS "No logging level specified. Using warning level.")
message(STATUS "No logging level specified. Using warning level.")
add_definitions(-DERPC_LOG_LEVEL=2)
endif()

# Debug mode
if(DEBUG)
MESSAGE(STATUS "Debugging is enabled. Perf will be low.")
message(STATUS "Debugging is enabled. Perf will be low.")
else(DEBUG)
MESSAGE(STATUS "Debugging is disabled.")
message(STATUS "Debugging is disabled.")
add_definitions(-DNDEBUG)
add_definitions(-O2)
endif(DEBUG)

# Testing for packet loss, machine failure, etc
if(TESTING)
MESSAGE(STATUS "Testing is enabled. Performance will be low.")
message(STATUS "Testing is enabled. Performance will be low.")
add_definitions(-DTESTING=true)
else(TESTING)
MESSAGE(STATUS "Testing is disabled, so tests may fail.")
message(STATUS "Testing is disabled, so tests may fail.")
add_definitions(-DTESTING=false)
endif(TESTING)

# Link-time optimization
if(LTO)
MESSAGE(STATUS "LTO is enabled. eRPC library won't be compiled.")
SET(COMPILE_ERPC_LIB OFF)
message(STATUS "LTO is enabled. eRPC library won't be compiled.")
set(COMPILE_ERPC_LIB OFF)
add_definitions(-flto)
SET(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto")
else(LTO)
MESSAGE(STATUS "LTO is disabled. Performance will be low.")
message(STATUS "LTO is disabled. Performance will be low.")
endif(LTO)

set(SOURCES
Expand Down Expand Up @@ -151,8 +151,8 @@ set(SOURCES
# transport. Other transports are exluded using preprocessor macros.
string(TOUPPER ${TRANSPORT} DEFINE_TRANSPORT)
add_definitions(-D${DEFINE_TRANSPORT}=true)
MESSAGE(STATUS "Selected transport = ${TRANSPORT}.")
SET(CONFIG_IS_ROCE false)
message(STATUS "Selected transport = ${TRANSPORT}.")
set(CONFIG_IS_ROCE false)

if(TRANSPORT STREQUAL "dpdk")
find_library(DPDK_LIB dpdk)
Expand All @@ -161,8 +161,8 @@ if(TRANSPORT STREQUAL "dpdk")
endif()

set(LIBRARIES ${LIBRARIES} dpdk dl)
SET(CONFIG_TRANSPORT "DpdkTransport")
SET(CONFIG_HEADROOM 40)
set(CONFIG_TRANSPORT "DpdkTransport")
set(CONFIG_HEADROOM 40)

# DPDK include directory. Locating rte_config.h does not work on some systems.
# Example: it may be kept in /usr/include/x86_64-linux-gnu/, and symlinked
Expand All @@ -182,16 +182,16 @@ else()

set(LIBRARIES ${LIBRARIES} ibverbs)
if(TRANSPORT STREQUAL "raw")
SET(CONFIG_TRANSPORT "RawTransport")
SET(CONFIG_HEADROOM 40)
set(CONFIG_TRANSPORT "RawTransport")
set(CONFIG_HEADROOM 40)
elseif(TRANSPORT STREQUAL "infiniband")
SET(CONFIG_TRANSPORT "IBTransport")
set(CONFIG_TRANSPORT "IBTransport")
if(ROCE)
SET(CONFIG_HEADROOM 40)
SET(CONFIG_IS_ROCE true)
set(CONFIG_HEADROOM 40)
set(CONFIG_IS_ROCE true)
else()
SET(CONFIG_HEADROOM 0)
SET(CONFIG_IS_ROCE false)
set(CONFIG_HEADROOM 0)
set(CONFIG_IS_ROCE false)
endif()
endif()
endif()
Expand Down Expand Up @@ -242,7 +242,7 @@ set(UTIL_TESTS

# Compile the library
if(COMPILE_ERPC_LIB)
MESSAGE(STATUS "Compiling eRPC as a library")
message(STATUS "Compiling eRPC as a library")
add_library(erpc ${SOURCES})
endif()

Expand Down Expand Up @@ -276,7 +276,7 @@ endif()
if(EXISTS "${CMAKE_SOURCE_DIR}/scripts/autorun_app_file")
file(STRINGS "scripts/autorun_app_file" APP)
else()
MESSAGE(STATUS "No autorun_app_file found. No application will be compiled.")
message(STATUS "No autorun_app_file found. No application will be compiled.")
return()
endif()

Expand All @@ -289,9 +289,9 @@ message(STATUS "Compiling app = " ${APP})
find_library(PMEM_LIB pmem)
if(NOT PMEM_LIB)
message(STATUS "pmem library not found")
SET(PMEM "")
set(PMEM "")
else()
SET(PMEM "pmem")
set(PMEM "pmem")
endif()

if(APP STREQUAL "smr")
Expand Down

0 comments on commit ec4ac54

Please sign in to comment.