File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed
Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -3,9 +3,10 @@ cmake_minimum_required(VERSION 3.0)
33project (task-opt1)
44
55if (MSVC )
6+ # We build Relase with the /MD (DLL) option instead of CMake's default /MT (static runtime)
67 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W3 /wd4576 /D_HAS_EXCEPTIONS=0 /GR- /MP" )
7- set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /D_DEBUG=1 /wd4189" )
8- set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2 /Ot /Oi /GS- /Gy /DNDEBUG=1 /GL" )
8+ set (CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /Od /MDd /wd4189" )
9+ set (CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2 /Ot /Oi /MD / GS- /Gy /DNDEBUG=1 /GL" )
910 set (CMAKE_EXE_LINKER_FLAGS_RELEASE "/OPT:REF /OPT:ICF /INCREMENTAL:NO /LTCG" )
1011else ()
1112 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -fno-exceptions -fno-rtti" )
1718 endif ()
1819endif ()
1920
20- add_executable (task-opt1 "${CMAKE_CURRENT_LIST_DIR} /main.cpp" )
21+ file (GLOB INCS "*.h" "*.inc" )
22+ file (GLOB SRCS "*.cpp" )
23+ source_group ("Headers" FILES ${INCS} )
24+ source_group ("Sources" FILES ${SRCS} )
2125
22- target_include_directories (task-opt1 PRIVATE " ${CMAKE_CURRENT_LIST_DIR} " )
26+ add_executable (task-opt1 ${SRCS} ${INCS} )
You can’t perform that action at this time.
0 commit comments