Skip to content

Commit

Permalink
Fix macOS include errors
Browse files Browse the repository at this point in the history
  • Loading branch information
rozukke committed Oct 3, 2024
1 parent df7898b commit 3c03de4
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
run: sudo make install

- name: Update linux cache
if: runner.os == 'Linux'
if: runner.os == 'ubuntu-latest'
run: sudo ldconfig

- name: Compile and link library
Expand Down
11 changes: 9 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ set(CMAKE_CXX_FLAGS "-Wall -Wextra")
set(CMAKE_CXX_FLAGS_DEBUG "-g")
set(CMAKE_CXX_FLAGS_RELEASE "-O3")

set(MCPP_SRC_DIR src)
set(MCPP_INC_DIR include/mcpp)
set(MCPP_SRC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/src)
set(MCPP_INC_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include/mcpp)

# Testing
add_subdirectory(test)
Expand All @@ -44,6 +44,13 @@ set_target_properties(${PROJECT_NAME}
INSTALL_NAME_DIR ${LIB_INSTALL_DIR}
)

# Fix silly macOS include errors
target_include_directories(${PROJECT_NAME}
PUBLIC
$<BUILD_INTERFACE:${MCPP_INC_DIR}>
$<INSTALL_INTERFACE:include/${PROJECT_NAME}>
)

install(TARGETS ${PROJECT_NAME}
LIBRARY DESTINATION ${LIB_INSTALL_DIR}
PUBLIC_HEADER DESTINATION ${HEADER_INSTALL_DIR}
Expand Down

0 comments on commit 3c03de4

Please sign in to comment.