diff options
| author | ladevieq <ladevie.quentin@gmail.com> | 2022-07-11 00:50:27 +0200 |
|---|---|---|
| committer | ladevieq <ladevie.quentin@gmail.com> | 2022-07-11 00:50:27 +0200 |
| commit | 23e6a58d59b7a11cb8bdb7aa61d3c534c02027e7 (patch) | |
| tree | aa62fe9d75f4b82a0caee70d3bf14fa1e0b617b2 /src/CMakeLists.txt | |
| parent | d676e9a2fb533494d1558483e8266605b1d5b632 (diff) | |
Refactor includes & improve compile time
Add platform defined to CMakeLists.txt
Diffstat (limited to 'src/CMakeLists.txt')
| -rw-r--r-- | src/CMakeLists.txt | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 86d91d5..c1f4843 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1,7 +1,16 @@ -add_definitions(-DNOMINMAX -D_USE_MATH_DEFINES) - set(LIBRARIES imgui::imgui nlohmann_json::nlohmann_json Tracy::TracyClient) +set(DEFINES -DNOMINMAX -D_USE_MATH_DEFINES -DVK_NO_PROTOTYPES) + +if(UNIX AND NOT APPLE) + set(DEFINES ${DEFINES} -DLINUX -DVK_USE_PLATFORM_XCB_KHR) +elseif(WIN32) + set(DEFINES ${DEFINES} -DWINDOWS -DVK_USE_PLATFORM_WIN32_KHR) +elseif(APPLE) + set(DEFINES ${DEFINES} -DMACOS -DVK_USE_PLATFORM_METAL_EXT) +endif() + + add_executable( path-tracer main.cpp @@ -18,9 +27,11 @@ add_executable( gltf.cpp compute-renderpass.cpp primitive-renderpass.cpp - ${Tracy_SOURCE_DIR}/TracyClient.cpp + # ${Tracy_SOURCE_DIR}/TracyClient.cpp ) +target_compile_definitions(path-tracer PUBLIC ${DEFINES}) + target_include_directories(path-tracer SYSTEM PUBLIC ${CMAKE_SOURCE_DIR}/thirdparty) target_include_directories(path-tracer PUBLIC ${CMAKE_SOURCE_DIR}/include) |
