Skip to content

Commit

Permalink
移除兼容 osx 的相关代码
Browse files Browse the repository at this point in the history
Signed-off-by: Zone.N <[email protected]>
  • Loading branch information
MRNIU committed Apr 22, 2024
1 parent 37a46c9 commit 9fa4c0e
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 108 deletions.
42 changes: 0 additions & 42 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,45 +70,3 @@ jobs:
with:
files: build_x86_64/coverage/coverage.info
verbose: true

# build_osx:
# runs-on: macos-latest
# steps:
# - name: get code
# uses: actions/checkout@v3
#
# - name: setup toolchain
# shell: bash
# run: |
# brew install x86_64-elf-gcc
# brew tap riscv-software-src/riscv
# brew install riscv-tools
#
# - name: make build dir
# shell: bash
# run: |
# mkdir ${{github.workspace}}/build
#
# - name: osx-i386
# shell: bash
# working-directory: ${{github.workspace}}/build
# run: |
# cmake -DTOOLCHAIN_PREFIX=x86_64-elf- -DCMAKE_C_COMPILER=x86_64-elf-gcc -DCMAKE_CXX_COMPILER=x86_64-elf-g++ -DARCH=i386 -DCMAKE_BUILD_TYPE=RELEASE -DHAVE_FLAG_SEARCH_PATHS_FIRST=0 ..
# make
# rm -rf ./*
#
# - name: osx-x86_64
# shell: bash
# working-directory: ${{github.workspace}}/build
# run: |
# cmake -DTOOLCHAIN_PREFIX=x86_64-elf- -DCMAKE_C_COMPILER=x86_64-elf-gcc -DCMAKE_CXX_COMPILER=x86_64-elf-g++ -DARCH=x86_64 -DCMAKE_BUILD_TYPE=RELEASE -DHAVE_FLAG_SEARCH_PATHS_FIRST=0 ..
# make
# rm -rf ./*
#
# - name: osx-riscv64
# shell: bash
# working-directory: ${{github.workspace}}/build
# run: |
# cmake -DTOOLCHAIN_PREFIX=riscv64-unknown-elf- -DCMAKE_C_COMPILER=riscv64-unknown-elf-gcc -DCMAKE_CXX_COMPILER=riscv64-unknown-elf-g++ -DARCH=riscv64 -DCMAKE_BUILD_TYPE=RELEASE -DHAVE_FLAG_SEARCH_PATHS_FIRST=0 ..
# make
# rm -rf ./*
22 changes: 1 addition & 21 deletions cmake/x86_64-aarch64-gcc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,9 @@ set(CMAKE_SYSTEM_NAME Generic)
# 目标架构
set(CMAKE_SYSTEM_PROCESSOR aarch64)

# @todo mac 测试
if (APPLE)
message(STATUS "Now is Apple system.")
# GCC
find_program(Compiler_gcc aarch64-linux-gnu-g++)
if (NOT Compiler_gcc)
message(FATAL_ERROR "aarch64-linux-gnu-g++ not found.\n"
"Run `brew install x86_64-elf-g++` to install.")
else ()
message(STATUS "Found aarch64-linux-gnu-g++ ${Compiler_gcc}")
endif ()

set(TOOLCHAIN_PREFIX aarch64-linux-gnu-)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++)
set(CMAKE_READELF ${TOOLCHAIN_PREFIX}readelf)
set(CMAKE_AR ${TOOLCHAIN_PREFIX}ar)
set(CMAKE_LINKER ${TOOLCHAIN_PREFIX}ld)
set(CMAKE_NM ${TOOLCHAIN_PREFIX}nm)
set(CMAKE_OBJDUMP ${TOOLCHAIN_PREFIX}objdump)
set(CMAKE_RANLIB ${TOOLCHAIN_PREFIX}ranlib)
message(FATAL_ERROR "NOT support OSX, Please use linux")
elseif (UNIX)
message(STATUS "Now is UNIX-like OS's.")
# GCC
find_program(Compiler_gcc aarch64-linux-gnu-g++)
if (NOT Compiler_gcc)
Expand Down
22 changes: 1 addition & 21 deletions cmake/x86_64-riscv64-gcc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,29 +9,9 @@ set(CMAKE_SYSTEM_NAME Generic)
# 目标架构
set(CMAKE_SYSTEM_PROCESSOR riscv64)

# @todo mac 测试
if (APPLE)
message(STATUS "Now is Apple systens.")
# GCC
find_program(Compiler_gcc riscv64-unknown-elf-g++)
if (NOT Compiler_gcc)
message(FATAL_ERROR "riscv64-unknown-elf-g++ not found.\n"
"Following https://github.com/riscv-software-src/homebrew-riscv to install.")
else ()
message(STATUS "Found riscv64-unknown-elf-g++ ${Compiler_gcc}")
endif ()

set(TOOLCHAIN_PREFIX riscv64-unknown-elf-)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++)
set(CMAKE_READELF ${TOOLCHAIN_PREFIX}readelf)
set(CMAKE_AR ${TOOLCHAIN_PREFIX}ar)
set(CMAKE_LINKER ${TOOLCHAIN_PREFIX}ld)
set(CMAKE_NM ${TOOLCHAIN_PREFIX}nm)
set(CMAKE_OBJDUMP ${TOOLCHAIN_PREFIX}objdump)
set(CMAKE_RANLIB ${TOOLCHAIN_PREFIX}ranlib)
message(FATAL_ERROR "NOT support OSX, Please use linux")
elseif (UNIX)
message(STATUS "Now is UNIX-like OS's.")
# GCC
find_program(Compiler_gcc riscv64-linux-gnu-g++)
if (NOT Compiler_gcc)
Expand Down
25 changes: 1 addition & 24 deletions cmake/x86_64-x86_64-gcc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -9,31 +9,8 @@ set(CMAKE_SYSTEM_NAME Generic)
# 目标架构
set(CMAKE_SYSTEM_PROCESSOR x86_64)

# @todo mac 测试
if (APPLE)
message(STATUS "Now is Apple system.")
# GCC
find_program(Compiler_gcc x86_64-elf-g++)
if (NOT Compiler_gcc)
message(FATAL_ERROR "x86_64-elf-g++ not found.\n"
"Run `brew install x86_64-elf-g++` to install.")
else ()
message(STATUS "Found x86_64-elf-g++ ${Compiler_gcc}")
endif ()

set(TOOLCHAIN_PREFIX x86_64-elf-)
set(CMAKE_C_COMPILER ${TOOLCHAIN_PREFIX}gcc)
set(CMAKE_CXX_COMPILER ${TOOLCHAIN_PREFIX}g++)
set(CMAKE_READELF ${TOOLCHAIN_PREFIX}readelf)
set(CMAKE_AR ${TOOLCHAIN_PREFIX}ar)
set(CMAKE_LINKER ${TOOLCHAIN_PREFIX}ld)
set(CMAKE_NM ${TOOLCHAIN_PREFIX}nm)
set(CMAKE_OBJDUMP ${TOOLCHAIN_PREFIX}objdump)
set(CMAKE_RANLIB ${TOOLCHAIN_PREFIX}ranlib)

# 跳过编译器检查
set(CMAKE_C_COMPILER_FORCED TRUE)
set(CMAKE_CXX_COMPILER_FORCED TRUE)
message(FATAL_ERROR "NOT support OSX, Please use linux")
elseif (UNIX)
message(STATUS "Now is UNIX-like OS's.")
# GCC
Expand Down

0 comments on commit 9fa4c0e

Please sign in to comment.