| function(add_compiler_flag flag) |
| set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${flag}" PARENT_SCOPE) |
| set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${flag}" PARENT_SCOPE) |
| endfunction() |
| |
| if (${CMAKE_SYSTEM_NAME} MATCHES "Linux") |
| add_compiler_flag("-DPLATFORM_LINUX=1") |
| add_compiler_flag("-DPLATFORM_POSIX=1") |
| elseif (${CMAKE_SYSTEM_NAME} MATCHES "Windows") |
| add_compiler_flag("-DPLATFORM_WINDOWS=1") |
| else() |
| message(FATAL_ERROR "Platform unset, build will fail--stopping at CMake time.") |
| endif() |
| |
| add_subdirectory(common) |
| add_subdirectory(nulldrv) |
| if (NOT WIN32) |
| add_subdirectory(intel) |
| endif() |