refactor: quantity cration helpers are not opt-out rather than opt-in

Resolves #277
This commit is contained in:
Mateusz Pusz
2021-05-09 15:52:20 +02:00
parent c1cf800bd1
commit 2c8c6c2e98
99 changed files with 500 additions and 517 deletions
+8 -2
View File
@@ -28,7 +28,10 @@ cmake_minimum_required(VERSION 3.2)
function(add_example target)
add_executable(${target}-aliases ${target}.cpp)
target_link_libraries(${target}-aliases PRIVATE ${ARGN})
target_compile_definitions(${target}-aliases PRIVATE UNITS_ALIASES)
target_compile_definitions(${target}-aliases PRIVATE
UNITS_NO_LITERALS
UNITS_NO_REFERENCES
)
endfunction()
add_example(avg_speed mp-units::core-io mp-units::si mp-units::si-cgs mp-units::si-international)
@@ -43,7 +46,10 @@ add_example(unknown_dimension mp-units::core-io mp-units::si)
if(NOT UNITS_LIBCXX)
add_example(glide_computer_example mp-units::core-fmt mp-units::si-international glide_computer)
target_compile_definitions(glide_computer_example-aliases PRIVATE UNITS_REFERENCES)
target_compile_definitions(glide_computer_example-aliases PRIVATE
UNITS_NO_LITERALS
UNITS_NO_REFERENCES
)
find_package(linear_algebra CONFIG REQUIRED)
add_example(linear_algebra mp-units::core-fmt mp-units::core-io mp-units::si)
-4
View File
@@ -20,10 +20,6 @@
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
// SOFTWARE.
#define UNITS_ALIASES
#define UNITS_LITERALS
#define UNITS_REFERENCES
#include <units/format.h>
#include <units/isq/si/international/length.h>
#include <units/isq/si/international/speed.h> // IWYU pragma: keep
+4 -1
View File
@@ -28,7 +28,10 @@ cmake_minimum_required(VERSION 3.2)
function(add_example target)
add_executable(${target} ${target}.cpp)
target_link_libraries(${target} PRIVATE ${ARGN})
target_compile_definitions(${target} PRIVATE UNITS_REFERENCES)
target_compile_definitions(${target} PRIVATE
UNITS_NO_LITERALS
UNITS_NO_ALIASES
)
endfunction()
add_example(kalman_filter-example_1 mp-units::core-fmt mp-units::si)
+8 -2
View File
@@ -28,7 +28,10 @@ cmake_minimum_required(VERSION 3.2)
function(add_example target)
add_executable(${target}-literals ${target}.cpp)
target_link_libraries(${target}-literals PRIVATE ${ARGN})
target_compile_definitions(${target}-literals PRIVATE UNITS_LITERALS)
target_compile_definitions(${target}-literals PRIVATE
UNITS_NO_REFERENCES
UNITS_NO_ALIASES
)
endfunction()
add_example(avg_speed mp-units::core-io mp-units::si mp-units::si-cgs mp-units::si-international)
@@ -42,7 +45,10 @@ add_example(unknown_dimension mp-units::core-io mp-units::si)
if(NOT UNITS_LIBCXX)
add_example(glide_computer_example mp-units::core-fmt mp-units::si-international glide_computer)
target_compile_definitions(glide_computer_example-literals PRIVATE UNITS_LITERALS)
target_compile_definitions(glide_computer_example-literals PRIVATE
UNITS_NO_REFERENCES
UNITS_NO_ALIASES
)
find_package(linear_algebra CONFIG REQUIRED)
add_example(linear_algebra mp-units::core-fmt mp-units::core-io mp-units::si)
+8 -2
View File
@@ -28,7 +28,10 @@ cmake_minimum_required(VERSION 3.2)
function(add_example target)
add_executable(${target}-references ${target}.cpp)
target_link_libraries(${target}-references PRIVATE ${ARGN})
target_compile_definitions(${target}-references PRIVATE UNITS_REFERENCES)
target_compile_definitions(${target}-references PRIVATE
UNITS_NO_LITERALS
UNITS_NO_ALIASES
)
endfunction()
add_example(avg_speed mp-units::core-io mp-units::si mp-units::si-cgs mp-units::si-international)
@@ -42,7 +45,10 @@ add_example(unknown_dimension mp-units::core-io mp-units::si)
if(NOT UNITS_LIBCXX)
add_example(glide_computer_example mp-units::core-fmt mp-units::si-international glide_computer)
target_compile_definitions(glide_computer_example-references PRIVATE UNITS_REFERENCES)
target_compile_definitions(glide_computer_example-references PRIVATE
UNITS_NO_LITERALS
UNITS_NO_ALIASES
)
find_package(linear_algebra CONFIG REQUIRED)
add_example(linear_algebra mp-units::core-fmt mp-units::core-io mp-units::si)