vulkaninfo runs successfully
[kazan.git] / CMakeLists.txt
1 # Copyright 2017 Jacob Lifshay
2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a copy
4 # of this software and associated documentation files (the "Software"), to deal
5 # in the Software without restriction, including without limitation the rights
6 # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 # copies of the Software, and to permit persons to whom the Software is
8 # furnished to do so, subject to the following conditions:
9 #
10 # The above copyright notice and this permission notice shall be included in all
11 # copies or substantial portions of the Software.
12 #
13 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
19 # SOFTWARE.
20 #
21 cmake_minimum_required(VERSION 3.3 FATAL_ERROR)
22
23 set(CMAKE_CXX_STANDARD 14)
24 set(CMAKE_CXX_STANDARD_REQUIRED ON)
25 set(CMAKE_C_VISIBILITY_PRESET hidden)
26 set(CMAKE_CXX_VISIBILITY_PRESET hidden)
27 set(CMAKE_POSITION_INDEPENDENT_CODE ON)
28
29 project(kazan CXX C)
30 if(NOT ${CMAKE_CXX_COMPILER_ID} MATCHES "Clang")
31 message(FATAL_ERROR "compiler is not clang")
32 endif()
33 if(NOT ${CMAKE_C_COMPILER_ID} MATCHES "Clang")
34 message(FATAL_ERROR "compiler is not clang")
35 endif()
36
37 find_package(LLVM REQUIRED CONFIG)
38 if(LLVM_PACKAGE_VERSION VERSION_LESS 4.0)
39 message(FATAL_ERROR "unsupported version of llvm; requires version 4.0 or greater")
40 endif()
41 if(NOT LLVM_ENABLE_THREADS)
42 message(FATAL_ERROR "llvm was not built multi-threaded")
43 endif()
44 include_directories(${LLVM_INCLUDE_DIRS})
45 add_definitions(${LLVM_DEFINITIONS})
46 add_compile_options(-Wall -ftemplate-depth=1024 -Werror "-Wno-error=#warnings")
47 add_subdirectory(src)