From 64e187c3956a7a487cb5b93a96f2beb6be8bf8dc Mon Sep 17 00:00:00 2001 From: Max Gabrielsson Date: Tue, 24 Oct 2023 17:57:11 +0200 Subject: [PATCH] detect appleclang in cmake, add defines for DUCKDB_MAJOR/MINOR/PATCH_VERISON --- CMakeLists.txt | 2 +- src/function/table/version/CMakeLists.txt | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 82ee76200419..359f70d49c41 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -661,7 +661,7 @@ function(build_loadable_extension_directory NAME OUTPUT_DIRECTORY PARAMETERS) if(WASM_LOADABLE_EXTENSIONS) set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -sSIDE_MODULE=1 -DWASM_LOADABLE_EXTENSIONS") elseif (EXTENSION_STATIC_BUILD) - if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU" OR "${CMAKE_CXX_COMPILER_ID}" MATCHES "Clang") if (APPLE) set_target_properties(${TARGET_NAME} PROPERTIES CXX_VISIBILITY_PRESET hidden) # Note that on MacOS we need to use the -exported_symbol whitelist feature due to a lack of -exclude-libs flag in mac's ld variant diff --git a/src/function/table/version/CMakeLists.txt b/src/function/table/version/CMakeLists.txt index 2c54094c4503..dc1ec27d4e0e 100644 --- a/src/function/table/version/CMakeLists.txt +++ b/src/function/table/version/CMakeLists.txt @@ -1,5 +1,8 @@ add_definitions(-DDUCKDB_SOURCE_ID="\""${GIT_COMMIT_HASH}"\"") add_definitions(-DDUCKDB_VERSION="\""${DUCKDB_VERSION}"\"") +add_definitions(-DDUCKDB_VERSION_MAJOR=${DUCKDB_VERSION_MAJOR}) +add_definitions(-DDUCKDB_VERSION_MINOR=${DUCKDB_VERSION_MINOR}) +add_definitions(-DDUCKDB_VERSION_PATCH=${DUCKDB_VERSION_PATCH}) add_library_unity(duckdb_func_table_version OBJECT pragma_version.cpp)