Re: [ft] Fw: Could you help me for debugging FreeType library?

2019-05-03 Thread J Decker
On Fri, May 3, 2019 at 6:14 PM Lawrence D'Oliveiro 
wrote:

> On Fri, 3 May 2019 03:00:25 +, suzuki toshiya wrote:
>
> > BTW, does cmake have any hardwired database for
> > the available flags for each compilers? I can check
> > for gcc and clang, but I'm not sure about other
> > proprietary compilers...
>
> I thought most C compilers supported at least some small core of
> GCC-compatible flags, including “-g” for generating debugging symbols
> and “-D” for defining preprocessor symbols that can be queried in the
> code. Plus of course the usual ones for specifying library and include
> paths. You can do a lot with just these.
>

Re CMake

Yes, and generally cmake provides those with the default flags by
compiler/generator/toolchain file.

[Dd][Ee][Bb][Uu][Gg]  includes -g , no optimization, and default flags if
the compiler uses them (_DEBUG)
[Rr][Ee][Ll][Ee][Aa][Ss][Ee] includes optimization, does not comiple with
symbols, and would be (NDEBUG)
RelWithDebInfo - includes optimization, but also debug information
MinSize - Extra optimzation, no symbols/debugging.

Unfortunatly, RelWithDebInfo on MSVC does also include multi-threaded-debug
runtime, so it's not very 'Release'.  This can be overridden...

But generally the default flags for compiler/generator selected in cmake
switch with CMAKE_BUILD_TYPE

There are Visutal Studio/Xcode/... multi-configuration generators, but they
don't really support multiple install outputs, so it's almost always
easiest to just make a new build per configuration like makefiles and only
build the appropriate configuration for that target.

(I wonder if there's somehow a way to disable generation of parallel
targets)

I find that with VS now, even Release gets PDB debugging information
associated with it so you can debug/step through things you've compiled.





>
> ___
> Freetype mailing list
> Freetype@nongnu.org
> https://lists.nongnu.org/mailman/listinfo/freetype
>
___
Freetype mailing list
Freetype@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] Fw: Could you help me for debugging FreeType library?

2019-05-03 Thread Lawrence D'Oliveiro
On Fri, 3 May 2019 03:00:25 +, suzuki toshiya wrote:

> BTW, does cmake have any hardwired database for
> the available flags for each compilers? I can check
> for gcc and clang, but I'm not sure about other
> proprietary compilers...

I thought most C compilers supported at least some small core of
GCC-compatible flags, including “-g” for generating debugging symbols
and “-D” for defining preprocessor symbols that can be queried in the
code. Plus of course the usual ones for specifying library and include
paths. You can do a lot with just these.

___
Freetype mailing list
Freetype@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] Fw: Could you help me for debugging FreeType library?

2019-05-03 Thread suzuki toshiya
BTW, recent macOS does not ship gdb as a part of their SDK anymore,
and it seems that they have switched to lldb. are you using gdb?

Regards,
mpsuzuki

suzuki toshiya wrote:
> Hi,
> 
> It seems that cmake experts have left FreeType, so I try to respond
> you although I'm not an expert.
> 
> The shortest response would be: "CMakeLists.txt of FreeType does not
> support Debug build, so your attempt would not work". Nothing to say,
> the maintainers would welcome the proposal of patch, could you draft
> something?
> 
> --
> following is longer response.
> 
> My first question is: cmake has any predefined compiler flag set for
> CMAKE_C_FLAGS_DEBUG? By brief checking of cmake manual, it seems that
> the effect of CMAKE_BUILD_TYPE "Debug" is only the reflection of the
> CMAKE_C_FLAGS_DEBUG option in the compilation. I cannot find any
> predefined set of CMAKE_C_FLAGS_DEBUG from the manual, and in my
> experiment on macOS, no typical debug options like "-g" is given to.
> I'm afraid default value of CMAKE_C_FLAGS_DEBUG is empty, so, nothing
> special happened (please try "make VERBOSE=1" to check the commands
> are being issued).
> 
> In my impression, expecting "I set CMAKE_BUILD_TYPE to Debug, so the
> softwares should be built for debug mode" is something like a person
> wondering as "I changed the suffix of teacup.txt from txt to jpg, so
> I get teacup.jpg, but my browser does not show the picture of teacup.
> why?". In the package of the softwares whose CMakeLists.txt is ready
> for debug build, -DCMAK_BUILD_TYPE=Debug might work, but FT is not such.
> 
> Regards,
> mpsuzuki
> 
> Werner LEMBERG wrote:
>> Please help this guy.
>>
>>
>> Werner
>>
>>
>> 
> 
>> Hi Werner Lemberg:
>>
>> I am work focus rendering 2d text ,so I want to study your Project 
>> "FreeType",
>>
>> so I write a program ,use it to test "FreeType".
>>
>>
>> First of all,I git sources of FreeType,compile it to libfreetype.dylib on 
>> MacOS use Cmake:
>>
>>
>> I modified CMakeLists.txt of FreeType and add a line :
>>
>> SET(CMAKE_BUILD_TYPE "Debug")
>>
>> then use cmake compile,
>> ---?
>> mkdir build
>> cd build
>> cmake -D BUILD_SHARED_LIBS:BOOL=true ..
>> make
>> sudo make install?
>> ---
>>
>>
>>
>> Second I write a  test program  on MacOS.
>>
>>
>>
>>
>> But I can't use gdb by command line to debugging into libfreetype.dylib!
>>
>>
>> Can you help me ?
>>
>>
>> Thans a lot.
>>
>>
>> Best regards.
>>
>>
>> 韩忠涛
>> 终端网络部  大播放内核
>>
>> 爱奇艺公司   iQIYI, Inc.
>> 地址:北京市海淀区中关村大街甲1号鼎好电子大厦A座9层
>> 邮编:100080
>> 手机:+86 13661073959
>> 邮箱:hanzhong...@qiyi.com
>>
> ___
> Freetype mailing list
> Freetype@nongnu.org
> https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.nongnu.org%2Fmailman%2Flistinfo%2Ffreetypedata=02%7C01%7Cmpsuzuki%40hiroshima-u.ac.jp%7C89e61235c42f40cbd86908d6cf6cbeb3%7Cc40454ddb2634926868d8e12640d3750%7C1%7C0%7C636924463304892298sdata=LkqlJH350kDkkVlRYUTtyLv5UCneCrNmEoqPA8jPyiw%3Dreserved=0
___
Freetype mailing list
Freetype@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] Fw: Could you help me for debugging FreeType library?

2019-05-02 Thread suzuki toshiya
Dear Lawrence,

> if (NOT CMAKE_BUILD_TYPE MATCHES "Release")
> ... set various compiler flags ...
> endif()

Indeed, indeed, indeed. I guess the definition of
appropriate compiler flags for each build type is
the responsibility of the author of CMakeLists.txt.

BTW, does cmake have any hardwired database for
the available flags for each compilers? I can check
for gcc and clang, but I'm not sure about other
proprietary compilers...

Regards,
mpsuzuki

Lawrence D'Oliveiro wrote:
> On Fri, 3 May 2019 02:11:30 +, suzuki toshiya wrote:
> 
>> It seems that cmake experts have left FreeType, so I try to respond
>> you although I'm not an expert.
> 
> I’ve done a little bit of messing about with CMake. While
> CMAKE_BUILD_TYPE is a standard variable
> ,
>  I
> think its meaning is mostly up to the build scripts. For example, in
> the Blender source tree, you see things like
> :
> 
> if (NOT CMAKE_BUILD_TYPE MATCHES "Release")
> ... set various compiler flags ...
> endif()
> 
> ___
> Freetype mailing list
> Freetype@nongnu.org
> https://jpn01.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.nongnu.org%2Fmailman%2Flistinfo%2Ffreetypedata=02%7C01%7Cmpsuzuki%40hiroshima-u.ac.jp%7C5facb857072847f399d408d6cf729acd%7Cc40454ddb2634926868d8e12640d3750%7C1%7C0%7C636924488476379322sdata=BNad5iCJ4a6l1dwykzsdgUTivzTEutwuXPWjgbldQ2M%3Dreserved=0

___
Freetype mailing list
Freetype@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] Fw: Could you help me for debugging FreeType library?

2019-05-02 Thread Lawrence D'Oliveiro
On Fri, 3 May 2019 02:11:30 +, suzuki toshiya wrote:

> It seems that cmake experts have left FreeType, so I try to respond
> you although I'm not an expert.

I’ve done a little bit of messing about with CMake. While
CMAKE_BUILD_TYPE is a standard variable
, I
think its meaning is mostly up to the build scripts. For example, in
the Blender source tree, you see things like
:

if (NOT CMAKE_BUILD_TYPE MATCHES "Release")
... set various compiler flags ...
endif()

___
Freetype mailing list
Freetype@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype


Re: [ft] Fw: Could you help me for debugging FreeType library?

2019-05-02 Thread suzuki toshiya
Hi,

It seems that cmake experts have left FreeType, so I try to respond
you although I'm not an expert.

The shortest response would be: "CMakeLists.txt of FreeType does not
support Debug build, so your attempt would not work". Nothing to say,
the maintainers would welcome the proposal of patch, could you draft
something?

--
following is longer response.

My first question is: cmake has any predefined compiler flag set for
CMAKE_C_FLAGS_DEBUG? By brief checking of cmake manual, it seems that
the effect of CMAKE_BUILD_TYPE "Debug" is only the reflection of the
CMAKE_C_FLAGS_DEBUG option in the compilation. I cannot find any
predefined set of CMAKE_C_FLAGS_DEBUG from the manual, and in my
experiment on macOS, no typical debug options like "-g" is given to.
I'm afraid default value of CMAKE_C_FLAGS_DEBUG is empty, so, nothing
special happened (please try "make VERBOSE=1" to check the commands
are being issued).

In my impression, expecting "I set CMAKE_BUILD_TYPE to Debug, so the
softwares should be built for debug mode" is something like a person
wondering as "I changed the suffix of teacup.txt from txt to jpg, so
I get teacup.jpg, but my browser does not show the picture of teacup.
why?". In the package of the softwares whose CMakeLists.txt is ready
for debug build, -DCMAK_BUILD_TYPE=Debug might work, but FT is not such.

Regards,
mpsuzuki

Werner LEMBERG wrote:
> Please help this guy.
> 
> 
> Werner
> 
> 
> 

> Hi Werner Lemberg:
> 
> I am work focus rendering 2d text ,so I want to study your Project "FreeType",
> 
> so I write a program ,use it to test "FreeType".
> 
> 
> First of all,I git sources of FreeType,compile it to libfreetype.dylib on 
> MacOS use Cmake:
> 
> 
> I modified CMakeLists.txt of FreeType and add a line :
> 
> SET(CMAKE_BUILD_TYPE "Debug")
> 
> then use cmake compile,
> ---?
> mkdir build
> cd build
> cmake -D BUILD_SHARED_LIBS:BOOL=true ..
> make
> sudo make install?
> ---
> 
> 
> 
> Second I write a  test program  on MacOS.
> 
> 
> 
> 
> But I can't use gdb by command line to debugging into libfreetype.dylib!
> 
> 
> Can you help me ?
> 
> 
> Thans a lot.
> 
> 
> Best regards.
> 
> 
> 韩忠涛
> 终端网络部  大播放内核
> 
> 爱奇艺公司   iQIYI, Inc.
> 地址:北京市海淀区中关村大街甲1号鼎好电子大厦A座9层
> 邮编:100080
> 手机:+86 13661073959
> 邮箱:hanzhong...@qiyi.com
> 
___
Freetype mailing list
Freetype@nongnu.org
https://lists.nongnu.org/mailman/listinfo/freetype