Skip to content

Commit

Permalink
today()
Browse files Browse the repository at this point in the history
  • Loading branch information
christoph2 committed Jun 14, 2024
1 parent 60f3e36 commit f06fe29
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
cmake_minimum_required(VERSION 3.7...3.29)
project(pya2l_extensions LANGUAGES C CXX)

message("BUILD_OK? " ${BUILD_OK})

find_package(Python COMPONENTS Interpreter Development)
message("Python executable: " ${PYTHON_EXECUTABLE})

Expand All @@ -17,7 +19,7 @@ set(CMAKE_CXX_STANDARD 23)
set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/dist")


SET(GCC_N_CLANG_BASE_OPTIONS "-Wall -Wextra -Wpedantic -Warray-bounds -mtune=native -fexceptions")
SET(GCC_N_CLANG_BASE_OPTIONS "-std=c++23 -Wall -Wextra -Wpedantic -Warray-bounds -mtune=native -fexceptions")
# target_link_options(${PROJECT_NAME} PUBLIC -flto=auto)

SET(MSVC_BASE_OPTIONS "/W3 /EHsc /bigobj /std:c++latest")
Expand Down Expand Up @@ -153,5 +155,5 @@ ENDIF()
install(TARGETS preprocessor LIBRARY DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/pya2l)
install(TARGETS a2lparser_ext LIBRARY DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/pya2l)

install(FILES ${ANTLR_AMLParser_CXX_OUTPUTS} LIBRARY DESTINATION ${PROJECT_SOURCE_DIR}/pya2l/libs)
# install(FILES ${ANTLR_AMLParser_CXX_OUTPUTS} LIBRARY DESTINATION ${PROJECT_SOURCE_DIR}/pya2l/libs)
# install(TARGETS AMLParser LIBRARY DESTINATION ${CMAKE_CURRENT_SOURCE_DIR}/pya2l)
2 changes: 2 additions & 0 deletions build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,10 @@ def build_extension(debug: bool = False) -> None:
# from Python.
cmake_args = [
# f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}{os.sep}",
"-G Ninja",
f"-DPYTHON_EXECUTABLE={sys.executable}",
f"-DCMAKE_BUILD_TYPE={cfg}", # not used on MSVC, but no harm
"-DBUILD_OK=1",
]
build_args = []
# Adding CMake arguments set as environment variable
Expand Down
2 changes: 1 addition & 1 deletion pya2l/extensions/utils.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ inline std::optional<std::string> get_env_var(const std::string &var) {
#else
inline std::optional<std::string> get_env_var(const std::string &var) {

#if defined (__APPLE__)
#if (defined (__APPLE__) || defined(_WIN32))
auto res = getenv(var.c_str());
#else
auto res = secure_getenv(var.c_str());
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ include = [
packages = [
{ include = "pya2l" }
]
# package_data={"": "CMakeLists.txt"}


[tool.poetry.dependencies]
Expand All @@ -51,7 +52,7 @@ pre-commit-hooks = "^4.6.0"

pyupgrade = "^3.16.0"
[build-system]
requires = ["poetry-core>=1.6.0", "wheel", "cmake>=3.12"]
requires = ["poetry-core>=1.6.0", "wheel", "cmake>=3.12", "ninja"]
build-backend = "poetry.core.masonry.api"


Expand Down

0 comments on commit f06fe29

Please sign in to comment.