Skip to content

Commit

Permalink
On Windows, add lrand48 sources to Csmith compile.
Browse files Browse the repository at this point in the history
When using CMake to build Csmith on Windows, compile and link with an
implementation of `lrand48`.

This commit also moves the relevant source files from `runtime/windows`
to `src/windows`.  Until now, we would distribute the source files but
not compile them or link them with Csmith.
  • Loading branch information
eeide committed May 23, 2017
1 parent 025a76a commit ef1f45a
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions src/CMakeLists.txt
Expand Up @@ -43,7 +43,7 @@ configure_file("git_version.cpp.in" "git_version.cpp" @ONLY)
include_directories(${CMAKE_BINARY_DIR})
include_directories(${PROJECT_SOURCE_DIR}) # needed for gen'ed .cpp files

add_executable(csmith
set(csmith_SOURCES
${CMAKE_BINARY_DIR}/config.h
AbsExtension.cpp
AbsExtension.h
Expand Down Expand Up @@ -205,14 +205,27 @@ add_executable(csmith
util.cpp
util.h
${PROJECT_BINARY_DIR}/git_version.cpp
)
)
if(WIN32)
include_directories(${PROJECT_SOURCE_DIR}/windows)
list(APPEND csmith_SOURCES
windows/_rand48.c
windows/lrand48.c
windows/rand48.h
windows/srand48.c
)
endif()

add_executable(csmith
${csmith_SOURCES}
)

# target_link_libraries(csmith ...)

install(PROGRAMS
"${PROJECT_BINARY_DIR}/csmith"
DESTINATION "${BIN_DIR}"
)
)

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

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit ef1f45a

Please sign in to comment.