FWGS / hlsdk-portable

Portable Half-Life SDK. GoldSource and Xash3D. Crossplatform.
https://xash.su
Other
271 stars 122 forks source link

Platform checks are slow on Windows #265

Closed FreeSlave closed 1 year ago

FreeSlave commented 2 years ago

Not a bug, just a noticeable inconvenience. Platform checks during the project configuration (Looking for XASH_...) are much slower on Windows than on Linux.

SNMetamorph commented 2 years ago

Same problem in PrimeXT

nekonomicon commented 2 years ago

CMake already has internal checks for different platforms, so may be not good idea to check every symbol in build.h.

a1batross commented 2 years ago

CMake already has internal checks for different platforms, so may be not good idea to check every symbol in build.h.

No it doesn't. You can't get target processor just from CMake.

CMake also could have multithreaded checks but it doesn't.

a1batross commented 2 years ago

I wish we could just get all defined macros on MSVC, as we can do on GCC or Clang. But the needed feature was only added in only recent MSVC.

And remember we still have to target WinXP...

a1batross commented 2 years ago

Just a quick thoughts.

What if build.h will be precompiled header? Will it fix slow checks? Though I don't see how CMake can leverage precompiled headers for CheckSymbolExists.

Script can also be redone so more probable checks done first and if they are true, no further checks are done. Many variables are mutually exclusive, like CPU arch and OS.

FreeSlave commented 1 year ago

Closing as solved by https://github.com/FWGS/hlsdk-portable/pull/368