Add an experimental native build for the host platform - #113
Conversation
# Conflicts: # code/dsaudio.cpp
| option(OPENTS_OFFICIAL_BUILD "Build as an official release of the declared version" OFF) | ||
|
|
||
| option(OPENTS_EXPERIMENTAL_CLANG_CL "Build with clang-cl using the MSVC ABI" OFF) | ||
| option(OPENTS_EXPERIMENTAL_NATIVE "Configure a native build for the host platform" OFF) |
There was a problem hiding this comment.
project() enables ASM_MASM before this option exists, CMake searches for ml/ml64 and a linux or mac host then fails before reaching the opt-in. Move MASM out of project().
| cmake -S . -B build/native -G Ninja \ | ||
| -DCMAKE_BUILD_TYPE=Release \ | ||
| -DOPENTS_EXPERIMENTAL_NATIVE=ON | ||
| cmake --build build/native |
There was a problem hiding this comment.
This build command cannot currently succeed with a native compiler: code/CMakeLists.txt still applies MSVC /... flags, defines WIN32/_WINDOWS, and links Windows system libraries unconditionally.
|
|
||
| # OpenTS currently supports 32-bit (x86) builds only. | ||
| if(NOT CMAKE_SIZEOF_VOID_P EQUAL 4) | ||
| if(WIN32 AND NOT CMAKE_SIZEOF_VOID_P EQUAL 4) |
There was a problem hiding this comment.
This permits 64bit native builds, cool, but SaveStreamClass::Serialize(T *&) writes sizeof(pointer) bytes. A 64-bit binary would then use a different save representation under the same packed project version. I guess try and contain native builds from save/network runtime use, retain the 32-bit constraint.
An opt-in
OPENTS_EXPERIMENTAL_NATIVEconfigures a native build for the host. The resource compiler, the 32-bit requirement, the PDB copy and/Zc:preprocessorare guarded, and-fms-extensionsis enabled for the tree's__declspec. Every hunk is a guard, so Windows is unchanged.Also "
language\language.h" -> "language/language.h" in 51 files; a backslash only resolves on Windows.