improving GCC flags related to the host processor and moving GNSS_SDR_VERSION definition to a better place.

git-svn-id: https://svn.code.sf.net/p/gnss-sdr/code/trunk@328 64b25241-fba3-4117-9849-534c7e92360d
This commit is contained in:
Carles Fernandez 2013-01-24 20:04:39 +00:00
parent 9192696d32
commit 4819285e5c
2 changed files with 9 additions and 8 deletions

View File

@ -433,13 +433,6 @@ include_directories(
# Set compiler flags
########################################################################
# Add compiler flags related to SSE instructions
set(MY_CXX_FLAGS "-msse2 -msse3")
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -mfpmath=sse")
# For SSE related flags, see http://gcc.gnu.org/onlinedocs/gcc-4.6.3/gcc/i386-and-x86_002d64-Options.html
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
# Enable C++11 support in GCC
# For "-std=c++0x" GCC's support for C++11 see http://gcc.gnu.org/projects/cxx0x.html
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
@ -450,6 +443,12 @@ endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
# For "-Wall" see http://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -Wall")
# Processor-architecture related flags
# See http://gcc.gnu.org/onlinedocs/gcc/i386-and-x86_002d64-Options.html#i386-and-x86_002d64-Options
# Change to '-mtune=generic' when building for distribution
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
set(MY_CXX_FLAGS "${MY_CXX_FLAGS} -march=native -mfpmath=sse")
endif(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
if(CMAKE_COMPILER_IS_GNUCXX AND NOT WIN32)
#http://gcc.gnu.org/wiki/Visibility
@ -473,7 +472,7 @@ endif( CMAKE_SIZEOF_VOID_P EQUAL 8 )
list(APPEND CMAKE_CXX_FLAGS ${MY_CXX_FLAGS})
add_definitions( -DGNSS_SDR_VERSION="${VERSION}" )
#add_definitions( -DGNSS_SDR_VERSION="${VERSION}" )
########################################################################
# Add subdirectories (in order of deps)

View File

@ -27,6 +27,8 @@ include_directories(
${ARMADILLO_INCLUDE_DIRS}
)
add_definitions( -DGNSS_SDR_VERSION="${VERSION}" )
add_executable(gnss-sdr ${CMAKE_CURRENT_SOURCE_DIR}/main.cc)
target_link_libraries(gnss-sdr ${Boost_LIBRARIES} ${GLOG_LIBRARIES} ${GFlags_LIBS} ${ARMADILLO_LIBRARIES} gnss_sp_libs gnss_rx)