1
0
mirror of https://github.com/open-simh/simh.git synced 2026-01-25 11:55:43 +00:00

CMake: Updates

Issue #294: "apple silicon build problem(s?)": If the "--flavor/-f" flag
is not specified on the command line, then complain loudly, print help
and exit. The script used to default to "Unix Makefiles".

Updates:

- Add missing "-DHAVE_LIBPNG" compiler command line define when the PNG
  library is detected/present for screen capture support.

- Add "clang64" to the list of MinGW64 platforms for which the
  .travis/deps.sh script can install build dependencies.

- Add PThread4W_FOUND to the condition that sets async I/O for Win32
  when using vcpkg for build dependencies.

- Add vs2022-x64, vs2019-x64 and vs2017-x64 build environments to
  build 64-bit Windows executables.

- Use simulator AIO only where needed by the simulator (i.e., the
  simulator calls/uses AIO_CHECK_EVENT in sim_instr())

  - Add "USES_AIO" flag to add_simulator() to mark a simulator that
    acutally uses asynchronous I/O.

  - Build "_aio" SIMH core library variants that have AIO turned on,
    link with the "_aio" variant when a simulator sets USES_AIO.

  - Emit a warning message when WITH_ASYNC is False (CMake configuration
    option) to notify the user/developer that some functionality will be
    crippled.

  Affected simulator builds: 3b2 family, PDP-6, PDP-11, VAX family,
  IMLAC and TT2500. The makefile and cmake/generate.py also updated
  to remain in sync with CMake.

  N.B.: Simulators still link with the underlying platform's threading
  library. SEL32 requires pthreads or equivalent threading library,
  independent of AIO.

- cmake/cmake-builder.sh

  - New "--no-aio" flag: Build simulators without async I/O.

  - New "--no-aio-intrinsics" flag: Don't build async I/O using compiler
    compare-exchange, atomic load intrinsics.

- cmake/cmake-builder.ps1

  - New "-noaio" flag: Build simulators without async I/O.

  - New "-noaiointrinsics" flag: Don't build async I/O using compiler
    compare-exchange, atomic load intrinsics.

CMake 3.28.1 INTERFACE_LINK_LIBRARIES behavior change: The file name
must now be an absolute path. Relative paths no longer accepted.
Internally, SIMH enforces this if CMAKE_VERSION >= 3.19, when REAL_PATH
was first implemented.
This commit is contained in:
B. Scott Michel
2023-12-04 11:33:00 -08:00
committed by Paul Koning
parent f4c39a325c
commit d9d0e8bd74
18 changed files with 324 additions and 139 deletions

View File

@@ -14,12 +14,14 @@ class SIMHBasicSimulator:
self.int64 = False
self.full64 = False
self.buildrom = buildrom
## self.has_display -> True if there is a specific display used by the simulator.
## self.has_display -> True if there is a specific display used by the simulator.
self.has_display = False
## self.uses_video -> True if USE_SIM_VIDEO appears in the simulator's preprocessor defn's.
## self.uses_video -> True if USE_SIM_VIDEO appears in the simulator's preprocessor defn's.
self.uses_video = False
## self.besm6_sdl_hack -> Only set/used by the BESM6 simulator.
self.besm6_sdl_hack = False
## self.uses_aio -> True if the simulator uses AIO
self.uses_aio = False
self.sources = []
self.defines = []
self.includes = []
@@ -47,27 +49,33 @@ class SIMHBasicSimulator:
if use_int64 or use_addr64:
self.int64 = use_int64 and not use_addr64
self.full64 = use_int64 and use_addr64
try:
self.defines.remove('USE_INT64')
except:
pass
try:
self.defines.remove('USE_ADDR64')
except:
pass
for defn in ['USE_INT64', 'USE_ADDR64']:
try:
self.defines.remove(defn)
except:
pass
## Video support:
self.has_display = any(map(lambda s: 'DISPLAY' in SPM.shallow_expand_vars(s, defs), self.sources))
if self.has_display:
try:
self.sources.remove('${DISPLAYL}')
self.sources.remove('$(DISPLAYL)')
except:
pass
for src in ['${DISPLAYL}', '$(DISPLAYL)']:
try:
self.sources.remove(src)
except:
pass
self.uses_video = 'USE_SIM_VIDEO' in self.defines or self.has_display
## AIO support:
self.uses_aio = 'SIM_ASYNCH_IO' in self.defines
if self.uses_aio:
for defn in ['SIM_ASYNCH_IO', 'USE_READER_THREAD']:
try:
self.defines.remove(defn)
except:
pass
def cleanup_defines(self):
"""Remove command line defines that aren't needed (because the CMake interface libraries
already define them.)
@@ -118,6 +126,8 @@ class SIMHBasicSimulator:
stream.write('\n' + indent4 + "FEATURE_DISPLAY")
if self.besm6_sdl_hack:
stream.write('\n' + indent4 + "BESM6_SDL_HACK")
if self.uses_aio:
stream.write('\n' + indent4 + "USES_AIO")
if self.buildrom:
stream.write('\n' + indent4 + "BUILDROMS")
stream.write('\n' + indent4 + "LABEL " + test_label)