filipwasil / ios-cmake

Automatically exported from code.google.com/p/ios-cmake
0 stars 0 forks source link

warning: argument unused during compilation: '-headerpad_max_install_names' #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
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

GoogleCodeExporter commented 9 years ago
Fixed, thanks.

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