Skip to content

Commit

Permalink
build: Turn libpl into an OBJECT library as well
Browse files Browse the repository at this point in the history
  • Loading branch information
WerWolv committed Feb 6, 2025
1 parent 79a27d3 commit 17adb10
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion cli/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang")
target_compile_options(plcli PRIVATE -Wall -Wextra -Werror -Wno-unknown-pragmas -Wno-array-bounds)
endif()
target_include_directories(plcli PUBLIC include ${CLI11_INCLUDE_DIRS})
target_link_libraries(plcli PRIVATE ${CLI11_LIBRARIES} ${NLOHMANN_JSON_LIBRARIES} libpl libpl-gen ${FMT_LIBRARIES})
target_link_libraries(plcli PRIVATE ${CLI11_LIBRARIES} ${NLOHMANN_JSON_LIBRARIES} libwolv libpl_includes libpl-gen ${FMT_LIBRARIES})

if (WIN32)
set(CMAKE_INSTALL_BINDIR ".")
Expand Down
5 changes: 4 additions & 1 deletion lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ if (LIBPL_SHARED_LIBRARY)
set(LIBRARY_TYPE SHARED)
message(STATUS "libpl dynamic library is being created")
else ()
set(LIBRARY_TYPE STATIC)
set(LIBRARY_TYPE OBJECT)
message(STATUS "libpl static library is being created")
endif ()

Expand Down Expand Up @@ -74,6 +74,8 @@ add_library(libpl ${LIBRARY_TYPE}
source/pl/core/resolvers.cpp
)

add_library(libpl_includes INTERFACE)

if (LIBPL_ENABLE_PRECOMPILED_HEADERS)
file(GLOB_RECURSE TARGET_INCLUDES "${CMAKE_CURRENT_SOURCE_DIR}/include/**/*.hpp")
set(SYSTEM_INCLUDES "<algorithm>;<array>;<atomic>;<chrono>;<cmath>;<cstddef>;<cstdint>;<cstdio>;<cstdlib>;<cstring>;<exception>;<filesystem>;<functional>;<iterator>;<limits>;<list>;<map>;<memory>;<optional>;<ranges>;<set>;<stdexcept>;<string>;<string_view>;<thread>;<tuple>;<type_traits>;<unordered_map>;<unordered_set>;<utility>;<variant>;<vector>")
Expand All @@ -99,6 +101,7 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
endif ()

target_include_directories(libpl PUBLIC include ../external/throwing_ptr/include)
target_include_directories(libpl_includes INTERFACE ${CMAKE_CURRENT_SOURCE_DIR}/include ../external/throwing_ptr/include)
target_link_libraries(libpl PRIVATE ${FMT_LIBRARIES})
target_link_libraries(libpl PUBLIC wolv::types wolv::io wolv::utils wolv::hash wolv::containers)

Expand Down

0 comments on commit 17adb10

Please sign in to comment.