sot-tech / LottieConverter

Simple, dummy lottie converter
BSD 3-Clause "New" or "Revised" License
27 stars 4 forks source link

Overrides CFLAGS / CXXFLAGS #7

Closed Richard-Rogalski closed 1 year ago

Richard-Rogalski commented 1 year ago

So, in CMakeLists,

if (CMAKE_BUILD_TYPE EQUAL "RELEASE")
    set(COMPILE_PARAMS ${COMPILE_PARAMS} -O2)
else (CMAKE_BUILD_TYPE)
    set(COMPILE_PARAMS ${COMPILE_PARAMS} -O0 -g3)
endif ()

The first problem I see here is that (as far as I can tell) RelWithDebugInfo does not actually use release flags, as everything that is not Release is basically Debug.

The second more important issue is that this does not respect the user's (or distro packager's) flags set explicitly in the CFLAGS & CXXFLAGS environment variables. One easy solution is to put your flags, for example -O2 and -O0 -g3 before ${COMPILE_PARAMS}, but according to someone I know this is still a suboptimal approach :)

sot-tech commented 1 year ago

Hello @Richard-Rogalski.

Honestly, i do not remember exactly why i used custom BUILD_TYPE (may be to set -g3 instead of default -g for debug).

Now cmake will use default presets, check it out, please.

sot-tech commented 1 year ago

Closed due to inactivity.