Re: [Oorexx-devel] Building ooRexx with Debug

2019-01-04 Thread Enrico Sorichetti via Oorexx-devel
The build types as defined by CMAKE provide as a courtesy to the developer
A set of predefined flags for the compiler and the linker 

CMAKE_C_FLAGS=''
CMAKE_C_FLAGS_DEBUG='-g'
CMAKE_C_FLAGS_MINSIZEREL='-Os -DNDEBUG'
CMAKE_C_FLAGS_RELEASE='-O3 -DNDEBUG'
CMAKE_C_FLAGS_RELWITHDEBINFO='-O2 -g -DNDEBUG'

CMAKE_CXX_FLAGS=''
CMAKE_CXX_FLAGS_DEBUG='-g'
CMAKE_CXX_FLAGS_MINSIZEREL='-Os -DNDEBUG'
CMAKE_CXX_FLAGS_RELEASE='-O3 -DNDEBUG'
CMAKE_CXX_FLAGS_RELWITHDEBINFO='-O2 -g -DNDEBUG'

An equivalent set of flags are provided for the linker 

You are free to define Your own build types 
As long as You define the same set of flags with the last token set
To the build type name 

CMAKE does not check the build type, 
Specifying an unknown build type  implies that no specific flags will be 
provided 

Enrico

  
Ps 

Find attached a function that will dump all the known CMAKE variables
At time of invocation

It will help in finding out the values of little known variables 

#[[ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
vDump.cmake
Copyright Enrico Sorichetti 2018 - 2019
Distributed under the Boost Software License, Version 1.0.
(See accompanying file LICENSE_1_0.txt or copy at
http://www.boost.org/LICENSE_1_0.txt)
#]]

#[[ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#]]
include_guard( GLOBAL )

#[[ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#]]
function( vdump _ARGlist _ARGline )

if( ${_ARGline} MATCHES   "^[0-9]+$" )
set( _line "${_ARGline}" )
string( LENGTH "${_line}"  _len )
math( EXPR _indx "${_len} - 4" )
string(SUBSTRING ${_line} ${_indx} -1 _line )
else()
string( REGEX REPLACE "[^a-zA-Z0-9_]" "_" _line  "${_ARGline}" )
endif()

get_filename_component( _list "${_ARGlist}" NAME_WE)
if( "${_line}" STREQUAL "" )
string( REGEX REPLACE "[^a-zA-Z0-9_]" "_"
_out "vars_for_${_list}")
else()
string( REGEX REPLACE "[^a-zA-Z0-9_]" "_"
_out "vars_for_${_list}_at_${_line}")
endif()

set( _out "${CMAKE_BINARY_DIR}/${_out}.txt" )
file( REMOVE ${_out} )

set( _buf "" )

get_cmake_property( _vars VARIABLES )

foreach( _var IN LISTS _vars )
string( LENGTH "${_var}"  _len )
if( _len LESS 4 )
continue()
endif()
if( "${_var}" MATCHES "^(_)" )
continue()
endif()
if( "${_var}" MATCHES "^(ARG)" )
continue()
endif()
if( "${_var}" STREQUAL "OUTPUT" )
continue()
endif()
if( "${_var}" MATCHES "(_CONTENT)$" )
continue()
endif()
if( "${_var}" MATCHES "(_COMPILER_ID_TOOL_MATCH_REGEX)$" )
continue()
endif()

string( APPEND _buf "[[ ${_var}='${${_var}}'\n" )
endforeach()

file( WRITE "${_out}" "${_buf}" )

endfunction()


Just invoke it with 

vdump( ${CMAKE_CURRENT_LIST_FILE} "${CMAKE_CURRENT_LIST_LINE}” )



> On 4 Jan 2019, at 20:53, P.O. Jonsson  wrote:
> 
> I think this is related to the question "Questions ad differences between 
> "RELEASE", "DEBUG" and "RELWITHDEBUGINFO" on Windows?“ asked by Rony  4 Dec 
> 2018, It would be most welcome to have this clarified on all platforms (what 
> switches and where do they interact with the build process).
> 
> I have tried to read cmakelists.txt for answers but does not get me any wiser 
> :-(.
> 
> Hälsningar/Regards/Grüsse,
> P.O. Jonsson
> oor...@jonases.se 
> 
___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel


Re: [Oorexx-devel] Building ooRexx with Debug

2019-01-04 Thread P.O. Jonsson
I think this is related to the question "Questions ad differences between 
"RELEASE", "DEBUG" and "RELWITHDEBUGINFO" on Windows?“ asked by Rony  4 Dec 
2018, It would be most welcome to have this clarified on all platforms (what 
switches and where do they interact with the build process).

I have tried to read cmakelists.txt for answers but does not get me any wiser 
:-(.

Hälsningar/Regards/Grüsse,
P.O. Jonsson
oor...@jonases.se




> Am 04.01.2019 um 17:04 schrieb P.O. Jonsson :
> 
> I have been writing a MAC version of the WIKI text found here 
>  and I am almost done. I have 
> found what I think is a typo in the text for Windows and Ubuntu. In the 
> sections CMake 
>  and 
> CMake_1  
> you find this text:
> 
> When building a release version, use -DCMAKE_BUILD_TYPE=RELEASE, 
> when building a release version with debug information, use 
> -DCMAKE_BUILD_TYPE=RELWITHDEBUGINFO.
> The default is -DCMAKE_BUILD_TYPE=DEBUG for a debug version.
> 
> I think  RELWITHDEBUGINFO should be changed to RELWITHDEBINFO ? should I make 
> a bug report for the WIKI? The same goes for the text in how-to-debug-oorexx 
> 
> 
> 
> The reason I ask is that I have the problem that Valgrind (the debugger on 
> MAC) complains that it can not find debug symbols in the executables:
> 
> --25154-- run: /usr/bin/dsymutil "/Users/po/Applications/ooRexx5.0.0/bin/rexx"
> warning: no debug symbols in executable (-arch x86_64)
> --25154-- run: /usr/bin/dsymutil 
> "/Users/po/Applications/ooRexx5.0.0/lib/librexx.5.0.0.dylib"
> warning: no debug symbols in executable (-arch x86_64)
> --25154-- run: /usr/bin/dsymutil 
> "/Users/po/Applications/ooRexx5.0.0/lib/librexxapi.5.0.0.dylib"
> warning: no debug symbols in executable (-arch x86_64)
> 
> I can see that the executable (Rexx) increases in size and rexxcps reports 
> lesser performance for all non-RELEASE versions but the debug symbols are 
> only present in BUILD_TYPE=DEBUG. Can someone enlighten me on the correct 
> settings to get a release version WITH debug information for MAC?
> 
> Here are the settings I have tried so far:
> 
> # Installing to ~/Applications (default)
> # cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=RELEASE ../oorexxSVN
> # cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=RELWITHDEBUGINFO ../oorexxSVN
> # cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=RELWITHDEBINFO ../oorexxSVN
> # cmake -G "Unix Makefiles" -DCMAKE_BUILD_TYPE=DEBUG ../oorexxSVN
> # cmake -G "Unix Makefiles" ../oorexxSVN
> 
> Hälsningar/Regards/Grüsse,
> P.O. Jonsson
> oor...@jonases.se 
> 
> 
> 
> ___
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel

___
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel