From a0b5ae14e007af65489a8fd533f4a869c463d537 Mon Sep 17 00:00:00 2001 From: stuxnot <41650734+Stuxnot@users.noreply.github.com> Date: Wed, 11 Oct 2023 15:56:28 +0200 Subject: [PATCH] Update cmake to only build nyxstone internals once --- CMakeLists.txt | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 8b76e2e..d8797bd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,8 +20,10 @@ file(GLOB srcs # add_compile_options(-fsanitize=address,undefined) # add_link_options(-fsanitize=address,undefined) -add_executable(nstone examples/nyxstone-cli.cpp ${srcs}) -add_executable(sample examples/sample.cpp ${srcs}) +add_library(nyxstone ${srcs}) -target_link_libraries(nstone ${llvm_libs} ${Boost_LIBRARIES}) -target_link_libraries(sample ${llvm_libs}) +add_executable(nstone examples/nyxstone-cli.cpp) +add_executable(sample examples/sample.cpp) + +target_link_libraries(nstone nyxstone ${llvm_libs} ${Boost_LIBRARIES}) +target_link_libraries(sample nyxstone ${llvm_libs})