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
Added support for the C(XX)_STANDARD and C(XX)_EXTENSIONS properties. #17
Open
dutow
wants to merge
4
commits into
larsch:master
Choose a base branch
from
dutow:cxx_standard
base: master
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
6304cae
Added support for the C(XX)_STANDARD and C(XX)_EXTENSIONS.
dutow f2abe7d
Implemented support for PCHs in various directories on GCC.
dutow e888477
Handling position independent code
dutow 3f9abe6
Modified test scrit to exit with error code and added travis config
dutow File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
sudo: true | ||
|
||
script: | ||
- bash runall.sh |
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
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,16 @@ | ||
cmake_minimum_required(VERSION 3.3) | ||
cmake_policy(SET CMP0058 NEW) | ||
enable_testing() | ||
project(test-cxx-pic-shared) | ||
include(../../PrecompiledHeader.cmake) | ||
if(MSVC) | ||
add_definitions(-D_CRT_SECURE_NO_WARNINGS) | ||
set(pch_source test-pch.cpp) | ||
endif() | ||
set(CMAKE_CXX_FLAGS "${CMAKH_CXX_FLAGS} -Werror") | ||
set(CMAKE_C_FLAGS "${CMAKH_CXX_FLAGS} -Werror") | ||
add_library(test-cxx-pic-lib SHARED test-cxx-lib.cpp test-pch.h ${pch_source}) | ||
add_precompiled_header(test-cxx-pic-lib test-pch.h FORCEINCLUDE) | ||
add_executable(test-cxx-pic-shared test-cxx.cpp) | ||
target_link_libraries(test-cxx-pic-shared test-cxx-pic-lib) | ||
add_test(test-cxx-pic-shared test-cxx-pic-shared) |
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,4 @@ | ||
#ifndef PCH | ||
#error Missing precompiled header | ||
#endif | ||
int foo() { return 1; } |
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,5 @@ | ||
#include "test-pch.h" | ||
#ifndef PCH | ||
#error Missing precompiled header | ||
#endif | ||
int main() { return foo() == 1 && !(PCH == atoi(getenv("EXPECTED_PCH"))); } |
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 @@ | ||
#include "test-pch.h" |
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,7 @@ | ||
#define PCH 1 | ||
#ifdef __cplusplus | ||
#include <cstdlib> | ||
#else | ||
#include <stdlib.h> | ||
#endif | ||
int foo(); |
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,17 @@ | ||
cmake_minimum_required(VERSION 3.3) | ||
cmake_policy(SET CMP0058 NEW) | ||
enable_testing() | ||
project(test-cxx-pic) | ||
include(../../PrecompiledHeader.cmake) | ||
if(MSVC) | ||
add_definitions(-D_CRT_SECURE_NO_WARNINGS) | ||
set(pch_source test-pch.cpp) | ||
endif() | ||
set(CMAKE_CXX_FLAGS "${CMAKH_CXX_FLAGS} -Werror") | ||
set(CMAKE_C_FLAGS "${CMAKH_CXX_FLAGS} -Werror") | ||
add_library(test-cxx-pic-lib STATIC test-cxx-lib.cpp test-pch.h ${pch_source}) | ||
set_target_properties(test-cxx-pic-lib PROPERTIES POSITION_INDEPENDENT_CODE ON) | ||
add_precompiled_header(test-cxx-pic-lib test-pch.h FORCEINCLUDE) | ||
add_executable(test-cxx-pic test-cxx.cpp) | ||
target_link_libraries(test-cxx-pic test-cxx-pic-lib) | ||
add_test(test-cxx-pic test-cxx-pic) |
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,4 @@ | ||
#ifndef PCH | ||
#error Missing precompiled header | ||
#endif | ||
int foo() { return 1; } |
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,5 @@ | ||
#include "test-pch.h" | ||
#ifndef PCH | ||
#error Missing precompiled header | ||
#endif | ||
int main() { return foo() == 1 && !(PCH == atoi(getenv("EXPECTED_PCH"))); } |
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 @@ | ||
#include "test-pch.h" |
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,7 @@ | ||
#define PCH 1 | ||
#ifdef __cplusplus | ||
#include <cstdlib> | ||
#else | ||
#include <stdlib.h> | ||
#endif | ||
int foo(); |
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,15 @@ | ||
cmake_minimum_required(VERSION 3.3) | ||
cmake_policy(SET CMP0058 NEW) | ||
enable_testing() | ||
project(test-cxx-pie) | ||
include(../../PrecompiledHeader.cmake) | ||
if(MSVC) | ||
add_definitions(-D_CRT_SECURE_NO_WARNINGS) | ||
set(pch_source test-pch.cpp) | ||
endif() | ||
set(CMAKE_CXX_FLAGS "${CMAKH_CXX_FLAGS} -Werror") | ||
set(CMAKE_C_FLAGS "${CMAKH_CXX_FLAGS} -Werror") | ||
add_executable(test-cxx-pie test-cxx.cpp test-pch.h ${pch_source}) | ||
set_target_properties(test-cxx-pie PROPERTIES POSITION_INDEPENDENT_CODE ON) | ||
add_precompiled_header(test-cxx-pie test-pch.h FORCEINCLUDE) | ||
add_test(test-cxx-pie test-cxx-pie) |
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,4 @@ | ||
#ifndef PCH | ||
#error Missing precompiled header | ||
#endif | ||
int main() { return !(PCH == atoi(getenv("EXPECTED_PCH"))); } |
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 @@ | ||
#include "test-pch.h" |
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,6 @@ | ||
#define PCH 1 | ||
#ifdef __cplusplus | ||
#include <cstdlib> | ||
#else | ||
#include <stdlib.h> | ||
#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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
cmake_minimum_required(VERSION 3.3) | ||
cmake_policy(SET CMP0058 NEW) | ||
enable_testing() | ||
project(test-cxx11) | ||
include(../../PrecompiledHeader.cmake) | ||
if(MSVC) | ||
add_definitions(-D_CRT_SECURE_NO_WARNINGS) | ||
set(pch_source test-pch.cpp) | ||
endif() | ||
set(CMAKE_CXX_FLAGS "${CMAKH_CXX_FLAGS} -Werror") | ||
set(CMAKE_C_FLAGS "${CMAKH_CXX_FLAGS} -Werror") | ||
set(CMAKE_CXX_STANDARD 11) | ||
add_executable(test-cxx11 test-cxx.cpp test-pch.h ${pch_source}) | ||
add_precompiled_header(test-cxx11 test-pch.h) | ||
add_test(test-cxx11 test-cxx11) |
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,5 @@ | ||
#include "test-pch.h" | ||
#ifndef PCH | ||
#error Missing precompiled header | ||
#endif | ||
int main() { return !(PCH == atoi(getenv("EXPECTED_PCH"))); } |
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 @@ | ||
#include "test-pch.h" |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo: CMAKH ===> CMAKE
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ops, thanks, I'll fix that