From 5b924cc56b81cbb907523aaccc0183636cf97b20 Mon Sep 17 00:00:00 2001 From: silverqx Date: Wed, 22 May 2024 14:47:25 +0200 Subject: [PATCH] cmake bugfix #include-s order and pch.h --- CMakeLists.txt | 2 ++ drivers/common/CMakeLists.txt | 10 +++++----- drivers/mysql/CMakeLists.txt | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index f73b17ca9..ade0b65d2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -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 "$" ) diff --git a/drivers/common/CMakeLists.txt b/drivers/common/CMakeLists.txt index 82bcaaf35..0ca7c89c3 100644 --- a/drivers/common/CMakeLists.txt +++ b/drivers/common/CMakeLists.txt @@ -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 - "$" - "$" - PRIVATE - "$" + PUBLIC "$" + PRIVATE "$" + PUBLIC "$" ) if(BUILD_MYSQL_DRIVER) diff --git a/drivers/mysql/CMakeLists.txt b/drivers/mysql/CMakeLists.txt index 140de5f88..fe68a7dd1 100644 --- a/drivers/mysql/CMakeLists.txt +++ b/drivers/mysql/CMakeLists.txt @@ -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 "$"