Is it currently only possible to run with Release and Debug instead of the CMake specific build types (including RelWithDebugInfo etc)
So using the predefined cmake build types or adding custom build types requires to change the engine
CocosConfigDefine.cmake file, which is a little bit annoying.
Currently I can only find the Debug option being disabled or enabled which automatically generates the CMAKE_CONFIGURATION_TYPE, so you can’t set the types your self, except you change it in the CocosConfigDefine.cmake
Or you changes the predefined CMAKE flags.
Let me know if there is another way.
In fact, you can’t switch build type to RelWithDebugInfo
or something like.
One limit is just like you said CocosConfigDefine.cmake
have finger it out clearly, that’s Debug
and Release
:
if(CMAKE_CONFIGURATION_TYPES)
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Reset the configurations to what we need" FORCE)
message(STATUS "CMAKE_CONFIGURATION_TYPES: ${CMAKE_CONFIGURATION_TYPES}")
Another is most of the prebuilt external libs existed only Release
build, seldom existed Debug
and Release
, and no one using RelWithDebugInfo
. For both build type we defined like:
if(WINDOWS)
set_target_properties(${target_name} PROPERTIES
# need use absolutely path
IMPORTED_LOCATION_DEBUG "${platform_spec_path}/debug/lib${lib_name}.lib"
IMPORTED_LOCATION_RELEASE "${platform_spec_path}/release/lib${lib_name}.lib"
)
else()
set_target_properties(${target_name} PROPERTIES
IMPORTED_LOCATION "${platform_spec_path}/lib${lib_name}.a"
)
endif()
By the way, may I ask why the RelWithDebugInfo
is needed?
I’m currently having some issues on a apple release build where debug works fine. Therefore debug symbols would be great which are generated with -g . Atm I just add the flag to “Release” so it behaves like RelWithDebug. Obviously this resets when I create a new build, therefore isn’t the best solution.