kabufuda/CMakeLists.txt

52 lines
1.5 KiB
CMake
Raw Normal View History

2017-11-14 04:53:04 +00:00
cmake_minimum_required(VERSION 3.10 FATAL_ERROR) # because of c++17
2016-03-26 18:34:03 +00:00
project(kabufuda)
2017-11-13 06:18:30 +00:00
set(CMAKE_CXX_STANDARD 17)
2017-06-18 02:52:19 +00:00
set(CMAKE_CXX_STANDARD_REQUIRED ON)
2016-03-26 18:34:03 +00:00
add_library(kabufuda STATIC
include/kabufuda/Constants.hpp
2018-02-06 09:34:01 +00:00
include/kabufuda/AsyncIO.hpp
include/kabufuda/BlockAllocationTable.hpp lib/kabufuda/BlockAllocationTable.cpp
include/kabufuda/Card.hpp lib/kabufuda/Card.cpp
include/kabufuda/Directory.hpp lib/kabufuda/Directory.cpp
include/kabufuda/File.hpp lib/kabufuda/File.cpp
include/kabufuda/Util.hpp lib/kabufuda/Util.cpp
include/kabufuda/SRAM.hpp lib/kabufuda/SRAM.cpp
2016-06-30 19:40:35 +00:00
include/kabufuda/WideStringConvert.hpp lib/kabufuda/WideStringConvert.cpp
)
if(WIN32)
if (MSVC)
target_compile_options(kabufuda PRIVATE
# Enforce various standards compliant behavior.
/permissive-
# Enable standard volatile semantics.
/volatile:iso
# Reports the proper value for the __cplusplus preprocessor macro.
/Zc:__cplusplus
# Allow constexpr variables to have explicit external linkage.
/Zc:externConstexpr
# Assume that new throws exceptions, allowing better code generation.
/Zc:throwingNew
)
endif()
target_sources(kabufuda PRIVATE
include/kabufuda/winsupport.hpp
lib/kabufuda/AsyncIOWin32.cpp
)
else()
target_sources(kabufuda PRIVATE
lib/kabufuda/AsyncIOPosix.cpp
)
endif()
2019-06-12 02:04:15 +00:00
target_include_directories(kabufuda PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>)
2016-03-26 04:26:51 +00:00
2016-06-30 09:53:13 +00:00
add_subdirectory(test)