Skip to content

Commit

Permalink
fix: add features from setup.py to CMake
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed Mar 30, 2024
1 parent 358e529 commit 8670dd9
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,15 @@ target_include_directories(
extern/throw_exception/include
extern/variant2/include)

# Useful flags
target_compile_options(_core
PRIVATE $<IF:$<CXX_COMPILER_ID:MSVC>,/fp:fast,-funsafe-math-optimizations>)
# Support older Windows from newer MSVC
target_compile_options(_core PRIVATE $<IF:$<CXX_COMPILER_ID:MSVC>,/d2FH4->)
# Better error messages
target_compile_definitions(_core PRIVATE PYBIND11_DETAILED_ERROR_MESSAGES)

# Atomic is required for armv7l
if(CMAKE_SYSTEM_PROCESSOR MATCHES "armv7l")
target_link_libraries(_core PRIVATE atomic)
endif()

# This makes IDE's like XCode mimic the Boost Histogram structure
source_group(
Expand Down

0 comments on commit 8670dd9

Please sign in to comment.