Skip to content

Commit

Permalink
chore: Update CMakeLists.txt and flake.nix
Browse files Browse the repository at this point in the history
  • Loading branch information
mauro-balades committed Jun 17, 2024
1 parent dbe44f5 commit aabd4db
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 deletions.
21 changes: 14 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,11 +82,6 @@ endif(CMAKE_INSTALL_PREFIX_INITIALIZED_TO_DEFAULT)

find_package(PkgConfig REQUIRED)

if (${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
else()
pkg_check_modules(GLIB REQUIRED glib-2.0)
endif()

find_package(LLVM 16 REQUIRED CONFIG)

add_definitions(${LLVM_DEFINITIONS})
Expand Down Expand Up @@ -191,6 +186,18 @@ else()
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,-rpath,$ORIGIN/../lib")
endif()

if (${CMAKE_BUILD_TYPE} MATCHES "Debug")
message(STATUS "Detected Debug build")
set(STATIC_LIBCPP "")
else()
if (APPLE)
else()
message(STATUS "Detected Release build")
set(STATIC_LIBCPP "-static-libstdc++")
endif()
endif()


# Add "LLD" libraries for all targets to the linker flags
set(LLD_LINKED_NAMES "lldCOFF" "lldELF" "lldMachO" "lldMinGW" "lldWasm" "LLVMLibDriver" "lldCommon")
set(LLD_LINKED_LIBS "")
Expand Down Expand Up @@ -241,8 +248,8 @@ target_include_directories(${PROJECT_NAME} PUBLIC
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<INSTALL_INTERFACE:include> ${BLAKE3_SOURCE_DIR} PRIVATE source)
target_link_libraries(${PROJECT_NAME} PUBLIC ${llvm_libs} ${GLIB_LIBRARIES}
${targets} ${PROJECT_LIBRARIES}
target_link_libraries(${PROJECT_NAME} PUBLIC ${llvm_libs}
${targets} ${PROJECT_LIBRARIES} ${STATIC_LIBCPP}
nlohmann_json::nlohmann_json fmt::fmt ${BLAKE3_BUILD_DIR}/libblake3.a
${LLD_LINKED_LIBS})
target_link_libraries(snowballexe PUBLIC ${PROJECT_NAME})
Expand Down
2 changes: 0 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
zstd
libxml2
libsigsegv
glib
pcre2
libllvm
openssl
Expand Down Expand Up @@ -103,7 +102,6 @@
libsigsegv
cmake
pkg-config
glib
pcre2
libllvm
libxml2
Expand Down

0 comments on commit aabd4db

Please sign in to comment.