Skip to content

CMakeLists use unsupported flags for strip on macOS: /opt/local/bin/strip: unrecognized option: -g #14

Description

@barracuda156
[100%] Linking C executable luametatex
/opt/local/bin/cmake -E cmake_link_script CMakeFiles/luametatex.dir/link.txt --verbose=ON
/opt/local/bin/gcc-mp-13 -pipe -Os -DNDEBUG -arch ppc -mmacosx-version-min=10.6 -Wl,-search_paths_first -Wl,-headerpad_max_install_names -L/opt/local/lib -Wl,-headerpad_max_install_names CMakeFiles/luametatex.dir/source/luametatex.c.o -o luametatex  -Wl,-rpath,/opt/local/lib libtex.a liblua.a libmp.a libluarest.a libluasocket.a libluaoptional.a libpplib.a libminiz.a libsoftposit.a libpotrace.a -lm
/opt/local/bin/strip -g -S -d -x luametatex
error: /opt/local/bin/strip: unrecognized option: -g
Usage: /opt/local/bin/strip [-AnuSXx] [-] [-d filename] [-s filename] [-R filename] [-o output] file [...] 
make[2]: *** [luametatex] Error 1

Perhaps someone assumed that GCC = Linux here:

elseif (CMAKE_C_COMPILER_ID MATCHES "GNU")
    # -g -S -d : remove all debugging symbols & sections
    # -x       : remove all non-global symbols
    # -X       : remove any compiler-generated symbols
    add_custom_command(TARGET luametatex POST_BUILD COMMAND ${CMAKE_STRIP} -g -S -d -x luametatex${CMAKE_EXECUTABLE_SUFFIX})
endif()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions