1
0
mirror of https://github.com/open-simh/simh.git synced 2026-01-25 19:57:36 +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

@@ -6,8 +6,6 @@
set(GIT_COMMIT_ID ${GIT_COMMIT_DEST}/.git-commit-id)
set(GIT_COMMIT_ID_H ${GIT_COMMIT_DEST}/.git-commit-id.h)
message(STATUS "Updating GIT commit ID")
find_program(GIT_COMMAND git)
if (GIT_COMMAND)
execute_process(COMMAND ${GIT_COMMAND} "log" "-1" "--pretty=%H"
@@ -32,15 +30,12 @@ if (GIT_COMMAND AND NOT (HAVE_GIT_COMMIT_HASH OR HAVE_GIT_COMMIT_TIME))
string(REPLACE "T" " " SIMH_GIT_COMMIT_TIME ${SIMH_GIT_COMMIT_TIME})
if (HAVE_UNCOMMITTED_CHANGES)
message(STATUS "Git detected uncommitted changes.")
## message(STATUS "Git detected uncommitted changes.")
string(APPEND SIMH_GIT_COMMIT_HASH "+uncommitted-changes")
else ()
message(STATUS "Clean working directory, no uncommitted changes.")
endif ()
message(STATUS "SIM_GIT_COMMIT_ID: ${SIMH_GIT_COMMIT_HASH}")
message(STATUS "SIM_GIT_COMMIT_TIME: ${SIMH_GIT_COMMIT_TIME}")
set(WRITE_GIT_COMMIT_FILES True)
if (EXISTS ${GIT_COMMIT_ID})
set(EXISTING_GIT_COMMIT_HASH)
@@ -55,12 +50,16 @@ if (GIT_COMMAND AND NOT (HAVE_GIT_COMMIT_HASH OR HAVE_GIT_COMMIT_TIME))
endforeach()
if (EXISTING_GIT_COMMIT_HASH STREQUAL SIMH_GIT_COMMIT_HASH AND
EXISTING_GIT_COMMIT_TIME STREQUAL SIMH_GIT_COMMIT_TIME)
message(STATUS "GIT hash and time match, not writing files.")
## message(STATUS "GIT hash and time match, not writing files.")
set(WRITE_GIT_COMMIT_FILES False)
endif ()
endif ()
if (WRITE_GIT_COMMIT_FILES)
message(STATUS "Updating GIT commit ID")
message(STATUS "SIM_GIT_COMMIT_ID: ${SIMH_GIT_COMMIT_HASH}")
message(STATUS "SIM_GIT_COMMIT_TIME: ${SIMH_GIT_COMMIT_TIME}")
message(STATUS "Writing ${GIT_COMMIT_ID}")
file(WRITE ${GIT_COMMIT_ID}
"SIM_GIT_COMMIT_ID ${SIMH_GIT_COMMIT_HASH}\n"
@@ -70,9 +69,9 @@ if (GIT_COMMAND AND NOT (HAVE_GIT_COMMIT_HASH OR HAVE_GIT_COMMIT_TIME))
file(WRITE ${GIT_COMMIT_ID_H}
"#define SIM_GIT_COMMIT_ID ${SIMH_GIT_COMMIT_HASH}\n"
"#define SIM_GIT_COMMIT_TIME ${SIMH_GIT_COMMIT_TIME}\n")
else ()
message(STATUS "No changes to ${GIT_COMMIT_ID}")
message(STATUS "No changes to ${GIT_COMMIT_ID_H}")
## else ()
## message(STATUS "No changes to ${GIT_COMMIT_ID}")
## message(STATUS "No changes to ${GIT_COMMIT_ID_H}")
endif ()
else ()
message(STATUS "SIM_GIT_COMMIT_ID not set.")