1 # Require at least version 3.5.1 of CMake
2 cmake_minimum_required(VERSION 3.5.1)
4 cmake_policy(SET CMP0042 NEW)
6 set(INC_PLATFORM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/Common/Platform)
8 add_definitions(-DWINDOWS)
11 # Verify that LTCG/LTO is available
12 include(${CMAKE_CURRENT_SOURCE_DIR}/../configure.cmake)
13 # Include global configure settings
14 include(${CMAKE_CURRENT_SOURCE_DIR}/../configurecompiler.cmake)
18 # 4100 - unreferenced formal parameter
19 # 4514 - unreferenced inline function has been removed
20 # 4625 - copy constructor was implicitly defined as deleted because a base class copy constructor is inaccessible or deleted
21 # 4626 - assignment operator was implicitly defined as deleted because a base class assignment operator is inaccessible or deleted
22 # 4668 - 'symbol' is not defined as a preprocessor macro, replacing with '0' for 'directives'
23 # 4710 - function not inlined
24 # 4711 - 'function' selected for inline expansion
25 # 4774 - format string expected in argument number is not a string literal
26 # 4820 - bytes padding added after construct 'member_name'
27 # 5025 - move assignment operator was implicitly defined as deleted
28 # 5026 - move constructor was implicitly defined as deleted
29 # 5027 - move assignment operator was implicitly defined as deleted
30 # 5039 - pointer or reference to potentially throwing function passed to extern C function under -EHc. Undefined behavior may occur if this function throws an exception.
31 add_compile_options(-wd4100 -wd4514 -wd4625 -wd4626 -wd4668 -wd4710 -wd4711 -wd4774 -wd4820 -wd5025 -wd5026 -wd5027 -wd5039)
32 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
35 if(CLR_CMAKE_PLATFORM_UNIX)
36 add_compile_options(-fPIC)
37 endif(CLR_CMAKE_PLATFORM_UNIX)
39 MACRO(SUBDIRLIST result curdir)
40 FILE(GLOB children RELATIVE ${curdir} ${curdir}/*)
42 FOREACH(child ${children})
43 IF(IS_DIRECTORY ${curdir}/${child})
44 LIST(APPEND dirlist ${child})
47 SET(${result} ${dirlist})
50 MACRO(ADDSUBDIR_REC curdir)
51 SUBDIRLIST(SUB_DIRS ${curdir})
52 FOREACH(subdir ${SUB_DIRS})
53 if(EXISTS "${curdir}/${subdir}/CMakeLists.txt")
54 ADD_SUBDIRECTORY(${curdir}/${subdir})
56 ADDSUBDIR_REC(${curdir}/${subdir})
57 endif(EXISTS "${curdir}/${subdir}/CMakeLists.txt")
61 ADDSUBDIR_REC(${CMAKE_CURRENT_SOURCE_DIR})