Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
101 additions
and
1 deletion.
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,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 |