Commit ef3595ec authored by Marco Clemencic's avatar Marco Clemencic
Browse files

modified build flags to be closer to the CMT ones

parent 044b1ac2
#---Compilation Flags--------------------------------------------------------------------------------
#---Gaudi Build Options---------------------------------------------------------
# Build options that map to compile time features
#
option(GAUDI_V21
"disable backward compatibility hacks (implies all G21_* options)"
OFF)
option(G21_HIDE_SYMBOLS
"enable explicit symbol visibility on gcc-4"
OFF)
option(G21_NEW_INTERFACES
"disable backward-compatibility hacks in IInterface and InterfaceID"
OFF)
option(G21_NO_ENDREQ
"disable the 'endreq' stream modifier (use 'endmsg' instead)"
OFF)
option(G21_NO_DEPRECATED
"remove deprecated methods and functions"
OFF)
option(G22_NEW_SVCLOCATOR
"use (only) the new interface of the ServiceLocator"
OFF)
option(GAUDI_V22
"enable some API extensions"
OFF)
option(GAUDI_CMT_RELEASE
"use CMT deafult release flags instead of the CMake ones"
ON)
#---Compilation Flags-----------------------------------------------------------
if(MSVC90)
add_definitions(/wd4275 /wd4251 /wd4351)
add_definitions(-DBOOST_ALL_DYN_LINK -DBOOST_ALL_NO_LIB)
......@@ -9,7 +38,7 @@ if(MSVC90)
set(CMAKE_C_FLAGS_RELEASE "/O2")
endif()
else()
set(CMAKE_CXX_FLAGS "-Dunix -pipe -ansi -Wall -Wextra -pthread -Wno-deprecated -Wwrite-strings -Wpointer-arith -Wno-long-long")
set(CMAKE_CXX_FLAGS "-Dunix -pipe -ansi -Wall -Wextra -Werror=return-type -pthread -Wno-deprecated -Wno-empty-body -pedantic -Wwrite-strings -Wpointer-arith -Woverloaded-virtual -Wno-long-long")
if(GAUDI_CMT_RELEASE)
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
set(CMAKE_C_FLAGS_RELEASE "-O2")
......@@ -21,7 +50,7 @@ if (CMAKE_SYSTEM_NAME MATCHES Linux)
set(CMAKE_CXX_FLAGS "-Dlinux ${CMAKE_CXX_FLAGS}")
endif()
#---Link shared flags--------------------------------------------------------------------------------
#---Link shared flags-----------------------------------------------------------
if (CMAKE_SYSTEM_NAME MATCHES Linux)
set(CMAKE_SHARED_LINKER_FLAGS "-Wl,--as-needed -Wl,--no-undefined -Wl,-z,max-page-size=0x1000")
set(CMAKE_MODULE_LINKER_FLAGS "-Wl,--as-needed -Wl,--no-undefined -Wl,-z,max-page-size=0x1000")
......@@ -32,36 +61,7 @@ if(APPLE)
set(CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS "${CMAKE_SHARED_LIBRARY_CREATE_CXX_FLAGS} -flat_namespace -single_module -undefined dynamic_lookup")
endif()
#---Gaudi Build Options---------------------------------------------------------
# Build options that map to compile time features
#
option(GAUDI_V21
"disable backward compatibility hacks (implies all G21_* options)"
OFF)
option(G21_HIDE_SYMBOLS
"enable explicit symbol visibility on gcc-4"
OFF)
option(G21_NEW_INTERFACES
"disable backward-compatibility hacks in IInterface and InterfaceID"
OFF)
option(G21_NO_ENDREQ
"disable the 'endreq' stream modifier (use 'endmsg' instead)"
OFF)
option(G21_NO_DEPRECATED
"remove deprecated methods and functions"
OFF)
option(G22_NEW_SVCLOCATOR
"use (only) the new interface of the ServiceLocator"
OFF)
option(GAUDI_V22
"enable some API extensions"
OFF)
option(GAUDI_CMT_RELEASE
"use CMT deafult release flags instead of the CMake ones"
OFF)
# Use the options
#---Special build flags---------------------------------------------------------
if ((GAUDI_V21 OR G21_HIDE_SYMBOLS) AND (comp MATCHES gcc4))
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden -fvisibility-inlines-hidden")
endif()
......@@ -84,14 +84,4 @@ if(NOT GAUDI_V21)
endforeach()
endif()
if(GAUDI_CMT_RELEASE)
if(MSVC90)
set(CMAKE_CXX_FLAGS_RELEASE "/O2")
set(CMAKE_C_FLAGS_RELEASE "/O2")
else()
set(CMAKE_CXX_FLAGS_RELEASE "-O2")
set(CMAKE_C_FLAGS_RELEASE "-O2")
endif()
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DBOOST_FILESYSTEM_VERSION=3")
Supports Markdown
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