From 23e6a58d59b7a11cb8bdb7aa61d3c534c02027e7 Mon Sep 17 00:00:00 2001 From: ladevieq Date: Mon, 11 Jul 2022 00:50:27 +0200 Subject: Refactor includes & improve compile time Add platform defined to CMakeLists.txt --- src/CMakeLists.txt | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/CMakeLists.txt') 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) -- cgit v1.3