forked from ari/mnist-classify
I don't use CMake and I needed something to cross-compile it with. Sorry! :D Signed-off-by: Arija A. <ari@ari.lt>
27 lines
742 B
CMake
27 lines
742 B
CMake
cmake_minimum_required(VERSION 3.10)
|
|
project(mnist-classify LANGUAGES CXX)
|
|
|
|
set(CMAKE_CXX_STANDARD 17)
|
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
|
|
|
if(MSVC)
|
|
add_compile_options(/O2 /GL /fp:fast /arch:AVX)
|
|
add_link_options(/LTCG)
|
|
elseif(NOT DEFINED NOQA)
|
|
add_compile_options(-ffast-math -O3 -s -funroll-loops)
|
|
elseif(MINGW)
|
|
add_link_options(-static -static-libgcc -static-libstdc++)
|
|
endif()
|
|
|
|
file(GLOB SRC_FILES "src/*.cc")
|
|
|
|
add_executable(mnist-classify ${SRC_FILES})
|
|
|
|
find_program(STRIP_EXECUTABLE x86_64-w64-mingw32-strip)
|
|
if(STRIP_EXECUTABLE)
|
|
add_custom_command(TARGET mnist-classify POST_BUILD
|
|
COMMAND ${STRIP_EXECUTABLE} --strip-all $<TARGET_FILE:mnist-classify>
|
|
COMMENT "Stripping executable"
|
|
)
|
|
endif()
|
|
|