FLTK logo

Re: [fltk.coredev] Regression in CMake-based build

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Regression in CMake-based build Albrecht Schlosser Aug 30, 2020  
 
On 8/30/20 8:27 PM Greg Ercolano wrote:
On 2020-08-30 11:19, Greg Ercolano wrote:
The statement at line #59 of file CMake/options.cmake is
   list (APPEND FLTK_CFLAGS "-isysroot ${CMAKE_OSX_SYSROOT}")
and this contributes to the value of CXXFLAGS at line #46 of file fltk-config which is expected to contain
"-isysroot" followed by the path to the SDK adequate for the running system.

      Since it's adding it to the path FLTK_CFLAGS whether it's set or not,
      I tried the seemingly obvious thing of making this change in CMake/options.cmake:

  if (APPLE)
    option (OPTION_APPLE_X11 "use X11" OFF)
    option (OPTION_APPLE_SDL "use SDL" OFF)
-  list (APPEND FLTK_CFLAGS "-isysroot ${CMAKE_OSX_SYSROOT}")
+  if (CMAKE_OSX_SYSROOT)
+      list (APPEND FLTK_CFLAGS "-isysroot ${CMAKE_OSX_SYSROOT}")
+  endif (CMAKE_OSX_SYSROOT)
  endif (APPLE)

      ..which I think only adds the variable if it's defined, and leaves it out if not.

      That seemed to work, as now the constructed fltk-config works.
      Not sure if that's the right solution though.

At least it seems to be better than setting it unconditionally. Manolo wrote before that some compiler commands don't need the '-isysroot' flag but we don't know exactly when this is the case and when it's needed. We should probably "trust" CMake and use it only if it's defined.

Manolo, what do you think?

--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/f51d5276-71a0-e168-9dd7-267f2999973b%40online.de.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.