diff --git a/.github/workflows/CMake-macOS.yml b/.github/workflows/CMake-macOS.yml new file mode 100644 index 00000000..54115f15 --- /dev/null +++ b/.github/workflows/CMake-macOS.yml @@ -0,0 +1,20 @@ +name: CMake macOS + +on: push + +jobs: + build: + strategy: + matrix: + os: [macos-latest, macos-13] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: Install ninja & yasm + run: brew install ninja yasm + - name: Configure (CMake) + run: | + cmake -S ports/cmake -B build -GNinja + - name: Build (CMake) + run: | + cmake --build build diff --git a/NEWS b/NEWS index 8fb377a5..d7ee4d2a 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,8 @@ +1.32.7 +------ +- ports/cmake: Work around bug in CMake that does not detect FPU on + Apple ARM CPUs (github PR 14). + 1.32.6 ------ - build: Detect forced 64 bit offsets on a dual-mode system that used diff --git a/ports/cmake/src/CMakeLists.txt b/ports/cmake/src/CMakeLists.txt index f86d7f47..32bc03c0 100644 --- a/ports/cmake/src/CMakeLists.txt +++ b/ports/cmake/src/CMakeLists.txt @@ -180,7 +180,13 @@ if(NO_MESSAGES) set(NO_ERETURN ON) endif() -if(WIN32) +include(../cmake/CheckCPUArch.cmake) +check_cpu_arch_x86(ARCH_IS_X86) +check_cpu_arch_x64(ARCH_IS_X64) +check_cpu_arch_arm32(ARCH_IS_ARM32) +check_cpu_arch_arm64(ARCH_IS_ARM64) + +if(WIN32 OR (ARCH_IS_ARM64 AND APPLE)) set(HAVE_FPU 1) else() cmake_host_system_information(RESULT HAVE_FPU QUERY HAS_FPU) diff --git a/ports/cmake/src/libmpg123/CMakeLists.txt b/ports/cmake/src/libmpg123/CMakeLists.txt index 24271dc4..7cb08be0 100644 --- a/ports/cmake/src/libmpg123/CMakeLists.txt +++ b/ports/cmake/src/libmpg123/CMakeLists.txt @@ -7,8 +7,6 @@ endif() include_directories("${CMAKE_CURRENT_BINARY_DIR}" "${CMAKE_CURRENT_SOURCE_DIR}/../../../../src/libmpg123/") -include(../../cmake/CheckCPUArch.cmake) - if(HAVE_STDLIB_H) set(INCLUDE_STDLIB_H "#include ") else() @@ -21,10 +19,6 @@ else() endif() -check_cpu_arch_x86(ARCH_IS_X86) -check_cpu_arch_x64(ARCH_IS_X64) -check_cpu_arch_arm32(ARCH_IS_ARM32) -check_cpu_arch_arm64(ARCH_IS_ARM64) # PPC with AltiVec is missing. But probably obsolete enough for CMake users.