-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge option for werror and improved build scripts pr #4 from UPPAALM…
…odelChecker/fix-werror Added compile.sh build script and toolchain files, made `-Werror` optional
- Loading branch information
Showing
13 changed files
with
141 additions
and
31 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 |
---|---|---|
|
@@ -2,4 +2,5 @@ | |
/win-build | ||
/.idea | ||
/build | ||
/build-* | ||
/cmake-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
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,36 @@ | ||
#!/usr/bin/env bash | ||
set -e | ||
|
||
PROJECT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" | ||
TOOLCHAIN_FILE="$CMAKE_TOOLCHAIN_FILE" | ||
BUILD_TYPE="$CMAKE_BUILD_TYPE" | ||
|
||
if [ "$#" == 0 ]; then | ||
echo "Script $0 compiles the project for specific targets specified as arguments." | ||
echo "The following targets are supported:" | ||
for f in "$PROJECT_DIR"/toolchains/*.cmake ; do | ||
target=$(basename "$f") | ||
target=${target%.cmake} | ||
echo -n " $target" | ||
done | ||
echo "" | ||
echo "The script is sensitive to CMAKE_BUILD_TYPE and CMAKE_TOOLCHAIN_FILE." | ||
exit 1 | ||
fi | ||
|
||
for target in "$@" ; do | ||
if [ -z "$TOOLCHAIN_FILE" ]; then | ||
if [ -r "$PROJECT_DIR/toolchains/$target.cmake" ]; then | ||
export CMAKE_TOOLCHAIN_FILE="$PROJECT_DIR/toolchains/$target.cmake" | ||
else | ||
unset CMAKE_TOOLCHAIN_FILE | ||
fi | ||
fi | ||
if [ -z "$BUILD_TYPE" ]; then | ||
export CMAKE_BUILD_TYPE=Debug | ||
fi | ||
BUILD_DIR="build-$target-${CMAKE_BUILD_TYPE,,}" | ||
cmake -B "$BUILD_DIR" -S "$PROJECT_DIR" | ||
cmake --build "$BUILD_DIR" --config $CMAKE_BUILD_TYPE | ||
ctest --test-dir "$BUILD_DIR" --config $CMAKE_BUILD_TYPE --output-on-failure | ||
done |
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 |
---|---|---|
@@ -1,10 +1,8 @@ | ||
add_compile_options(-Wpedantic -Wall -Wextra -Werror) | ||
|
||
add_library(uls_lib OBJECT server.cpp highlight.cpp system.cpp utap_extension.cpp declarations.cpp renaming.cpp common_data.cpp autocomplete.cpp) | ||
target_link_libraries(uls_lib PUBLIC UTAP nlohmann_json::nlohmann_json) | ||
target_include_directories(uls_lib PUBLIC "${CMAKE_SOURCE_DIR}/include/") | ||
|
||
add_executable(uls main.cpp) | ||
target_link_libraries(uls PRIVATE uls_lib) | ||
|
||
install(TARGETS uls RUNTIME) | ||
install(TARGETS uls RUNTIME) |
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,12 @@ | ||
# which tools to use | ||
set(CMAKE_C_COMPILER clang) | ||
set(CMAKE_CXX_COMPILER clang++) | ||
|
||
# adjust the default behavior of the FIND_XXX() commands: | ||
|
||
# search programs in the host environment | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
|
||
# search headers and libraries in the target environment | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) |
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,12 @@ | ||
# which tools to use | ||
set(CMAKE_C_COMPILER gcc-10) | ||
set(CMAKE_CXX_COMPILER g++-10) | ||
|
||
# adjust the default behavior of the FIND_XXX() commands: | ||
|
||
# search programs in the host environment | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
|
||
# search headers and libraries in the target environment | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) |
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,12 @@ | ||
# which tools to use | ||
set(CMAKE_C_COMPILER gcc-11) | ||
set(CMAKE_CXX_COMPILER g++-11) | ||
|
||
# adjust the default behavior of the FIND_XXX() commands: | ||
|
||
# search programs in the host environment | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
|
||
# search headers and libraries in the target environment | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) |
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,12 @@ | ||
# which tools to use | ||
set(CMAKE_C_COMPILER gcc-12) | ||
set(CMAKE_CXX_COMPILER g++-12) | ||
|
||
# adjust the default behavior of the FIND_XXX() commands: | ||
|
||
# search programs in the host environment | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
|
||
# search headers and libraries in the target environment | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) |
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,12 @@ | ||
# which tools to use | ||
set(CMAKE_C_COMPILER gcc-13) | ||
set(CMAKE_CXX_COMPILER g++-13) | ||
|
||
# adjust the default behavior of the FIND_XXX() commands: | ||
|
||
# search programs in the host environment | ||
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) | ||
|
||
# search headers and libraries in the target environment | ||
set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) | ||
set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) |
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