1 # Require at least version 2.8.12 of CMake
2 cmake_minimum_required(VERSION 2.8.12)
4 # Include global configure settings
5 include(${CMAKE_CURRENT_SOURCE_DIR}/../configure.cmake)
6 include(${CMAKE_CURRENT_SOURCE_DIR}/../configurecompiler.cmake)
8 set(INC_PLATFORM_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src/Common/Platform)
10 add_definitions(-DWINDOWS=1)
16 # 4100 - unreferenced formal parameter
17 # 4514 - unreferenced inline function has been removed
18 # 4625 - copy constructor was implicitly defined as deleted because a base class copy constructor is inaccessible or deleted
19 # 4626 - assignment operator was implicitly defined as deleted because a base class assignment operator is inaccessible or deleted
20 # 4668 - 'symbol' is not defined as a preprocessor macro, replacing with '0' for 'directives'
21 # 4710 - function not inlined
22 # 4711 - 'function' selected for inline expansion
23 # 4774 - format string expected in argument number is not a string literal
24 # 4820 - bytes padding added after construct 'member_name'
25 # 5025 - move assignment operator was implicitly defined as deleted
26 # 5026 - move constructor was implicitly defined as deleted
27 # 5027 - move assignment operator was implicitly defined as deleted
28 # 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.
29 add_compile_options(-wd4100 -wd4514 -wd4625 -wd4626 -wd4668 -wd4710 -wd4711 -wd4774 -wd4820 -wd5025 -wd5026 -wd5027 -wd5039)
30 set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /EHsc")
33 if(CLR_CMAKE_PLATFORM_UNIX)
34 add_compile_options(-fPIC)
35 endif(CLR_CMAKE_PLATFORM_UNIX)
37 MACRO(SUBDIRLIST result curdir)
38 FILE(GLOB children RELATIVE ${curdir} ${curdir}/*)
40 FOREACH(child ${children})
41 IF(IS_DIRECTORY ${curdir}/${child})
42 LIST(APPEND dirlist ${child})
45 SET(${result} ${dirlist})
48 MACRO(ADDSUBDIR_REC curdir)
49 SUBDIRLIST(SUB_DIRS ${curdir})
50 FOREACH(subdir ${SUB_DIRS})
51 if(EXISTS "${curdir}/${subdir}/CMakeLists.txt")
52 ADD_SUBDIRECTORY(${curdir}/${subdir})
54 ADDSUBDIR_REC(${curdir}/${subdir})
55 endif(EXISTS "${curdir}/${subdir}/CMakeLists.txt")
59 ADDSUBDIR_REC(${CMAKE_CURRENT_SOURCE_DIR})