-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathCMakeLists.txt
44 lines (30 loc) · 1.2 KB
/
CMakeLists.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
cmake_minimum_required(VERSION 3.15.1)
project(Substrate LANGUAGES C CXX Swift)
# place all modules into `swift` in the root of the build tree
set(CMAKE_Swift_MODULE_DIRECTORY ${CMAKE_BINARY_DIR}/swift)
set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/lib)
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
# enable shared libraries by default (Windows, Darwin)
#
# Windows does not yet support static libraries in Swift, Darwin no longer
# supports static libraries after ABI stability.
if(CMAKE_SYSTEM_NAME STREQUAL Windows OR CMAKE_SYSTEM_NAME STREQUAL Darwin)
option(BUILD_SHARED_LIBS "Build shared libraries by default" YES)
endif()
find_package(Vulkan)
# Add CAtomics
include_directories(swift-atomics/Sources/CAtomics/include)
include_directories(ModuleMaps/CAtomics)
add_library(CAtomics SHARED
swift-atomics/Sources/CAtomics/CAtomics.c)
install(TARGETS CAtomics
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib
RUNTIME DESTINATION bin)
# Add the RenderGraph libraries.
include(CTest)
include_directories(ModuleMaps/SubstrateCExtras)
add_subdirectory(SubstrateMath)
add_subdirectory(swiftimgui)
add_subdirectory(Sources)