contextgarden / luametatex

Temporary/draft repository with luametatex
30 stars 6 forks source link

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

Open barracuda156 opened 1 week ago

barracuda156 commented 1 week ago
[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()
barracuda156 commented 1 week ago

This also does not work:

/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 -S -d -x luametatex
error: /opt/local/bin/strip: can't open: -x (No such file or directory)
make[2]: *** [luametatex] Error 1
barracuda156 commented 1 week ago

Apparently it just should not be done at all:

/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 -S -d luametatex
fatal error: /opt/local/bin/strip: no files specified
make[2]: *** [luametatex] Error 1