Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Boost detection more reliable; strip symbols for Release builds #7

Merged
merged 2 commits into from
Feb 15, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 26 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,25 @@ SET (CMAKE_MODULE_PATH ${GATB_CORE_HOME}/cmake)
# One can uncomment this line and set the wanted values
set (KSIZE_LIST "32 64 96 128")

################################################################################
# TOOLS
################################################################################

# Find Boost (do this before setting up GATB)
if( NOT BOOST_ROOT )
# Use the host's preferred installation prefix (from the shell)
if( DEFINED ENV{BOOST_ROOT} )
set( BOOST_ROOT $ENV{BOOST_ROOT} )
message( "Got BOOST_ROOT from shell variable" )
else()
set(BOOST_ROOT /usr/bin/include)
endif()
endif()
message( "Find Boost at BOOST_ROOT=\"${BOOST_ROOT}\"" )
set(Boost_USE_STATIC_LIBS ON)
FIND_PACKAGE(Boost 1.69.0 COMPONENTS program_options filesystem system regex iostreams REQUIRED)
include_directories(${Boost_INCLUDE_DIR})

################################################################################
# THIRD PARTIES
################################################################################
Expand All @@ -59,17 +78,15 @@ execute_process(COMMAND git apply ${PROJECT_SOURCE_DIR}/0001-Fix-for-boost-inclu
WORKING_DIRECTORY ${GATB_CORE_HOME})

# GATB CORE
# At minimum this part needs to come after finding Boost, in order to reliably get the correct version
include (GatbCore)

################################################################################
# TOOLS
################################################################################

# find Boost
set(BOOST_ROOT /usr/bin/include)
set(Boost_USE_STATIC_LIBS ON)
FIND_PACKAGE(Boost 1.69.0 COMPONENTS program_options filesystem system regex iostreams REQUIRED)
include_directories(${Boost_INCLUDE_DIR})
# Linker options -- strip symbols to make a smaller binary for Release builds
if("${CMAKE_CXX_COMPILER_ID}" MATCHES "GNU")
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wl,--strip-all" )
elseif("${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang")
set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -Wl,-s" )
endif()

# cdbg-ops target
set (PROGRAM cdbg-ops)
Expand Down