-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace the setuptools based build system with scikit-build [1]. Scikit-build is an upstream python-cmake integration package that effectively enables building the extension code with cmake, rather than setuptools. The big problem with setuptools is developer experience, as it's pretty clunky and behaves quite differently from what you would expect with a more sophisticated build system for C++ code. By moving that responsibility to cmake and having skbuild invoke it, the extension code can use all of cmake for defines, compiler flags and even extension specific dependencies, without having to manually do discovery logic and configuration (essentially what cmake already does) in python. The CI definitions have been updated to reflect the changes in behaviour. There is a bug in the current upstream release 0.9.0 that makes appveyor break, but a change [2] is proposed upstream. For now, appveyor uses the jokva/scikit-build fork. For cmake .. && make && make install users, this patch should have little effect, but in all the new build system gives greater opportunity to tune and configure the compilation of the python extension. [1] https://scikit-build.readthedocs.io/en/latest [2] scikit-build/scikit-build#400
- Loading branch information
Showing
7 changed files
with
146 additions
and
123 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
cmake_minimum_required(VERSION 3.5.0) | ||
project(dlisio-python-extension LANGUAGES C CXX) | ||
|
||
set(CMAKE_CXX_STANDARD 11) | ||
set(CMAKE_CXX_VISIBILITY_PRESET "hidden") | ||
set(CMAKE_C_VISIBILITY_PRESET "hidden") | ||
|
||
find_package(PythonExtensions REQUIRED) | ||
find_package(dlisio REQUIRED) | ||
|
||
add_library(core MODULE dlisio/ext/core.cpp) | ||
target_include_directories(core | ||
PRIVATE | ||
${PYBIND11_INCLUDE_DIRS} | ||
) | ||
python_extension_module(core) | ||
target_link_libraries(core dlisio dlisio-extension) | ||
|
||
if (MSVC) | ||
target_compile_options(core | ||
BEFORE | ||
PRIVATE | ||
/EHsc | ||
) | ||
endif () | ||
|
||
install(TARGETS core LIBRARY DESTINATION dlisio) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.