aboutsummaryrefslogtreecommitdiffstats
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt27
1 files changed, 24 insertions, 3 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index b56a871..54a4c54 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -1,4 +1,4 @@
-set(LIBRARIES imgui::imgui nlohmann_json::nlohmann_json Tracy::TracyClient)
+set(LIBRARIES imgui::imgui)
set(DEFINES -DNOMINMAX -D_USE_MATH_DEFINES -DVK_NO_PROTOTYPES)
@@ -29,9 +29,31 @@ add_executable(
primitive-renderpass.cpp
bvh.cpp
mesh.cpp
- # ${Tracy_SOURCE_DIR}/TracyClient.cpp
)
+if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
+ target_compile_options(
+ path-tracer
+ PRIVATE
+ # -fsanitize=address TODO: enable once compiling with the flag works
+ -fcolor-diagnostics -fansi-escape-codes # colored output when using ninja
+ -ftime-trace
+ -msse4.1
+ # https://github.com/cpp-best-practices/cppbestpractices/blob/master/02-Use_the_Tools_Available.md#gcc--clang
+ -Wall
+ -Wextra
+ -Wshadow
+ -Wcast-align
+ -Wnon-virtual-dtor
+ -Wpedantic
+ -Wunused
+ )
+
+# target_link_options(path-tracer PRIVATE -fsanitize=address)
+endif()
+
+target_link_directories(path-tracer PRIVATE "C:\\Program Files\\LLVM\\lib\\clang\\14.0.6\\lib\\windows")
+
target_compile_definitions(path-tracer PUBLIC ${DEFINES})
target_include_directories(path-tracer SYSTEM PUBLIC ${CMAKE_SOURCE_DIR}/thirdparty)
@@ -43,7 +65,6 @@ if(UNIX AND NOT APPLE)
target_include_directories(path-tracer PUBLIC ${X11_xcb_INCLUDE_PATH})
endif()
-
if(UNIX AND NOT APPLE)
list(APPEND LIBRARIES ${CMAKE_DL_LIBS} ${X11_xcb_LIB} ${X11_xkbcommon_LIB} ${X11_xkbcommon_X11_LIB})
endif()