Commit e8a72187 authored by DailyShana's avatar DailyShana

update cmake build

parent 125b8aec
project (ygo)
cmake_minimum_required (VERSION 2.8)
cmake_minimum_required (VERSION 3.8)
if(NOT CMAKE_BUILD_TYPE)
message(STATUS "Setting build type to 'Debug' as none was specified.")
......@@ -15,6 +15,10 @@ set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_CXX_STANDARD 14)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_EXTENSIONS OFF)
include (AutoFiles)
include (platform/settings)
......
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14")
set (CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -D_DEBUG")
set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -D_DEBUG")
add_definitions ( "-fexceptions" "-fomit-frame-pointer" "-fno-strict-aliasing" "-Wno-format-security" )
......@@ -3,3 +3,4 @@ add_definitions ( "-D_UNICODE" "-DUNICODE" "/utf-8" )
include (MSVCMultipleProcessCompile)
include (MSVCStaticRuntime)
include (MSVCJustMyCodeDebugging)
# - Enable Just My Code debugging on MSVC
#
# include(MSVCJustMyCodeDebugging)
#
# Requires these CMake modules:
# ListCombinations.cmake
if(MSVC AND NOT "${MSVC_VERSION}" LESS 1918)
# Only available in VS 2017 15.8 and newer
include(ListCombinations)
list_combinations(_varnames
PREFIXES
CMAKE_CXX_FLAGS_
SUFFIXES
DEBUG
RELWITHDEBINFO)
foreach(_var ${_varnames})
set(${_var} "${${_var}} /JMC")
endforeach()
endif()
set(CMAKE_XCODE_ATTRIBUTE_GCC_VERSION "com.apple.compilers.llvm.clang.1_0")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LANGUAGE_STANDARD "c++14")
set(CMAKE_XCODE_ATTRIBUTE_CLANG_CXX_LIBRARY "libc++")
......@@ -16,7 +16,11 @@ endif ()
if (MSVC)
add_executable (ygopro WIN32 ${AUTO_FILES_RESULT})
set_target_properties (ygopro PROPERTIES LINK_FLAGS /ENTRY:"mainCRTStartup")
set_target_properties (ygopro PROPERTIES
LINK_FLAGS /ENTRY:"mainCRTStartup"
VS_DEBUGGER_WORKING_DIRECTORY "${CMAKE_SOURCE_DIR}"
)
set_property(DIRECTORY ${CMAKE_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT ygopro)
else ()
add_executable (ygopro ${AUTO_FILES_RESULT})
endif ()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment