Skip to content

Commit 4a7dd07

Browse files
committed
Fix builds on mingw
1 parent 5a54b62 commit 4a7dd07

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

CMakeLists.txt

+2-2
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ target_include_directories(jssc PRIVATE ${JNI_INCLUDE_DIRS} ${JSSC_ADDITIONAL_IN
9494
set_target_properties(jssc PROPERTIES VERSION ${PROJECT_VERSION})
9595
set_target_properties(jssc PROPERTIES PUBLIC_HEADER target/nar/javah-include/jssc_SerialNativeInterface.h)
9696
set_target_properties(jssc PROPERTIES POSITION_INDEPENDENT_CODE ON)
97-
if(MSVC)
98-
# Fix paths for Debug/Release
97+
if(WIN32)
98+
# Fix paths for MSVC (Debug/Release) and MINGW
9999
set_target_properties(jssc PROPERTIES RUNTIME_OUTPUT_DIRECTORY_DEBUG "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
100100
set_target_properties(jssc PROPERTIES RUNTIME_OUTPUT_DIRECTORY_RELEASE "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}")
101101
endif()

pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@
203203
</profile>
204204

205205
<!-- mingw32 profile -->
206-
<!-- TODO: Untested. Test this mingw32 profile: "mvn -P cmake-mingw32 install" -->
207206
<profile>
208207
<id>cmake-mingw32</id>
209208
<properties>
@@ -212,11 +211,11 @@
212211
<cmake.classifier>windows-x86_32</cmake.classifier>
213212
<cmake.option.first>-DCMAKE_TOOLCHAIN_FILE=toolchain/Mingw32.cmake</cmake.option.first>
214213
<cmake.option.second>-DNATIVE_LIB_DIR=${native.lib.directory}</cmake.option.second>
214+
<cmake.child.dir>bin/cmake</cmake.child.dir>
215215
</properties>
216216
</profile>
217217

218218
<!-- mingw64 profile -->
219-
<!-- TODO: Untested. Test this mingw64 profile: "mvn -P cmake-mingw64 install" -->
220219
<profile>
221220
<id>cmake-mingw64</id>
222221
<properties>
@@ -225,6 +224,7 @@
225224
<cmake.classifier>windows-x86_64</cmake.classifier>
226225
<cmake.option.first>-DCMAKE_TOOLCHAIN_FILE=toolchain/Mingw64.cmake</cmake.option.first>
227226
<cmake.option.second>-DNATIVE_LIB_DIR=${native.lib.directory}</cmake.option.second>
227+
<cmake.child.dir>bin/cmake</cmake.child.dir>
228228
</properties>
229229
</profile>
230230

0 commit comments

Comments
 (0)