Skip to content

Add an experimental native build for the host platform - #113

Open
mischa85 wants to merge 5 commits into
OpenTS-Developers:mainfrom
mischa85:native-configure
Open

Add an experimental native build for the host platform#113
mischa85 wants to merge 5 commits into
OpenTS-Developers:mainfrom
mischa85:native-configure

Conversation

@mischa85

@mischa85 mischa85 commented Sep 2, 2026

Copy link
Copy Markdown

An opt-in OPENTS_EXPERIMENTAL_NATIVE configures a native build for the host. The resource compiler, the 32-bit requirement, the PDB copy and /Zc:preprocessor are guarded, and -fms-extensions is 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.

mischa85 added a commit to mischa85/OpenTS that referenced this pull request Sep 3, 2026
Comment thread CMakeLists.txt
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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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().

Comment thread docs/BUILDING.md
cmake -S . -B build/native -G Ninja \
-DCMAKE_BUILD_TYPE=Release \
-DOPENTS_EXPERIMENTAL_NATIVE=ON
cmake --build build/native

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread code/CMakeLists.txt

# 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)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants