compiler flags for msvc
This commit is contained in:
parent
3238f0304c
commit
29d4ed296c
2 changed files with 32 additions and 13 deletions
|
@ -16,7 +16,7 @@ dependencies:
|
|||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
flutter_lints: ^2.0.0
|
||||
flutter_lints: ^3.0.1
|
||||
ffigen: ^9.0.1
|
||||
|
||||
# For information on the generic Dart part of this file, see the
|
||||
|
|
|
@ -7,31 +7,50 @@ project(flutter_stockfish_plugin VERSION 0.0.1 LANGUAGES CXX)
|
|||
file(GLOB_RECURSE cppPaths "Stockfish/src/*.cpp")
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
|
||||
set(COMMON_FLAGS "-Wall -Wcast-qual -fno-exceptions -std=c++17 -pedantic -Wextra -Wshadow -Wmissing-declarations -flto -DUSE_PTHREADS") #-flto-partition=one
|
||||
if(MSVC)
|
||||
set(COMMON_FLAGS "/std:c++17 /LTCG")
|
||||
|
||||
set(SIMD_FLAGS "-msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2")
|
||||
set(SIMD_FLAGS "/arch:AVX2 /arch:SSE /DUSE_POPCNT /DUSE_SSE41 /DUSE_SSSE3 /DUSE_SSE2")
|
||||
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
|
||||
if (CMAKE_SIZEOF_VOID_P EQUAL 8)
|
||||
message(STATUS "Adding x86_64 specific flags")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS} ${SIMD_FLAGS} -m64 -DIS_64BIT -DUSE_PTHREADS")
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS} ${SIMD_FLAGS}")
|
||||
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
|
||||
message(STATUS "Adding x86 specific flags")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS} ${SIMD_FLAGS}")
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "armv8")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /Zi")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /Ox /DNDEBUG")
|
||||
|
||||
else()
|
||||
set(COMMON_FLAGS "-Wall -Wcast-qual -fno-exceptions -std=c++17 -pedantic -Wextra -Wshadow -Wmissing-declarations -flto -DUSE_PTHREADS")
|
||||
|
||||
set(SIMD_FLAGS "-msse -msse3 -mpopcnt -DUSE_POPCNT -DUSE_SSE41 -msse4.1 -DUSE_SSSE3 -mssse3 -DUSE_SSE2 -msse2")
|
||||
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "x86_64")
|
||||
message(STATUS "Adding x86_64 specific flags")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS} ${SIMD_FLAGS} -m64 -DIS_64BIT -DUSE_PTHREADS")
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "x86")
|
||||
message(STATUS "Adding x86 specific flags")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS} ${SIMD_FLAGS}")
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "armv8")
|
||||
message(STATUS "Adding armv8 specific flags")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS} -DIS_64BIT -DUSE_POPCNT -DUSE_NEON=8")
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "armv7")
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "armv7")
|
||||
message(STATUS "Adding armv7 specific flags")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS}")
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
|
||||
elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
|
||||
message(STATUS "Adding aarch64 specific flags")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${COMMON_FLAGS} -DIS_64BIT -DNO_PREFETCH")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -DNDEBUG")
|
||||
endif()
|
||||
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -O0 -g")
|
||||
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O3 -DNDEBUG")
|
||||
|
||||
|
||||
set(NNUE_NAME nn-5af11540bbfe.nnue)
|
||||
|
||||
|
|
Loading…
Reference in a new issue