Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building with Clang on Windows #300

Merged
merged 25 commits into from
Jul 23, 2020
Prev Previous commit
Next Next commit
no message
shibatch committed Mar 27, 2020
commit 81d8df34cf603887f129e5c17d0e73ef4d9d91ad
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -65,7 +65,7 @@ message(STATUS "CMAKE_C_SIMULATE_ID ${CMAKE_C_SIMULATE_ID}")

if (CMAKE_C_COMPILER_ID MATCHES "Clang" AND "x${CMAKE_C_SIMULATE_ID}" STREQUAL "xMSVC")
message(STATUS "Building with Clang on Windows")
set(SLEEF_CLANG_FOR_WINDOWS TRUE)
set(SLEEF_CLANG_ON_WINDOWS TRUE)
endif()

# sleef-config.h.in passes cmake settings to the source code
2 changes: 1 addition & 1 deletion Configure.cmake
Original file line number Diff line number Diff line change
@@ -307,7 +307,7 @@ if(CMAKE_C_COMPILER_ID MATCHES "(GNU|Clang)")
set(FLAGS_ENABLE_NEON32 "-mfpu=neon")
endif(CMAKE_C_COMPILER_ID MATCHES "GNU")

if (SLEEF_CLANG_FOR_WINDOWS)
if (SLEEF_CLANG_ON_WINDOWS)
string(CONCAT FLAGS_WALL ${FLAGS_WALL} " -D_CRT_SECURE_NO_WARNINGS -Wno-deprecated-declarations")
fpetrogalli marked this conversation as resolved.
Show resolved Hide resolved
endif()
elseif(MSVC)
4 changes: 2 additions & 2 deletions src/dft-tester/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -41,7 +41,7 @@ if (COMPILER_SUPPORTS_OPENMP)
set(COMMON_LINK_LIBRARIES ${COMMON_LINK_LIBRARIES} ${OpenMP_C_FLAGS})
endif()

if((NOT MSVC) AND NOT SLEEF_CLANG_CL)
if((NOT MSVC) AND NOT SLEEF_CLANG_ON_WINDOWS)
# Target executable naivetestdp
set(TARGET_NAIVETESTDP "naivetestdp")
add_executable(${TARGET_NAIVETESTDP} naivetest.c ${PROJECT_SOURCE_DIR}/include/sleefdft.h)
@@ -162,7 +162,7 @@ if (LIBFFTW3)
add_test_dft(${TARGET_FFTWTEST2DSP}_10_10 $<TARGET_FILE:${TARGET_FFTWTEST2DSP}> 10 10)
add_test_dft(${TARGET_FFTWTEST2DSP}_5_15 $<TARGET_FILE:${TARGET_FFTWTEST2DSP}> 5 15)
else(LIBFFTW3)
if(MSVC OR SLEEF_CLANG_CL)
if(MSVC OR SLEEF_CLANG_ON_WINDOWS)
# Test roundtriptestdp
add_test_dft(${TARGET_ROUNDTRIPTEST1DDP}_1 $<TARGET_FILE:${TARGET_ROUNDTRIPTEST1DDP}> 1 10)
add_test_dft(${TARGET_ROUNDTRIPTEST1DDP}_2 $<TARGET_FILE:${TARGET_ROUNDTRIPTEST1DDP}> 2 10)
2 changes: 1 addition & 1 deletion src/libm/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ foreach(SIMD ${SLEEF_HEADER_LIST})
list(APPEND SLEEF_HEADER_COMMANDS COMMAND $<TARGET_FILE:${TARGET_MKRENAME}> ${HEADER_PARAMS_${SIMD}} >> ${SLEEF_INCLUDE_HEADER})
endforeach()

if((MSVC OR MINGW AND WIN32) OR SLEEF_CLANG_CL)
if((MSVC OR MINGW AND WIN32) OR SLEEF_CLANG_ON_WINDOWS)
string(REPLACE "/" "\\" sleef_footer_input_file "${SLEEF_ORG_FOOTER}")
list(APPEND SLEEF_HEADER_COMMANDS COMMAND type ${sleef_footer_input_file} >> ${SLEEF_INCLUDE_HEADER})
else()
2 changes: 1 addition & 1 deletion src/quad/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -60,7 +60,7 @@ foreach(SIMD ${SLEEFQUAD_SUPPORTED_EXT})
endif()
endforeach()

if(MSVC OR SLEEF_CLANG_FOR_WINDOWS OR MINGW AND WIN32)
if(MSVC OR SLEEF_CLANG_ON_WINDOWS OR MINGW AND WIN32)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this condition different from the one if((MSVC OR MINGW AND WIN32) OR SLEEF_CLANG_ON_WINDOWS) 25 of src/libm/CMakeLists.txt?

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those two are now same.

string(REPLACE "/" "\\" sleef_footer_input_file "${SLEEFQUAD_ORG_FOOTER}")
list(APPEND SLEEF_HEADER_COMMANDS COMMAND type ${sleef_footer_input_file} >> ${SLEEFQUAD_INCLUDE_HEADER})
else()