Skip to content

Commit

Permalink
Merge branch 'main' into FixWindowsExportSymbols
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-penev authored Mar 19, 2024
2 parents ab50613 + 468031a commit 8c0e48b
Show file tree
Hide file tree
Showing 33 changed files with 2,148 additions and 438 deletions.
1,049 changes: 946 additions & 103 deletions .github/workflows/ci.yml

Large diffs are not rendered by default.

77 changes: 71 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
cmake_minimum_required(VERSION 3.13)

enable_language(CXX)
set(CMAKE_CXX_EXTENSIONS NO)

include(GNUInstallDirs)

set(CMAKE_MODULE_PATH
${CMAKE_MODULE_PATH}
"${CMAKE_CURRENT_SOURCE_DIR}/cmake"
Expand Down Expand Up @@ -54,11 +59,11 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )
## Define supported version of clang and llvm

set(CLANG_MIN_SUPPORTED 13.0)
set(CLANG_MAX_SUPPORTED "17.0.x")
set(CLANG_VERSION_UPPER_BOUND 17.1.0)
set(CLANG_MAX_SUPPORTED "18.1.x")
set(CLANG_VERSION_UPPER_BOUND 19.0.0)
set(LLVM_MIN_SUPPORTED 13.0)
set(LLVM_MAX_SUPPORTED "17.0.x")
set(LLVM_VERSION_UPPER_BOUND 17.1.0)
set(LLVM_MAX_SUPPORTED "18.1.x")
set(LLVM_VERSION_UPPER_BOUND 19.0.0)

## Set Cmake packages search order

Expand Down Expand Up @@ -206,6 +211,9 @@ if( CMAKE_SOURCE_DIR STREQUAL CMAKE_CURRENT_SOURCE_DIR )

endif()

##Replace \ with / in LLVM_DIR (attempt to fix path parsing issue Windows)
string(REPLACE "\\" "/" LLVM_DIR "${LLVM_DIR}")

# When in debug mode the llvm package thinks it is built with -frtti.
# For consistency we should set it to the correct value.
set(LLVM_CONFIG_HAS_RTTI NO CACHE BOOL "" FORCE)
Expand Down Expand Up @@ -312,7 +320,7 @@ include_directories(BEFORE SYSTEM
)


file(READ "VERSION" CPPINTEROP_VERSION)
file(STRINGS "VERSION" CPPINTEROP_VERSION)
string(REGEX MATCH "([0-9]*)\.([0-9]*)\.([0-9]*)" CPPINTEROP_VERSION_ONLY "${CPPINTEROP_VERSION}")
set(CPPINTEROP_VERSION_MAJOR "${CMAKE_MATCH_1}")
set(CPPINTEROP_VERSION_MINOR "${CMAKE_MATCH_2}")
Expand Down Expand Up @@ -368,7 +376,64 @@ endif()
option(CPPINTEROP_INCLUDE_DOCS "Generate build targets for the CppInterOp docs.")
option(CPPINTEROP_ENABLE_DOXYGEN "Use doxygen to generate CppInterOp interal API documentation.")
option(CPPINTEROP_ENABLE_SPHINX "Use sphinx to generage CppInterOp user documentation")
option(CPPINTEROP_ENABLE_TESTING "Enables the testing infrastructure." ON)


if(EMSCRIPTEN)
message("Build with emscripten")
option(CPPINTEROP_ENABLE_TESTING "Enables the testing infrastructure." OFF)
else()
message("Build with cmake")
option(CPPINTEROP_ENABLE_TESTING "Enables the testing infrastructure." ON)
endif()

if(MSVC)

set(MSVC_EXPORTLIST
??_7type_info@@6B@
?nothrow@std@@3Unothrow_t@1@B
_Init_thread_header
_Init_thread_footer
??_7type_info@@6B@
?_Facet_Register@std@@YAXPEAV_Facet_base@1@@Z
)

set(MSVC_EXPORTLIST ${MSVC_EXPORTLIST}
??2@YAPEAX_K@Z
??3@YAXPEAX@Z
??3@YAXPEAX_K@Z
??_U@YAPEAX_K@Z
??_V@YAXPEAX@Z
??_V@YAXPEAX_K@Z
??2@YAPEAX_KAEBUnothrow_t@std@@@Z
??_U@YAPEAX_KAEBUnothrow_t@std@@@Z
??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@H@Z
??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@M@Z
??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@N@Z
??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@PEBX@Z
??6?$basic_ostream@DU?$char_traits@D@std@@@std@@QEAAAEAV01@P6AAEAV01@AEAV01@@Z@Z
??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@D@Z
??$?6U?$char_traits@D@std@@@std@@YAAEAV?$basic_ostream@DU?$char_traits@D@std@@@0@AEAV10@PEBD@Z
?_Facet_Register@std@@YAXPEAV_Facet_base@1@@Z
)

if(MSVC_VERSION LESS 1914)
set(MSVC_EXPORTLIST ${MSVC_EXPORTLIST} ??3@YAXPAX0@Z ??_V@YAXPAX0@Z)
endif()

if(MSVC_VERSION GREATER_EQUAL 1936)
set(MSVC_EXPORTLIST ${MSVC_EXPORTLIST}
__std_find_trivial_1
__std_find_trivial_2
__std_find_trivial_4
__std_find_trivial_8
)
endif()

foreach(sym ${MSVC_EXPORTLIST})
set(MSVC_EXPORTS "${MSVC_EXPORTS} /EXPORT:${sym}")
endforeach(sym ${MSVC_EXPORTLIST})

endif()

if (CPPINTEROP_INCLUDE_DOCS)
add_subdirectory(docs)
Expand Down
Loading

0 comments on commit 8c0e48b

Please sign in to comment.