generated from CoolLibs/library-template
-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
881827f
commit 1c631ef
Showing
7 changed files
with
43 additions
and
39 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,34 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
|
||
set(WARNINGS_AS_ERRORS_FOR_OPEN_LINK OFF CACHE BOOL "ON iff you want to treat warnings as errors") | ||
set(WARNINGS_AS_ERRORS_FOR_OPEN OFF CACHE BOOL "ON iff you want to treat warnings as errors") | ||
|
||
add_library(open_link) | ||
add_library(open_link::open_link ALIAS open_link) | ||
target_compile_features(open_link PUBLIC cxx_std_11) | ||
add_library(open) | ||
add_library(Cool::open ALIAS open) | ||
target_compile_features(open PUBLIC cxx_std_11) | ||
|
||
# ---Add source files--- | ||
if(WARNINGS_AS_ERRORS_FOR_OPEN_LINK) | ||
target_include_directories(open_link PUBLIC include) | ||
if(WARNINGS_AS_ERRORS_FOR_OPEN) | ||
target_include_directories(open PUBLIC include) | ||
else() | ||
target_include_directories(open_link SYSTEM PUBLIC include) | ||
target_include_directories(open SYSTEM PUBLIC include) | ||
endif() | ||
target_sources(open_link PRIVATE | ||
src/open_link.cpp | ||
|
||
target_sources(open PRIVATE | ||
src/open.cpp | ||
) | ||
|
||
# Set warning level | ||
if(MSVC) | ||
target_compile_options(open_link PRIVATE /W4) | ||
target_compile_options(open PRIVATE /W4) | ||
else() | ||
target_compile_options(open_link PRIVATE -Wall -Wextra -Wpedantic -pedantic-errors -Wconversion -Wsign-conversion -Wno-unused-result) | ||
target_compile_options(open PRIVATE -Wall -Wextra -Wpedantic -pedantic-errors -Wconversion -Wsign-conversion -Wno-unused-result) | ||
endif() | ||
|
||
# Maybe enable warnings as errors | ||
if(WARNINGS_AS_ERRORS_FOR_OPEN_LINK) | ||
if(WARNINGS_AS_ERRORS_FOR_OPEN) | ||
if(MSVC) | ||
target_compile_options(open_link PRIVATE /WX) | ||
target_compile_options(open PRIVATE /WX) | ||
else() | ||
target_compile_options(open_link PRIVATE -Werror) | ||
target_compile_options(open PRIVATE -Werror) | ||
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#pragma once | ||
|
||
namespace Cool { | ||
|
||
/// Opens the link in the user's default web browser, or the folder in the folder explorer, or the file in the default configured software. | ||
void open(const char* link); | ||
|
||
} // namespace Cool |
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
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
#include <open_link/open_link.hpp> | ||
#include <open/open.hpp> | ||
|
||
// This should open the GitHub page of open_link. | ||
// This should open the GitHub page of open. | ||
auto main() -> int | ||
{ | ||
Cool::open_link("https://github.com/CoolLibs/open_link"); | ||
Cool::open("https://github.com/CoolLibs/open"); | ||
} |