Skip to content

Commit

Permalink
Changes for MSVC
Browse files Browse the repository at this point in the history
  • Loading branch information
romeric committed May 30, 2020
1 parent 15326f8 commit 87225e3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_einsum/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ enable_testing()
# single einsum
add_executable(test_einsum_single test_einsum_single.cpp)
add_test(test_einsum_single test_einsum_single)
set_property(TARGET test_einsum_single PROPERTY CXX_STANDARD 17)

if(MSVC)
set_property(TARGET test_einsum_single PROPERTY CXX_STANDARD 17)
target_compile_options(test_einsum_single PRIVATE "/W2" "$<$<CONFIG:RELEASE>:/O2>")
else()
target_compile_options(test_einsum_single PRIVATE "$<$<CONFIG:RELEASE>:-O3>" "$<$<CONFIG:RELEASE>:-march=native>")
Expand All @@ -25,6 +25,7 @@ add_executable(test_contraction_0 test_contraction.cpp)
add_test(test_contraction_0 test_contraction_0)

if(MSVC)
set_property(TARGET test_contraction_0 PROPERTY CXX_STANDARD 17)
target_compile_options(test_contraction_0 PRIVATE "/W2" "$<$<CONFIG:RELEASE>:/O2>")
else()
target_compile_options(test_contraction_0 PRIVATE "$<$<CONFIG:RELEASE>:-O3>" "$<$<CONFIG:RELEASE>:-march=native>")
Expand All @@ -39,6 +40,7 @@ add_executable(test_contraction_1 test_contraction.cpp)
add_test(test_contraction_1 test_contraction_1)

if(MSVC)
set_property(TARGET test_contraction_1 PROPERTY CXX_STANDARD 17)
target_compile_options(test_contraction_1 PRIVATE "/W2" "$<$<CONFIG:RELEASE>:/O2>")
else()
target_compile_options(test_contraction_1 PRIVATE "-DCONTRACT_OPT=1" "$<$<CONFIG:RELEASE>:-O3>" "$<$<CONFIG:RELEASE>:-march=native>")
Expand All @@ -53,6 +55,7 @@ add_executable(test_contraction_2 test_contraction.cpp)
add_test(test_contraction_2 test_contraction_2)

if(MSVC)
set_property(TARGET test_contraction_2 PROPERTY CXX_STANDARD 17)
target_compile_options(test_contraction_2 PRIVATE "/W2" "$<$<CONFIG:RELEASE>:/O2>")
else()
target_compile_options(test_contraction_2 PRIVATE "-DCONTRACT_OPT=-1" "$<$<CONFIG:RELEASE>:-O3>" "$<$<CONFIG:RELEASE>:-march=native>")
Expand All @@ -68,6 +71,7 @@ add_executable(test_einsum_0 test_einsum.cpp)
add_test(test_einsum_0 test_einsum_0)

if(MSVC)
set_property(TARGET test_einsum_0 PROPERTY CXX_STANDARD 17)
target_compile_options(test_einsum_0 PRIVATE "/W2" "$<$<CONFIG:RELEASE>:/O2>")
else()
target_compile_options(test_einsum_0 PRIVATE "$<$<CONFIG:RELEASE>:-O3>" "$<$<CONFIG:RELEASE>:-march=native>")
Expand All @@ -82,6 +86,7 @@ add_executable(test_einsum_1 test_einsum.cpp)
add_test(test_einsum_1 test_einsum_1)

if(MSVC)
set_property(TARGET test_einsum_1 PROPERTY CXX_STANDARD 17)
target_compile_options(test_einsum_1 PRIVATE "/W2" "$<$<CONFIG:RELEASE>:/O2>")
else()
target_compile_options(test_einsum_1 PRIVATE "-DCONTRACT_OPT=1" "$<$<CONFIG:RELEASE>:-O3>" "$<$<CONFIG:RELEASE>:-march=native>")
Expand All @@ -96,6 +101,7 @@ add_executable(test_einsum_2 test_einsum.cpp)
add_test(test_einsum_2 test_einsum_2)

if(MSVC)
set_property(TARGET test_einsum_2 PROPERTY CXX_STANDARD 17)
target_compile_options(test_einsum_2 PRIVATE "/W2" "$<$<CONFIG:RELEASE>:/O2>")
else()
target_compile_options(test_einsum_2 PRIVATE "-DCONTRACT_OPT=-1" "$<$<CONFIG:RELEASE>:-O3>" "$<$<CONFIG:RELEASE>:-march=native>")
Expand Down

0 comments on commit 87225e3

Please sign in to comment.