CMake on Unix
Timofei Zhakov <[email protected]> Tue, 12 May 2026 18:08:23 +0200
| Newsgroups | gmane.comp.apache.apr.devel |
|---|---|
| Message-ID | <CAPD1kXSctD2m_=WKhv6wWebsS6oO67hQ33VP0B8dJqQjaOBzUg@mail.gmail.com> |
--000000000000c46f010651a11452 Content-Type: text/plain; charset="UTF-8" Hi all! There are cmake configuration files in APR's upstream that were primarily made to address complexity of building the project on Windows platform and yet it's the only one supported. I think it would be really cool to extend it to support all platforms/configurations. There are however a few things that make it complicated to implement; 1. Some platform specific code is put into dedicated subdirectories (like file_io/unix/copy.c). But it's not exactly true because if you look carefully you realise that the same copy.c is also used in Windows build. This is not related that much to the build system, but a general idea for the project, to put shared code away from */unix/. I suggest moving those files under those subdirs into the parents of unix/ (file_io/unix/copy.c -> file_io/copy.c), keeping only platform specific code there. Also for example the os2 version of copy.c simply includes the one for unix. So I believe this is something that would be an improvement to keeping things organised. I think it will be clearer when some ancient platforms are removed from upstream... I want to mention that, code from apr-util has this exact structure because there is a little difference between platforms. 2. apr.h is a complete mess right now; There are four templates that generate it and I believe some of them are outdated/unused. I want to try to make the Unix and Windows versions to be as similar to each other as possible. Perhaps we might rely on macros where different code is needed. A lot of stuff is still similar, especially in the modern days. The cmakefication will achieve that! 3. Some parts of cmake that we currently have are tied to Windows too much. I think there is some refactoring to be done to get it to work on Unix. 4. There are also some Unix specific features that are not fully implemented in cmake currently. I will be happy to try and extend cmake to work on Unix, if this feature is wanted of course. -- Timofei Zhakov --000000000000c46f010651a11452 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div>Hi=C2=A0all!</div><div><br></div><div>There are cmake= configuration files in APR's upstream that were primarily=C2=A0made to= address=C2=A0complexity of building the project on Windows platform and ye= t it's the only one supported.</div><div><br></div><div>I think it woul= d be really cool to extend it to support all platforms/configurations. Ther= e are however a few things that make it complicated to implement;</div><div= ><br></div><div>1. Some platform specific code is put into dedicated subdir= ectories (like file_io/unix/copy.c). But it's not exactly true because= =C2=A0if you look carefully you realise that=C2=A0the same copy.c is also u= sed in Windows build. This is not related that much to the build system, bu= t a general idea for the project, to put shared code away from */unix/. I s= uggest moving those files under those subdirs into the parents of unix/ (fi= le_io/unix/copy.c -> file_io/copy.c), keeping only platform=C2=A0specifi= c code there. Also for example the os2 version of copy.c simply includes th= e one for unix. So I believe this is something that would be an improvement= to keeping things organised.</div><div><br></div><div>I think it will be c= learer when some ancient platforms are removed from upstream...=C2=A0</div>= <div><br></div><div>I want to mention that, code from apr-util has this exa= ct structure because there is a little difference between platforms.</div><= div><br></div><div>2. apr.h is a complete=C2=A0mess right now; There are fo= ur templates that generate it and I believe some of them are outdated/unuse= d. I want to try to make the Unix and Windows versions to be as similar to = each other as=C2=A0possible. Perhaps we might rely on macros where differen= t code is needed. A lot of stuff is still similar, especially in the modern= days. The cmakefication will achieve=C2=A0that!</div><div><br></div><div>3= . Some parts of cmake that we currently have are tied to Windows too much. = I think there is some refactoring to be done to get it to work on Unix.</di= v><div><br></div><div>4. There are also some Unix specific features that ar= e not fully implemented in cmake currently.</div><div><br></div><div>I will= be happy to try and extend cmake to work on Unix, if this feature is wante= d of course.</div><div><br></div><span class=3D"gmail_signature_prefix">-- = </span><br><div dir=3D"ltr" class=3D"gmail_signature" data-smartmail=3D"gma= il_signature"><div dir=3D"ltr"><div>Timofei Zhakov</div></div></div></div> --000000000000c46f010651a11452--