Forcing Clang unilaterally. Will update docs for build instructions.

This commit is contained in:
Michael J. Manley
2025-07-08 22:18:31 -07:00
parent d41a8af9ea
commit b2ecd8f380
5 changed files with 44 additions and 1 deletions

View File

@@ -23,6 +23,8 @@ jobs:
libwxgtk3.2-dev
libpcap-dev
cmake
llvm
clang
ninja-build
- name: Windows 64bits (MSYS2)
os: windows-latest

View File

@@ -23,6 +23,8 @@ jobs:
libwxgtk3.2-dev
libpcap-dev
cmake
llvm
clang
ninja-build
- name: Windows 64bits (MSYS2)
os: windows-latest

View File

@@ -23,6 +23,8 @@ jobs:
libwxgtk3.2-dev
libpcap-dev
cmake
llvm
clang
ninja-build
- name: Windows 64bits (MSYS2)
os: windows-latest

View File

@@ -7,6 +7,7 @@
- Added RAM disk preloaded with RAW/VHD images (*.rdimg;*.rdvhd)
- Load up to 2GB disks to temporary disk (doesn't modify the image file)
- Mounts as read-only if memory allocation fails (mind the 32bit PCem memory limits)
- 32-bit Windows builds will now be deprecated due to technical issues. v17 will be the last 32-bit PCem.
## Added the following machines to v18
- Hyundai SUPER-16T
@@ -33,6 +34,7 @@
## Developer Changes to v18
- First release to switch from autotools/make to CMake/Ninja
- Legacy autotools and mingw makefiles are removed
- Windows and Linux builds now will be built in Clang, and are required to be built with Clang
# PCem v17
- New machines added - Amstrad PC5086, Compaq Deskpro, Samsung SPC-6033P, Samsung SPC-6000A, Intel VS440FX, Gigabyte GA-686BX

View File

@@ -1,7 +1,16 @@
cmake_minimum_required(VERSION 3.7)
cmake_minimum_required(VERSION 3.20)
# We are going to force clang on both Linux and Windows builds to be uniform
set(CMAKE_C_COMPILER "clang" CACHE FILEPATH "C compiler")
set(CMAKE_CXX_COMPILER "clang++" CACHE FILEPATH "C++ compiler")
project(PCem)
# Dont allow GCC Building anymore, force Clang
if(NOT (CMAKE_C_COMPILER_ID MATCHES "Clang" AND CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
message(FATAL_ERROR "Detected compiler is not Clang! Please ensure Clang is in your PATH or specified correctly.")
endif()
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_SOURCE_DIR}/cmake/modules)
@@ -76,6 +85,32 @@ if(USE_EXPERIMENTAL)
message(" Printer Support: ${USE_EXPERIMENTAL_PRINTER}")
endif()
if(CMAKE_BUILD_TYPE STREQUAL "Release")
option(USE_PGO "Build PCem using PGO Data" OFF)
option(GENERATE_PGO "Build PCem to generate PGO Data for PGO" OFF)
message("Generate PGO Data: ${GENERATE_PGO}")
message("Use PGO Data: ${USE_PGO}")
endif()
if(GENERATE_PGO)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fprofile-generate")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fprofile-generate")
endif()
if(USE_PGO)
if(GENERATE_PGO)
message(FATAL_ERROR "USE_PGO cannot be used with GENERATE_PGO enabled")
endif()
if(NOT EXISTS "${CMAKE_CURRENT_BINARY_DIR}/default.profdata")
message(FATAL_ERROR "Missing default.profdata in output directory. Make sure you run llvm-profdata merge -output=default.profdata *.profraw")
endif()
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} -fprofile-use")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -fprofile-use")
endif()
if(CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
option(PCEM_RELDEB_AS_RELEASE "Build PCem RelWithDebInfo as Release Mode" OFF)
message("Build PCem RelWithDebInfo as Release Mode: ${PCEM_RELDEB_AS_RELEASE}")