-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #100 from pks-t/pks-ci-win32
ci: wire up support for Win32
- Loading branch information
Showing
8 changed files
with
93 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
/build/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
cmake_minimum_required(VERSION 3.16..3.29) | ||
|
||
project(clar LANGUAGES C) | ||
|
||
option(BUILD_TESTS "Build test executable" ON) | ||
|
||
add_library(clar INTERFACE) | ||
target_sources(clar INTERFACE | ||
clar.c | ||
clar.h | ||
clar/fixtures.h | ||
clar/fs.h | ||
clar/print.h | ||
clar/sandbox.h | ||
clar/summary.h | ||
) | ||
set_target_properties(clar PROPERTIES | ||
C_STANDARD 90 | ||
C_STANDARD_REQUIRED ON | ||
C_EXTENSIONS OFF | ||
) | ||
|
||
if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME) | ||
include(CTest) | ||
if(BUILD_TESTING) | ||
add_subdirectory(test) | ||
endif() | ||
endif() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
find_package(Python COMPONENTS Interpreter REQUIRED) | ||
|
||
add_custom_command(OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/clar.suite" | ||
COMMAND "${Python_EXECUTABLE}" "${CMAKE_SOURCE_DIR}/generate.py" --output "${CMAKE_CURRENT_BINARY_DIR}" | ||
DEPENDS main.c sample.c clar_test.h | ||
WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" | ||
) | ||
|
||
add_executable(clar_test) | ||
set_target_properties(clar_test PROPERTIES | ||
C_STANDARD 90 | ||
C_STANDARD_REQUIRED ON | ||
C_EXTENSIONS OFF | ||
) | ||
|
||
# MSVC generates all kinds of warnings. We may want to fix these in the future | ||
# and then unconditionally treat warnings as errors. | ||
if(NOT MSVC) | ||
set_target_properties(clar_test PROPERTIES | ||
COMPILE_WARNING_AS_ERROR ON | ||
) | ||
endif() | ||
|
||
target_sources(clar_test PRIVATE | ||
main.c | ||
sample.c | ||
"${CMAKE_CURRENT_BINARY_DIR}/clar.suite" | ||
) | ||
target_compile_definitions(clar_test PRIVATE | ||
CLAR_FIXTURE_PATH="${CMAKE_CURRENT_SOURCE_DIR}/resources/" | ||
_DARWIN_C_SOURCE | ||
_POSIX_C_SOURCE=200809L | ||
) | ||
target_compile_options(clar_test PRIVATE | ||
$<IF:$<CXX_COMPILER_ID:MSVC>,/W4,-Wall> | ||
) | ||
target_include_directories(clar_test PRIVATE | ||
"${CMAKE_SOURCE_DIR}" | ||
"${CMAKE_CURRENT_BINARY_DIR}" | ||
) | ||
target_link_libraries(clar_test clar) |
This file was deleted.
Oops, something went wrong.