Skip to content

Commit

Permalink
cmake bugfix #include-s order and pch.h
Browse files Browse the repository at this point in the history
  • Loading branch information
silverqx committed May 22, 2024
1 parent 3028254 commit 5b924cc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
)
endif()

# Order of #include-s is very important because of pch.h as its name is the same for all
# projects, the ${PROJECT_SOURCE_DIR}/include must be as the first #include!
target_include_directories(${TinyOrm_target}
PUBLIC "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
)
Expand Down
10 changes: 5 additions & 5 deletions drivers/common/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,12 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
)
endif()

# Order of #include-s is very important because of pch.h as its name is the same for all
# projects, the ${PROJECT_SOURCE_DIR}/include must be as the first #include!
target_include_directories(${TinyDrivers_target}
PUBLIC
"$<BUILD_INTERFACE:${${TinyOrm_ns}_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
PRIVATE
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include_private>"
PUBLIC "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
PRIVATE "$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include_private>"
PUBLIC "$<BUILD_INTERFACE:${${TinyOrm_ns}_SOURCE_DIR}/include>"
)

if(BUILD_MYSQL_DRIVER)
Expand Down
2 changes: 2 additions & 0 deletions drivers/mysql/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@ if(CMAKE_SYSTEM_NAME STREQUAL "Windows")
)
endif()

# Order of #include-s is very important because of pch.h as its name is the same for all
# projects, the ${PROJECT_SOURCE_DIR}/include must be as the first #include!
target_include_directories(${TinyMySql_target}
PRIVATE
"$<BUILD_INTERFACE:${PROJECT_SOURCE_DIR}/include>"
Expand Down

0 comments on commit 5b924cc

Please sign in to comment.