Skip to content

Commit

Permalink
Move cmake flags to pyproject.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
laggykiller committed Feb 26, 2024
1 parent 0725b18 commit d40b5f5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
8 changes: 0 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
cmake_minimum_required(VERSION 3.17)
project(rlottie-python)

if (WIN32)
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /MT")
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /MTd")
elseif (LINUX)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fPIC")
endif()

add_subdirectory(rlottie)

# Install the module
Expand Down
6 changes: 6 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,15 @@ abi3_minimum_cpython_version = 312
[tool.py-build-cmake.linux.cmake] # Linux-specific options
config = "Release"
env = { "CMAKE_PREFIX_PATH" = "${HOME}/.local" }
[tool.py-build-cmake.linux.cmake.options]
CMAKE_CXX_FLAGS = "-fPIC"

[tool.py-build-cmake.mac.cmake] # macOS-specific options
config = "Release"

[tool.py-build-cmake.windows.cmake] # Windows-specific options
config = "Release"
[tool.py-build-cmake.windows.cmake.options]
CMAKE_MSVC_RUNTIME_LIBRARY = "MultiThreaded$<$<CONFIG:Debug>:Debug>"
CMAKE_CXX_FLAGS_RELEASE = "/MT"
CMAKE_CXX_FLAGS_DEBUG = "/MTd"

0 comments on commit d40b5f5

Please sign in to comment.