1. 14 Feb, 2017 3 commits
    • Dean Moldovan's avatar
      d361ea15
    • Jason Rhinelander's avatar
      Store LTO flags in PYBIND11_LTO_{CXX,LINKER}_FLAGS cache variables · c137c0a8
      Jason Rhinelander authored
      This both lets us not bother rechecking LTO flags when cmake reinvokes
      itself, and also lets the cmake invoker override to specify custom or
      no LTO flags by setting the cache variable with
      -DPYBIND11_LTO_CXX_FLAGS= when invoking cmake.
      c137c0a8
    • Jason Rhinelander's avatar
      Overhaul LTO flag detection · 1bee6e7d
      Jason Rhinelander authored
      Clang on linux currently fails to run cmake:
      
          $ CC=clang CXX=clang++ cmake ..
          ...
          -- Configuring done
          CMake Error at tools/pybind11Tools.cmake:135 (target_compile_options):
            Error evaluating generator expression:
      
              $<:-flto>
      
            Expression did not evaluate to a known generator expression
          Call Stack (most recent call first):
            tests/CMakeLists.txt:68 (pybind11_add_module)
      
      But investigating this led to various other -flto detection problems;
      this commit thus overhauls LTO flag detection:
      
      - -flto needs to be passed to the linker as well
      - Also compile with -fno-fat-lto-objects under GCC
      - Pass the equivalent flags to MSVC
      - Enable LTO flags for via generator expressions (for non-debug builds
        only), so that multi-config builds (like on Windows) still work
        properly.  This seems reasonable, however, even on single-config
        builds (and simplifies the cmake code a bit).
      - clang's lto linker plugins don't accept '-Os', so replace it with
        '-O3' when doing a MINSIZEREL build
      - Enable trying ThinLTO by default for test suite (only affects clang)
      - Match Clang$ rather than ^Clang$ because, for cmake with 3.0+
        policies in effect, the compiler ID will be AppleClang on macOS.
      1bee6e7d
  2. 13 Jan, 2017 1 commit
  3. 06 Jan, 2017 2 commits
  4. 19 Dec, 2016 3 commits
    • Dean Moldovan's avatar
      Rename target from pybind11::pybind11 to pybind11::module · 71e8a796
      Dean Moldovan authored
      Makes room for an eventual pybind11::embedded target.
      71e8a796
    • Dean Moldovan's avatar
      Add new options and docs for pybind11_add_module · 0cbec5c9
      Dean Moldovan authored
      See the documentation for a description of the options.
      0cbec5c9
    • Dean Moldovan's avatar
      Make sure add_subdirectory and find_package behave identically · b0f3885c
      Dean Moldovan authored
      Add a BUILD_INTERFACE and a pybind11::pybind11 alias for the interface
      library to match the installed target.
      
      Add new cmake tests for add_subdirectory and consolidates the
      .cpp and .py files needed for the cmake build tests:
      
      Before:
      tests
      |-- test_installed_module
      |   |-- CMakeLists.txt
      |   |-- main.cpp
      |   \-- test.py
      \-- test_installed_target
          |-- CMakeLists.txt
          |-- main.cpp
          \-- test.py
      
      After:
      tests
      \-- test_cmake_build
          |-- installed_module/CMakeLists.txt
          |-- installed_target/CMakeLists.txt
          |-- subdirectory_module/CMakeLists.txt
          |-- subdirectory_target/CMakeLists.txt
          |-- main.cpp
          \-- test.py
      b0f3885c
  5. 13 Dec, 2016 2 commits
  6. 12 Dec, 2016 1 commit
  7. 22 Nov, 2016 1 commit
  8. 20 Nov, 2016 1 commit
    • Dean Moldovan's avatar
      Always use return_value_policy::move for rvalues (#510) · d079f41c
      Dean Moldovan authored
      Fixes #509.
      
      The move policy was already set for rvalues in PR #473, but this only
      applied to directly cast user-defined types. The problem is that STL
      containers cast values indirectly and the rvalue information is lost.
      Therefore the move policy was not set correctly. This commit fixes it.
      
      This also makes an additional adjustment to remove the `copy` policy
      exception: rvalues now always use the `move` policy. This is also safe
      for copy-only rvalues because the `move` policy has an internal fallback
      to copying.
      d079f41c
  9. 08 Nov, 2016 2 commits
  10. 04 Nov, 2016 1 commit
    • Jason Rhinelander's avatar
      Add debugging info about .so size to build output (#477) · dc0b4bd2
      Jason Rhinelander authored
      * Add debugging info about so size to build output
      
      This adds a small python script to tools that captures before-and-after
      .so sizes between builds and outputs this in the build output via a
      string such as:
      
      ------ pybind11_tests.cpython-35m-x86_64-linux-gnu.so file size: 924696 (decrease of 73680 bytes = 7.38%)
      
      ------ pybind11_tests.cpython-35m-x86_64-linux-gnu.so file size: 998376 (increase of 73680 bytes = 7.97%)
      
      ------ pybind11_tests.cpython-35m-x86_64-linux-gnu.so file size: 998376 (no change)
      
      Or, if there was no .so during the build, just the .so size by itself:
      
      ------ pybind11_tests.cpython-35m-x86_64-linux-gnu.so file size: 998376
      
      This allows you to, for example, build, checkout a different branch,
      rebuild, and easily see exactly the change in the pybind11_tests.so
      size.
      
      It also allows looking at the travis and appveyor build logs to get an
      idea of .so/.dll sizes across different build systems.
      
      * Minor libsize.py script changes
      
      - Use RAII open
      - Remove unused libsize=-1
      - Report change as [+-]xyz bytes = [+-]a.bc%
      dc0b4bd2
  11. 09 Oct, 2016 1 commit
  12. 06 Sep, 2016 1 commit
  13. 04 Sep, 2016 1 commit
  14. 30 Aug, 2016 1 commit
    • Jason Rhinelander's avatar
      Add line numbers; show and highlight found tabs · d472f0f0
      Jason Rhinelander authored
      This makes the output considerably easier to use: it now highlights (in
      red) matched tabs (instead of just listing the filenames), and adds
      line numbers to both the tabs check and the space-less if check outputs.
      d472f0f0
  15. 29 Aug, 2016 1 commit
    • Jason Rhinelander's avatar
      Fix check-style exit status · 5a3570c4
      Jason Rhinelander authored
      The check-style exit status wasn't being propagated properly because
      the loops were running in a subshell (and so the change the the
      `errors` variable wasn't in the active command shell).  This fixes it
      by running the greps in subshells and the loops in the main shell.
      
      This also avoids the if(/for(/while( style check on
      tests/CMakeLists.txt, since it *does* have if() statements with no space
      that are producing error messages, but that is (acceptable) CMake style.
      5a3570c4
  16. 28 Aug, 2016 2 commits
  17. 27 Aug, 2016 1 commit
  18. 08 Aug, 2016 1 commit
    • Christian Ewald's avatar
      Fixed finding python libraries on windows in venv · b81c500c
      Christian Ewald authored
      When run on windows in a venv, PYTHON_LIBRARY pointet to a non-existant
      location in the virtual environment directory.
      
      This has been fixed by testing if the path exists and, if not, trying
      an alternative path, relative to the PYTHON_INCLUDE_DIR.
      
      If the alternative path doesn't exit as well, an error will be raised.
      b81c500c
  19. 01 Jul, 2016 1 commit
  20. 12 Jun, 2016 1 commit
  21. 22 May, 2016 1 commit
  22. 20 May, 2016 1 commit
  23. 05 May, 2016 1 commit
  24. 01 May, 2016 2 commits
  25. 30 Apr, 2016 2 commits
  26. 29 Apr, 2016 2 commits
  27. 26 Apr, 2016 1 commit
  28. 25 Apr, 2016 1 commit
  29. 19 Apr, 2016 1 commit