Skip to content

Commit

Permalink
cmake: use add_compile_options for ssp-buffer-size
Browse files Browse the repository at this point in the history
In 82c8a1e I made "--param ssp-buffer-size=4" one argument instead of
two because when added to CMAKE_REQUIRED_LIBRARIES the ssp-buffer-size=4
part was being recognized as a library, breaking the compile tests.

This broke the build on mac, which I fixed in 915e2d1 by using ssp
flags for gcc only and not clang.

Now apparently it is breaking mxe, so instead of adding this particular
parameter to the MY_C_FLAGS variable which is then added to
CMAKE_REQUIRED_* variables for compile tests, add it directly via
ADD_COMPILE_OPTIONS().

This should hopefully resolve any remaining issues with this compiler
flag.
  • Loading branch information
rkitover committed Mar 14, 2017
1 parent 915e2d1 commit 2e8bee1
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,9 @@ IF(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID STREQUAL Clang)
CHECK_CXX_COMPILER_FLAG("--param ssp-buffer-size=4" SSP_BUFFER_SIZE_FLAG)

IF(SSP_BUFFER_SIZE_FLAG)
SET(MY_C_FLAGS ${MY_C_FLAGS} "--param ssp-buffer-size=4")
# we do not add it to MY_C_FLAGS because this breaks things like CMAKE_REQUIRED_LIBRARIES
# which misinterpret compiler flags without leading dashes
ADD_COMPILE_OPTIONS(--param ssp-buffer-size=4)
ENDIF()
ENDIF()
ENDIF()
Expand Down

0 comments on commit 2e8bee1

Please sign in to comment.