Fix compiling for Windows/ARM(64), linking still not working.

This commit is contained in:
2021-10-24 06:22:19 +01:00
parent a5b3b7a34e
commit 1340e84696
10 changed files with 45 additions and 16 deletions

View File

@@ -36,8 +36,6 @@ message("Detected compiler: ${CMAKE_C_COMPILER_ID}")
message("Detected build type: ${CMAKE_BUILD_TYPE}")
message("Detected platform: ${CMAKE_C_PLATFORM_ID}")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
if("${CMAKE_BUILD_TYPE}" MATCHES "Release")
if("${CMAKE_C_COMPILER_ID}" MATCHES "MSVC")
add_compile_options("/O2" "/fp:fast")
@@ -57,6 +55,8 @@ if("${CMAKE_BUILD_TYPE}" MATCHES "Release")
if(NOT "${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
add_compile_options(-flto)
endif()
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "aarch64")
if(NOT "${CMAKE_C_COMPILER_ID}" MATCHES "AppleClang")
add_compile_options(-march=armv8-a)
@@ -64,8 +64,13 @@ if("${CMAKE_BUILD_TYPE}" MATCHES "Release")
if(NOT "${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
add_compile_options(-flto)
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
elseif(${CMAKE_SYSTEM_PROCESSOR} MATCHES "armv7l" OR ${CMAKE_SYSTEM_PROCESSOR} MATCHES "arm")
if(NOT "${CMAKE_C_PLATFORM_ID}" MATCHES "MinGW")
set(CMAKE_POSITION_INDEPENDENT_CODE ON)
endif()
if(NOT "${CMAKE_C_COMPILER_ID}" MATCHES "AppleClang")
add_compile_options(-march=armv7+fp -mfpu=vfpv3-d16)
endif()