cmake: Remove invalid clang syntax

Clang compiler uses the same syntax for sending flags to the linker as
gcc.  If we use -XLinker, we can't use comma-separated options but
there appears to be no reason to anyway.  Removes extra warning quieting
that was added for compiling Boost in tree.
This commit is contained in:
Seth Hillbrand 2019-03-07 13:59:18 -08:00
parent b6916c490c
commit 6eb84e42f2
1 changed files with 14 additions and 31 deletions

View File

@ -266,7 +266,7 @@ endif(USE_CCACHE)
#================================================
# Provide access to CCACHE
# Provide access to DISTCC
#================================================
if (USE_DISTCC)
find_program(DISTCC_FOUND distcc)
@ -287,18 +287,9 @@ endif(USE_DISTCC)
if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
execute_process( COMMAND ${CMAKE_C_COMPILER} -dumpversion
OUTPUT_VARIABLE GCC_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE )
if( CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
set( TO_LINKER -XLinker )
else()
set( TO_LINKER -Wl )
# Set 32-bit flag for GCC to prevent excess precision
if( CMAKE_SIZEOF_VOID_P EQUAL 4 )
set( CMAKE_CXX_FLAGS "-ffloat-store ${CMAKE_CXX_FLAGS}" )
endif()
# Set 32-bit flag for GCC to prevent excess precision
if( CMAKE_SIZEOF_VOID_P EQUAL 4 )
set( CMAKE_CXX_FLAGS "-ffloat-store ${CMAKE_CXX_FLAGS}" )
endif()
# Establish -Wall early, so specialized relaxations of this may come
@ -347,29 +338,21 @@ if( CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
# snprintf
add_definitions(-D__USE_MINGW_ANSI_STDIO=1)
else()
if( NOT APPLE )
# Thou shalt not link vaporware and tell us it's a valid DSO (apple ld doesn't support it)
set( CMAKE_SHARED_LINKER_FLAGS "${TO_LINKER},--no-undefined" )
set( CMAKE_MODULE_LINKER_FLAGS "${TO_LINKER},--no-undefined" )
elseif( NOT APPLE )
# Thou shalt not link vaporware and tell us it's a valid DSO (apple ld doesn't support it)
set( CMAKE_SHARED_LINKER_FLAGS "-Wl,--no-undefined" )
set( CMAKE_MODULE_LINKER_FLAGS "-Wl,--no-undefined" )
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" )
set( CMAKE_EXE_LINKER_FLAGS_RELEASE "-s" )
# Defeat ELF's ability to use the GOT to replace locally implemented functions
# with ones from another module.
# https://bugs.launchpad.net/kicad/+bug/1322354
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} ${TO_LINKER},-Bsymbolic" )
set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${TO_LINKER},-Bsymbolic" )
endif()
# Defeat ELF's ability to use the GOT to replace locally implemented functions
# with ones from another module.
# https://bugs.launchpad.net/kicad/+bug/1322354
set( CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-Bsymbolic" )
set( CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} -Wl,-Bsymbolic" )
endif()
# quiet GCC while in boost
if( GCC_VERSION VERSION_GREATER 4.8 OR GCC_VERSION VERSION_EQUAL 4.8 OR CMAKE_CXX_COMPILER_ID MATCHES "Clang" )
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-unused-local-typedefs" )
endif()
set( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-strict-aliasing" )
if( APPLE )
set( CMAKE_LD_FLAGS "${CMAKE_LD_FLAGS} -headerpad_max_install_names") # needed by fixbundle
endif()