Just noted on the Apple platform that the fix does not get picked up there. The 
reason being that
CMake seems to take the case of the value as supplied on the command line (e.g. 
"Release") and the
fix currently compares to uppercase "RELEASE".

Here the suggested patch (also enclosed as a file attachment):

    Index: CMakeLists.txt
    ===================================================================
    --- CMakeLists.txt      (revision 12337)
    +++ CMakeLists.txt      (working copy)
    @@ -351,8 +351,12 @@
                 -DORX_SYSTEM_PROCESSOR="${CMAKE_SYSTEM_PROCESSOR}"
                 -DORX_REXXPATH="${CMAKE_REXXPATH}"
                 -D${ORX_SYS_STR} -DOPSYS_${ORX_SYS_STR} -DHAVE_CONFIG_H)
    -    if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
    -        add_definitions(-D_DEBUG)
    +
    +    # CMAKE_BUILD_TYPE (predefined: "Debug", "DebWithRelInfo", "Release", 
"MinSizeRel") can be in any case
    +    string(TOUPPER ${CMAKE_BUILD_TYPE} tmpBuildType)
    +    string(FIND ${tmpBuildType} "DEB" tmpDebPos)
    +    if (${tmpDebPos} GREATER_EQUAL 0) # if DEB fragment it is a debug 
version
    +       add_definitions(-D_DEBUG)
         endif ()
         set (ORX_SYSLIB_DL ${CMAKE_DL_LIBS})
         set (ORX_SYSLIB_PTHREAD pthread)

As CMake defines four build types [1],  where the debug versions have the 
string "deb" ("Debug",
"DebWithRelInfo") contained the suggested patch looks for "DEB" in the build 
type and if present
sets _DEBUG, otherwise not. This allows "MinSizeRel" (a release version) to be 
correctly attributed
as a release as well as "Release".

Tested the suggested patch on Apple and Linux with all four build types and 
checked that
.rexxinfo~debug yields .true in the case of "Debug" and "DebWithRelInfo", and 
that it yields .false
in the case of "Release" and "MinSizeRel".

---rony

[1]: <https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html>


On 02.12.2021 19:22, Erich Steinböck wrote:
> I just fixed the missing _DEBUG define for non-Windows builds with revision 
> [r12334].
>
> On Mon, Nov 29, 2021 at 5:08 PM Rick McGuire <[email protected]
> <mailto:[email protected]>> wrote:
>
>     It looks like the _DEBUG_ flag is only getting set for the Windows build 
> and not the others.
>     This is likely a CmakeList.txt problem that effects more than just rexx 
> -v.  
>
>     Rick
>

Index: CMakeLists.txt
===================================================================
--- CMakeLists.txt      (revision 12337)
+++ CMakeLists.txt      (working copy)
@@ -351,8 +351,12 @@
             -DORX_SYSTEM_PROCESSOR="${CMAKE_SYSTEM_PROCESSOR}"
             -DORX_REXXPATH="${CMAKE_REXXPATH}"
             -D${ORX_SYS_STR} -DOPSYS_${ORX_SYS_STR} -DHAVE_CONFIG_H)
-    if (NOT "${CMAKE_BUILD_TYPE}" STREQUAL "RELEASE")
-        add_definitions(-D_DEBUG)
+
+    # CMAKE_BUILD_TYPE (predefined: "Debug", "DebWithRelInfo", "Release", 
"MinSizeRel") can be in any case
+    string(TOUPPER ${CMAKE_BUILD_TYPE} tmpBuildType)
+    string(FIND ${tmpBuildType} "DEB" tmpDebPos)
+    if (${tmpDebPos} GREATER_EQUAL 0) # if DEB fragment it is a debug version
+       add_definitions(-D_DEBUG)
     endif ()
     set (ORX_SYSLIB_DL ${CMAKE_DL_LIBS})
     set (ORX_SYSLIB_PTHREAD pthread)
_______________________________________________
Oorexx-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to