aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore3
-rw-r--r--CMakeLists.txt17
-rw-r--r--include/cru/base/Base.h2
-rw-r--r--include/cru/parse/Base.h2
-rw-r--r--include/cru/platform/Base.h2
-rw-r--r--include/cru/platform/GraphicsBase.h2
-rw-r--r--include/cru/platform/bootstrap/Bootstrap.h2
-rw-r--r--include/cru/platform/graphics/Base.h2
-rw-r--r--include/cru/platform/graphics/direct2d/Base.h2
-rw-r--r--include/cru/platform/gui/Base.h2
-rw-r--r--include/cru/platform/gui/win/Base.h2
-rw-r--r--include/cru/platform/win/Base.h2
-rw-r--r--include/cru/toml/Base.h2
-rw-r--r--include/cru/ui/Base.h2
-rw-r--r--include/cru/xml/Base.h2
-rw-r--r--test/base/SubProcessTest.cpp5
16 files changed, 38 insertions, 13 deletions
diff --git a/.gitignore b/.gitignore
index 9859bb9e..0a928c07 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,8 +1,11 @@
.DS_Store
+.vs
+
.cache
build
build-clang
+build-dynamic
compile_commands.json
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 281de58b..3b26a29d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -40,3 +40,20 @@ endif()
set(CLANGD_TEMPLATE ${PROJECT_SOURCE_DIR}/scripts/clangd.in)
configure_file(${CLANGD_TEMPLATE} ${CLANGD_FILE})
+function(cru_process_dir dir)
+ get_property(targets DIRECTORY "${dir}" PROPERTY BUILDSYSTEM_TARGETS)
+ foreach(target ${targets})
+ if(WIN32)
+ get_property(target_type TARGET "${target}" PROPERTY TYPE)
+ if("${target_type}" STREQUAL "SHARED_LIBRARY")
+ target_compile_definitions("${target}" PRIVATE CRU_IS_DLL=1)
+ endif()
+ endif()
+ endforeach()
+ get_property(subdirectories DIRECTORY "${dir}" PROPERTY SUBDIRECTORIES)
+ foreach(subdir ${subdirectories})
+ cru_process_dir("${subdir}")
+ endforeach()
+endfunction()
+
+cru_process_dir(".")
diff --git a/include/cru/base/Base.h b/include/cru/base/Base.h
index bd889645..369dd5c3 100644
--- a/include/cru/base/Base.h
+++ b/include/cru/base/Base.h
@@ -4,7 +4,7 @@
#include <functional>
#include <memory>
-#ifdef CRU_PLATFORM_WINDOWS
+#ifdef CRU_IS_DLL
#ifdef CRU_BASE_EXPORT_API
#define CRU_BASE_API __declspec(dllexport)
#else
diff --git a/include/cru/parse/Base.h b/include/cru/parse/Base.h
index 8f3a05e9..56d655e3 100644
--- a/include/cru/parse/Base.h
+++ b/include/cru/parse/Base.h
@@ -1,6 +1,6 @@
#pragma once
-#ifdef CRU_PLATFORM_WINDOWS
+#ifdef CRU_IS_DLL
#ifdef CRU_PARSE_EXPORT_API
#define CRU_PARSE_API __declspec(dllexport)
#else
diff --git a/include/cru/platform/Base.h b/include/cru/platform/Base.h
index 8589e6cb..4bcca380 100644
--- a/include/cru/platform/Base.h
+++ b/include/cru/platform/Base.h
@@ -1,6 +1,6 @@
#pragma once
-#ifdef CRU_PLATFORM_WINDOWS
+#ifdef CRU_IS_DLL
#ifdef CRU_PLATFORM_EXPORT_API
#define CRU_PLATFORM_API __declspec(dllexport)
#else
diff --git a/include/cru/platform/GraphicsBase.h b/include/cru/platform/GraphicsBase.h
index 5c4435ea..c9f7626c 100644
--- a/include/cru/platform/GraphicsBase.h
+++ b/include/cru/platform/GraphicsBase.h
@@ -52,7 +52,7 @@ inline String ToString(const Point& point) {
return String::FromUtf8(ToUtf8String(point));
}
-struct CRU_PLATFORM_API Size final {
+struct Size final {
static const Size kMax;
static const Size kZero;
diff --git a/include/cru/platform/bootstrap/Bootstrap.h b/include/cru/platform/bootstrap/Bootstrap.h
index 4ef522f2..42b4cbb6 100644
--- a/include/cru/platform/bootstrap/Bootstrap.h
+++ b/include/cru/platform/bootstrap/Bootstrap.h
@@ -2,7 +2,7 @@
#include "cru/platform/graphics/Factory.h"
#include "cru/platform/gui/UiApplication.h"
-#ifdef CRU_PLATFORM_WINDOWS
+#ifdef CRU_IS_DLL
#ifdef CRU_PLATFORM_BOOTSTRAP_EXPORT_API
#define CRU_PLATFORM_BOOTSTRAP_API __declspec(dllexport)
#else
diff --git a/include/cru/platform/graphics/Base.h b/include/cru/platform/graphics/Base.h
index 3f3ae0b4..a61eb2a7 100644
--- a/include/cru/platform/graphics/Base.h
+++ b/include/cru/platform/graphics/Base.h
@@ -4,7 +4,7 @@
#include "../Matrix.h"
#include "../Resource.h"
-#ifdef CRU_PLATFORM_WINDOWS
+#ifdef CRU_IS_DLL
#ifdef CRU_PLATFORM_GRAPHICS_EXPORT_API
#define CRU_PLATFORM_GRAPHICS_API __declspec(dllexport)
#else
diff --git a/include/cru/platform/graphics/direct2d/Base.h b/include/cru/platform/graphics/direct2d/Base.h
index a2f6772c..55942e53 100644
--- a/include/cru/platform/graphics/direct2d/Base.h
+++ b/include/cru/platform/graphics/direct2d/Base.h
@@ -7,7 +7,7 @@
#include <dxgi1_2.h>
#include <wrl/client.h>
-#ifdef CRU_PLATFORM_WINDOWS
+#ifdef CRU_IS_DLL
#ifdef CRU_WIN_GRAPHICS_DIRECT_EXPORT_API
#define CRU_WIN_GRAPHICS_DIRECT_API __declspec(dllexport)
#else
diff --git a/include/cru/platform/gui/Base.h b/include/cru/platform/gui/Base.h
index f84e815e..83d07582 100644
--- a/include/cru/platform/gui/Base.h
+++ b/include/cru/platform/gui/Base.h
@@ -5,7 +5,7 @@
#include "../Resource.h"
-#ifdef CRU_PLATFORM_WINDOWS
+#ifdef CRU_IS_DLL
#ifdef CRU_PLATFORM_GUI_EXPORT_API
#define CRU_PLATFORM_GUI_API __declspec(dllexport)
#else
diff --git a/include/cru/platform/gui/win/Base.h b/include/cru/platform/gui/win/Base.h
index d9a81068..5c9ab7d3 100644
--- a/include/cru/platform/gui/win/Base.h
+++ b/include/cru/platform/gui/win/Base.h
@@ -3,7 +3,7 @@
#include "cru/base/Base.h"
-#ifdef CRU_PLATFORM_WINDOWS
+#ifdef CRU_IS_DLL
#ifdef CRU_WIN_GUI_EXPORT_API
#define CRU_WIN_GUI_API __declspec(dllexport)
#else
diff --git a/include/cru/platform/win/Base.h b/include/cru/platform/win/Base.h
index 75da7287..fce89b04 100644
--- a/include/cru/platform/win/Base.h
+++ b/include/cru/platform/win/Base.h
@@ -2,7 +2,7 @@
#include "WinPreConfig.h"
-#ifdef CRU_PLATFORM_WINDOWS
+#ifdef CRU_IS_DLL
#ifdef CRU_WIN_EXPORT_API
#define CRU_WIN_API __declspec(dllexport)
#else
diff --git a/include/cru/toml/Base.h b/include/cru/toml/Base.h
index de1d558c..76c7ee71 100644
--- a/include/cru/toml/Base.h
+++ b/include/cru/toml/Base.h
@@ -1,6 +1,6 @@
#pragma once
-#ifdef CRU_PLATFORM_WINDOWS
+#ifdef CRU_IS_DLL
#ifdef CRU_TOML_EXPORT_API
#define CRU_TOML_API __declspec(dllexport)
#else
diff --git a/include/cru/ui/Base.h b/include/cru/ui/Base.h
index 78b8ccf9..b4b2f18e 100644
--- a/include/cru/ui/Base.h
+++ b/include/cru/ui/Base.h
@@ -3,7 +3,7 @@
#include "cru/platform/graphics/Base.h"
#include "cru/platform/gui/Base.h"
-#ifdef CRU_PLATFORM_WINDOWS
+#ifdef CRU_IS_DLL
#ifdef CRU_UI_EXPORT_API
#define CRU_UI_API __declspec(dllexport)
#else
diff --git a/include/cru/xml/Base.h b/include/cru/xml/Base.h
index 5d6fe144..aa3aeaa2 100644
--- a/include/cru/xml/Base.h
+++ b/include/cru/xml/Base.h
@@ -1,6 +1,6 @@
#pragma once
-#ifdef CRU_PLATFORM_WINDOWS
+#ifdef CRU_IS_DLL
#ifdef CRU_XML_EXPORT_API
#define CRU_XML_API __declspec(dllexport)
#else
diff --git a/test/base/SubProcessTest.cpp b/test/base/SubProcessTest.cpp
index d353dec0..cc241b6f 100644
--- a/test/base/SubProcessTest.cpp
+++ b/test/base/SubProcessTest.cpp
@@ -7,6 +7,11 @@ using cru::String;
using cru::SubProcess;
TEST_CASE("SubProcess", "[subprocess]") {
+
+#ifdef _WIN32
+ SKIP("SubProcess is not implemented on Windows for now.");
+#endif
+
SECTION("echo should work.") {
SubProcess process = SubProcess::Create(
String::FromUtf8(CRU_TEST_HELPER_ECHO_LOCATION), {u"abc"});