From d40b5f5e08ac6a5804024cf1c446224ad8ffa90b Mon Sep 17 00:00:00 2001 From: laggykiller Date: Tue, 27 Feb 2024 04:01:59 +0800 Subject: [PATCH] Move cmake flags to pyproject.toml --- CMakeLists.txt | 8 -------- pyproject.toml | 6 ++++++ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 1c3e684..4b10610 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,14 +1,6 @@ cmake_minimum_required(VERSION 3.17) project(rlottie-python) -if (WIN32) - set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$: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 diff --git a/pyproject.toml b/pyproject.toml index e524103..0506708 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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$<$:Debug>" +CMAKE_CXX_FLAGS_RELEASE = "/MT" +CMAKE_CXX_FLAGS_DEBUG = "/MTd" \ No newline at end of file