Re: WIP: About CMake v2

From: Yuriy Zhuravlev <stalkerg(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
Subject: Re: WIP: About CMake v2
Date: 2016-12-30 14:10:45
Message-ID: CANiD2e_tBS869MHRBUTvUq874mxbG3SkE2_PBO2C4TuWxcXEXQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hello hackers.

----

I think you notice what I changed email, it is happened because I quit from
PgPro.

Good news is that I have time to work on CMake. Bad news I have to find a
new job. ;)

----

What is new in that patchset:

1.

I separated changes to several patches. Main patch include only new
CMake files without postgres files changes.
2.

I cleaned all the unnecessary postgres changes.
3.

I update cmake with latest master, add STRONG_RANDOM option and etc.
4.

Add small document about CMake and Postgres. (README.cmake bad idea for
name but I think now it’s ok)
5.

I have stopped use gendef.pl for MSVC build.
6.

Fix for AIX 7.1

About patches:

cmake_v2_1_main_files.patch

Only CMake files. CMakeFiles.txt is main files with rules. *.cmake is
special modules with macros and functions. *.in is template for generate
headers. (like autoconf)

cmake_v2_2_c_define.patch

Small chages in c.h . At first it is “#pragma fenv_access (off)” it is
necessary if we use /fp:strict for MSVC compiler. Without this pragma we
can’t calc floats for const variables in compiller time (2 * M_PI for
example). Strict mode important if we want to be close with ieee754 float
format on MSVC (1.0 / 0.0 = inf for example). Detail info here:
https://msdn.microsoft.com/en-us/library/e7s85ffb.aspx

Second change is because I find and set HAVE_INT128 directly from CMake.
PG_INT128_TYPE used only for autoconfig scripts.

cmake_v2_3_rijndael.patch

First I added special wraparound because here CMake have circular
dependency (cmake very smart here). Second I removed rijndael.tbl because
it generated during build process every time.

cmake_v2_4_uuid.patch

Another small patch. Right place for uuid.h I find by CMake and not
necessary this ifdef hell.

cmake_v2_5_readme.patch

Small exercise to CMake world for all who want to try.

Questions for discussion:

In generated project by CMake we always have only one enter point. Also
INSTALL macross support only including to “all” targets. It follows that it
is impossible build contrib modules separately only with “all” target. Here
write about this behavior:
https://cmake.org/cmake/help/v3.7/prop_tgt/EXCLUDE_FROM_ALL.html

Interesting note:

Many folks here love only command line but many novices developers from
modern generation love GUI. Also using command line on Windows it's really
big pain. With CMake you can work with Postgres under MSVC more
comfortable. For example my screenshots of regress tests result runing from
MSVC: https://twitter.com/stalkerg/status/814423972263657472

Fin:

I hope this patchset one step closer to merge. In future I see a lot of
work but I suppose it is right and important direction. I'm ready for this
long journey.

Big thanks Peter Eisentraut for advices and the right vector of
development.

Also big thanks Mark Kirkwood for help and discussion.

Happy New Year, everyone!

Attachment Content-Type Size
cmake_v2_1_main_files.patch text/x-patch 281.3 KB
cmake_v2_2_c_define.patch text/x-patch 772 bytes
cmake_v2_3_rijndael.patch text/x-patch 57.0 KB
cmake_v2_4_uuid.patch text/x-patch 560 bytes
cmake_v2_5_readme.patch text/x-patch 6.5 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jesper Pedersen 2016-12-30 14:27:45 Re: Microvacuum support for Hash Index
Previous Message Fabien COELHO 2016-12-30 14:10:42 Re: BUG: pg_stat_statements query normalization issues with combined queries