PoL0 / ios-cmake

Automatically exported from code.google.com/p/ios-cmake

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

warning: argument unused during compilation: '-headerpad_max_install_names'

GoogleCodeExporter opened this issue · comments

When I use the iOS toolchain to build any applications, I'm getting the warning

warning: argument unused during compilation: '-headerpad_max_install_names'

on the compilation of every .cpp file in my projects. Looking more into what it 
is, it seems that it's a linker flag instead of a compiler flag. I think the 
directive has been misplaced in the ios toolchain by accident. That is, instead 
of lines

set (CMAKE_CXX_FLAGS_INIT "-headerpad_max_install_names -fvisibility=hidden 
-fvisibility-inlines-hidden")

set (CMAKE_C_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}")
set (CMAKE_CXX_LINK_FLAGS "-Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}")

it should probably read

set (CMAKE_CXX_FLAGS_INIT "-fvisibility=hidden -fvisibility-inlines-hidden")

set (CMAKE_C_LINK_FLAGS "-headerpad_max_install_names -Wl,-search_paths_first 
${CMAKE_C_LINK_FLAGS}")
set (CMAKE_CXX_LINK_FLAGS "-headerpad_max_install_names -Wl,-search_paths_first 
${CMAKE_CXX_LINK_FLAGS}")

That change resolves the warning for me.

Original issue reported on code.google.com by juj...@gmail.com on 16 Jun 2014 at 2:26

Fixed, thanks.

Original comment by wizzr...@gmail.com on 24 Jul 2014 at 9:01

  • Changed state: Fixed