Skip to content

MSVC build fixes #4299

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

Merged
merged 3 commits into from
Feb 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions src/ansi-c/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,11 @@ add_custom_command(
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

add_custom_target(c_library_check
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/library-check.stamp
if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
add_custom_target(c_library_check
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/library-check.stamp
)
endif()

################################################################################

Expand Down Expand Up @@ -102,6 +104,12 @@ set(extra_dependencies
${CMAKE_CURRENT_BINARY_DIR}/library-check.stamp
)

if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
list(REMOVE_ITEM
extra_dependencies
${CMAKE_CURRENT_BINARY_DIR}/library-check.stamp)
endif()

file(GLOB_RECURSE sources "*.cpp" "*.h")

list(REMOVE_ITEM sources
Expand Down
4 changes: 2 additions & 2 deletions src/ansi-c/library_check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ for f in "$@"; do
perl -p -i -e 's/(_mm_.fence)/s$1/' __libcheck.c
perl -p -i -e 's/(__sync_)/s$1/' __libcheck.c
perl -p -i -e 's/(__noop)/s$1/' __libcheck.c
$CC -std=gnu99 -E -include library/cprover.h -D__CPROVER_bool=_Bool -D__CPROVER_thread_local=__thread -DLIBRARY_CHECK -o __libcheck.i __libcheck.c
$CC -S -Wall -Werror -pedantic -Wextra -std=gnu99 __libcheck.i -o __libcheck.s -Wno-unused-label
"$CC" -std=gnu99 -E -include library/cprover.h -D__CPROVER_bool=_Bool -D__CPROVER_thread_local=__thread -DLIBRARY_CHECK -o __libcheck.i __libcheck.c
"$CC" -S -Wall -Werror -pedantic -Wextra -std=gnu99 __libcheck.i -o __libcheck.s -Wno-unused-label
ec="${?}"
rm __libcheck.s __libcheck.i __libcheck.c
[ "${ec}" -eq 0 ] || exit "${ec}"
Expand Down
6 changes: 4 additions & 2 deletions src/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@ add_custom_command(
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)

add_custom_target(cpp_library_check
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/library-check.stamp
if(NOT "${CMAKE_CXX_COMPILER_ID}" STREQUAL "MSVC")
add_custom_target(cpp_library_check
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/library-check.stamp
)
endif()

################################################################################

Expand Down